Inserting mutable pairs into a mutable list

Posted by Romelus on Stack Overflow See other posts from Stack Overflow or by Romelus
Published on 2011-01-17T09:33:38Z Indexed on 2011/01/17 9:53 UTC
Read the original article Hit count: 403

Filed under:
|
|

How can I push a mutable pair onto a stack such that i'm only creating one stack. I have some code that works but creates lists within lists within lists.... Here is what I believe should work but throws an error.

(define func (arg1 arg2 arg3) // Where arg3 is an empty list
    (mappend (mcons arg1 arg2) arg3))

The above code complains and says: "mcar: expects argument of type ; given ... Can anyone show me how I can get a result that looks like so,: (list (arg1 arg2) (arg# arg#) ...)

© Stack Overflow or respective owner

Related posts about lisp

Related posts about Scheme