Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

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>
  • Prev by Date: Re: Re: DSolve and K$31, i am puzzled
  • Next by Date: Perron Number Tiling Systems -- from Mathematica Information Center
  • Previous by thread: Lists
  • Next by thread: Perron Number Tiling Systems -- from Mathematica Information Center