[plt-scheme] set-car! in EOPL language
On Mon, Jul 13, 2009 at 2:49 PM, Marco Morazan<morazanm at gmail.com> wrote:
> Dear All,
>
> On this bit of code:
>
> (cases node (car nodelist)
> (a-node (n fl neighs v)
> (set-car! nodelist (a-node n fl node-neighbors v))))
>
> where nodelist is a list of nodes (a defined datatype), I get this error:
>
> Welcome to DrScheme, version 4.2 [3m].
> Language: Essentials of Programming Languages (3rd ed.); memory limit:
> 128 megabytes.
> . . reference to undefined identifier: set-car!
>>
>
> Why is set-car! undefined? Solution?
> --
>
> Cheers,
>
> Marco
Lists in PLT scheme are immutable. Read up on mutable lists:
http://docs.plt-scheme.org/reference/mpairs.html