Search
Friday, 21st of July 2017, 21:03:51 UTC
21:21:29
SpurdoSportster
** NICK SpurdoSparde
22:37:59
quotation
pjb: I'm entirely for deprecating the entirety of the english language if not wholly extending it further into a "special" dialect accompanying the flavors of homoiconicity
22:49:13
slark
hello can someone explain why it works ? http://paste.lisp.org/display/351376
22:49:47
Bike
i uh, would not expect that to work.
22:50:00
slark
when i pass a variable to the macro it fails, but it works with a number can't really understand why it works
22:51:00
Bike
okay so you did everything wrong in such a way that it appears to work.
22:51:08
slark
Bike: well i know the macro def should be (list 'setq var (list '- var amount))) but well was just trying to mess a bit
22:51:22
Bike
right, so since you didn't do that, the macro /expander/ is what does the setq
22:51:48
Bike
and it sets var (not the symbol passed to the macro, var, every time) to (+ var amount)
22:52:02
Bike
and then returns that as the macroexpansion, because that's what setq returns.
22:52:43
slark
so it set the variable with the name "var"
22:53:12
Bike
because it's just a normal setq.
22:56:44
slark
Bike: .. macro is hard ;;
22:58:22
pjb
slark: it sets the variable named VAR in the compilation environment!
22:58:38
slark
pjb: yeah i finally understood it
22:58:48
pjb
Since this variable has not been declared (in the compilation environment) the actual behavior is actually implementation dependent.
22:59:04
Bike
pjb: it's a parameter to the macro function
23:00:15
slark
well in fact was thinking why should i return an expression to inc a variable when the inc could be done at expansion time
23:01:09
pjb
Because expansion time is normally done at compilation time, long before the values of the arguments are known.
2:07:58
warweasle1
** NICK warweasle
5:11:56
beach
Good morning everyone!
Saturday, 22nd of July 2017, 9:03:51 UTC