• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

lisp macro Q

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
npe we haven't learned about environmental model.

and i didn't need to use it. but the eval statement you showed in ur code was the key for what i did

basically i just did
(defmacro ZERO (&rest L)
(do ...
(eval `(setf ,(car L) 0))
)
)

i had initially done that whole thing but without the eval part, as our prof. has never mentioned it (at laest not that i can recall), so it would never have crossed my midn to use it in my macro, but thankfully i ran into yah, and picked it up from you.
 
Originally posted by: Bacardi151
npe we haven't learned about environmental model.

and i didn't need to use it. but the eval statement you showed in ur code was the key for what i did

basically i just did
(defmacro ZERO (&rest L)
(do ...
(eval `(setf ,(car L) 0))
)
)

i had initially done that whole thing but without the eval part, as our prof. has never mentioned it (at laest not that i can recall), so it would never have crossed my midn to use it in my macro, but thankfully i ran into yah, and picked it up from you.

Interesting that the (eval) in LISP doesn't need an environment parameter. Maybe it's setup differently. But either way, the way eval works (in Scheme) is based on the environmental model...but you can just take it as a cute little function, heh heh.
 
yeah, i wasn't sure what it would do in lisp, let alone if it would work, but i just gave it a shot, and little did i know that it did work. and the function name itself is a give away of what it should do hehe, but yeah just glad you brought that function up hehe. thx again.

and oh yeah, i'll pm if i ever get stuck again hehe, but fortunately it's only 3 more weeks of this quarter, and i dont think our prof is going to get any deeper into lisp. (thankfully!)
 
Originally posted by: Bacardi151
yeah, i wasn't sure what it would do in lisp, let alone if it would work, but i just gave it a shot, and little did i know that it did work. and the function name itself is a give away of what it should do hehe, but yeah just glad you brought that function up hehe. thx again.

and oh yeah, i'll pm if i ever get stuck again hehe, but fortunately it's only 3 more weeks of this quarter, and i dont think our prof is going to get any deeper into lisp. (thankfully!)

haha, yeah it's an unique language...kind of cool, but also extremely annoying at times...

where do you go to school?
 
Originally posted by: eLiu
Originally posted by: Bacardi151
yeah, i wasn't sure what it would do in lisp, let alone if it would work, but i just gave it a shot, and little did i know that it did work. and the function name itself is a give away of what it should do hehe, but yeah just glad you brought that function up hehe. thx again.

and oh yeah, i'll pm if i ever get stuck again hehe, but fortunately it's only 3 more weeks of this quarter, and i dont think our prof is going to get any deeper into lisp. (thankfully!)

haha, yeah it's an unique language...kind of cool, but also extremely annoying at times...

where do you go to school?

just pm'd u
 
Back
Top