Re: Lists
- To: mathgroup at smc.vnet.net
- Subject: [mg57108] Re: [mg57100] Lists
- From: Chris Chiasson <chris.chiasson at gmail.com>
- Date: Mon, 16 May 2005 01:29:49 -0400 (EDT)
- References: <200505150704.DAA24019@smc.vnet.net>
- Reply-to: Chris Chiasson <chris.chiasson at gmail.com>
- Sender: owner-wri-mathgroup at wolfram.com
Are you attempting to do recursive programming?
On 5/15/05, Swati Shah <swatshah at gmail.com> wrote:
> Hi everyone,
>
> I have the following list and the code:
> tmp = {{1, 2, 3, 4, 4, 5}, {2, 3, 4, 7, 7, 7}};
>
> fitness[parameters_List] := Module[{test},
> Print [parameters];
> ];
>
> init[fitFct_, tmp_List] := Module[{fitnesses},
> Print [tmp];
> fitnesses = Map[fitFct, tmp];
> ]
>
> However, when I do the following I get an error
> init[fitness, tmp]
>
> It prints the tmp value in init correctly which is:
> {{1, 2, 3, 4, 4, 5}, {2, 3, 4, 7, 7, 7}}
>
> However gives an error after that.. (in the fitnesses)
> 12345
> Set::setraw Cannot assign to raw object 1
> 234777
> Set::setraw Cannot assign to raw object 2
>
> Just wondering as to why that is? I am not sure what I did wrong.
>
> Thanks a lot in advance.
>
>
--
Chris Chiasson
http://chrischiasson.com/
1 (810) 265-3161
- References:
- Lists
- From: Swati Shah <swatshah@gmail.com>
- Lists