Justin C. Walker on Thu, 11 Oct 2007 23:12:36 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: How to use forvec ?


Hi, Olivier,

On Oct 11, 2007, at 1:07 PM, Olivier Ramare wrote:

 Can you tell me why

forvec(toto=[[0,0],[1,1]],print(toto),0)

prints only

[0, 1]

Because that's what you asked for :-}.

The definition says that this will treat the entries 'toto[i]' as intervals from which to take the values of as many variables as there are entries. In your case, you are doing the moral equivalent of:
   for (i=0, 0, for (j=1, 1, print ([i,j])))

To get what you want, try

forvec(toto=[[0,1],[0,1]],print(toto),0)

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Absorption of Federal Funds
--------
Some people have a mental horizon of radius zero, and
call it their point of view.
  -- David Hilbert
--------