Re: [Wrapl-discussion] expr1 \ expr2
Brought to you by:
rajamukherji
|
From: Raja M. <raj...@gm...> - 2010-08-12 18:39:11
|
Hi Roman, Thanks for pointing out the error in the tutorial. The implementation is correct though, ALL 1:to(3) \ 10:to(12); should return [1, 1, 1, 2, 2, 2, 3, 3, 3], the values of (left for each right). This follows the general rule of left-to-right evaluation in Wrapl. In general A & B is equivalent to 2(A, B) and A \ B is equivalent to 1(A, B). The description in the tutorial is ambiguous though, I'll update the description along with the other changes you mentioned previously. Raja Roman Mishin wrote: > Hi Raja, > > I noticed one small inconsistency with "expr1 \ expr2" > > Tutorial Chapter 3 > (http://wrapl.sourceforge.net/ref/tutorial/chapter3.html) > > "expr1 \ expr2 produces the values produced by expr1 for each value > produced by expr2" > > ALL 1:to(3) \ 10:to(12); > actualy returns > [1, 1, 1, 2, 2, 2, 3, 3, 3] > not > [1, 2, 3, 1, 2, 3, 1, 2, 3] > as the example shows > > Tutorial states that "expr1 \ expr2" is similar to "expr1 & expr2", > such that it returns the value of left for each right, in contrast to > the value of right for each left. But that (factual) way their (& and > \) results are not symmetrical. > > -- > the values of (left for each right) [1, 1, 1, 2, 2, 2, 3, 3, 3] > vs. > (the values of left) for each right [1, 2, 3, 1, 2, 3, 1, 2, 3] > -- > > I guess it would make sense for it to behave that way: [1, 2, 3, 1, 2, > 3, 1, 2, 3] > > -- > Roman > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > ------------------------------------------------------------------------ > > _______________________________________________ > Wrapl-discussion mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapl-discussion > |