Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

(Scheme) set! vs set-car!/set-cdr!

Name: Anonymous 2008-01-25 12:02

Hello there Scheme magicians, I walked across the desert from lands far away to seek your wisdom.
So, I have a list value some-list set to () and I need to change it to, say, (0 1 2 3).  I can't use set! for obvious reasons (set! is like SETQ, a special form and not a first-class procedure) and I can't use set-car!/set-cdr! either because they want a mutable pair.  How do I assigned to a list variable, /prog/?

Name: Anonymous 2008-01-25 13:10

>>8-9
I want to change a list value associated with some symbol, not change any bindings, and due to Scheme's lexical scoping I have to pass it as a parameter, and set! changes only nearest instance of my variable, the external one remains the same.
I just want to mutate null and non-null lists with some procedure.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List