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

Lists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57100] Lists
  • From: Swati Shah <swatshah at gmail.com>
  • Date: Sun, 15 May 2005 03:04:04 -0400 (EDT)
  • Reply-to: Swati Shah <swatshah at gmail.com>
  • Sender: owner-wri-mathgroup at wolfram.com

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.


  • Follow-Ups:
    • Re: Lists
      • From: Chris Chiasson <chris.chiasson@gmail.com>
  • Prev by Date: Re: Intersection of coordinate axes in origin (3d plot)
  • Next by Date: Re: How to call a remote Kernal?
  • Previous by thread: Re: Pb with the function Plot
  • Next by thread: Re: Lists