freenode/#lisp - IRC Chatlog
Search
19:22:21
flip214
Trying to use CFFI:TRANSLATION-FORMS-FOR-CLASS I get "undefined variable: CFFI::SLOT-NAME"
19:22:44
flip214
there are no tests for CFFI:TRANSLATION-FORMS-FOR-CLASS; did anybody use that already (successfully)?
22:29:14
Bike
"The primary output of X3J13 was an American National Standard for programming language Common Lisp (X3.226/1994), approved December 8, 1994"
1:28:22
libertyprime
hey guys. could someone please write a macro for me pretty please. I just want something that's analogous to this emacs lisp. http://ix.io/1LhA ie.e it should run some code but first pass the code through another function
1:32:36
libertyprime
essentially i just need something which i can wrap around some syntax form and run a side effect using the raw code, then pass the raw code through transparently
1:34:11
Bike
i mean, i don't really get this, if run is apply then the func is actually called at macroexpansion time, and not at r untime
1:40:40
oni-on-ion
i think it does not matter what the meaning is. why are there two? it would work the same in common lisp as emacs lisp.
1:41:06
Bike
okay, so your macro applys func at macroexpansion time. is it supposed to? that seems like a very strange thing to do
1:41:54
libertyprime
i think im not good enough at emacs lisp to optimise it. all i know is it does the job for me. id just like to know how to achieve what i want, properly, in common lisp
1:44:21
Bike
yeah that really doesn't make sense. IDENTITY only takes one argument but it'll get a whole bunch of them here.
1:45:24
libertyprime
identity is used in 2 different ways here. when i macro expand the sideeffect function, i could expand it into a (progn) or an (identity), identity is able to handle the case where the body expands into a literal string, say
1:47:14
libertyprime
bike: that's alright. i havent found a way yet to handle multiple things. currently, it only handles a single argument, sexp or literal
1:48:08
Bike
It's not alright. In order to translate this for you we need to understand what it does, but what it does is incoherent.
1:48:45
libertyprime
if you cant handle a bit of incoherent code then you shouldnt be *helping* newer prammers
1:49:11
Bike
That's why I'm asking you what it does, but you haven't answered my macroexpansion question. Do you understand the question?
1:50:37
libertyprime
sorry, id like it to happen at macro expansion time because if i were to say make a trace function, i want to see the expression before its evaluated
1:52:41
Bike
So what you want is a macro that takes an operator and a body. At macroexpansion time it applies the operator to the unevaluated body. The macroexpansion then runs the body while suppressing errors. Is that right?
1:54:34
libertyprime
sigh sorry im sitting next to this girl i asked out -- demonstrating for computer science school
1:55:00
pjb
(defmacro m (operator &body body) (apply operator body) `(ignore-errors (progn ,@body)))
1:55:14
Bike
(defmacro sideffect (operator &rest body) (when operator (apply operator body)) `(ignore-errors ,@body)) (sideeffect print (error "hey")) => prints (error "hey") at macroexpansion time, then returns NIL, #<SIMPLE-ERROR>
1:55:49
Bike
in general you should avoid side effects at macro expansion time, though, since the implementation can macroexpand things as many times as it feels like
3:45:05
beach
Or does it mean that if get-setf-expansion does not return anything useful, then the SETF macro itself returns (SETF F)?
3:49:54
Bike
i don't think any implementations don't have the default be returned by get-setf-expansion, at least.