freenode/#lisp - IRC Chatlog
Search
12:43:26
drmeister
Is there a way to shut down pretty printing for trace output? Or is this an implementation dependent detail?
12:44:35
Shinmera
Well, setting *print-pretty* is an option unless the implementation changes that itself during tracing.
12:48:23
scymtym
maybe implementations could add something along the lines of SB-EXT:*DEBUG-PRINT-VARIABLE-ALIST* for TRACE
12:48:58
drmeister
Sometimes in clasp trace generates pretty printed output and other times it doesn't.
12:49:27
drmeister
It's pretty much "(setq *print-pretty* <which one doesn't drmeister want right now>)"
13:01:16
drmeister
(blush) Simply (setf *print-pretty* nil) in the slime repl turns pretty printing off for trace
17:39:24
jackdaniel
Devon: advices are supported only by CCL I think (I don't count commercial implementations because I don't use them so don't know)
17:40:16
jackdaniel
s/commercial/locked down/ - corrected myself because foss implementation may be commercial, why not
17:49:35
Devon
Any CL lacking DEFADVICE is an outlier, it may not be in the spec but it's in the culture.
17:50:46
jackdaniel
(probably because sbcl doesn't have it though, most libraries are developed with sbcl ;)
17:52:52
pjb
Adding an advice would require recompiling all the files that use the adviced function.
17:53:02
jackdaniel
actually more like: practice makes culture -thinking otherwise is called social engineering ;-)
17:53:53
jasom
pjb: adding an advice would have exactly the same limits as redefining a function; and people do that with C-c C-c all the time
17:55:14
phoe
"There are three kinds of advice that may be defined: before, after and around advice."
17:56:25
Shinmera
On SBCL you can emulate advice by using (trace foo :report NIL :condition/-after/-all stuff)
17:57:04
makomo
could you use something like ensure-generic-function combined with standard method combination?
17:57:52
pjb
OR, you can not use cl:defun, instead define your own defun macro, implement the conforming tricks so that any library compiled will use your:defun and then you can conformingly have a defadvice that would work even with inlined function calls.
18:06:24
makomo
what's the best way to have something like an enumeration, i.e. a mapping from symbols to values?
18:07:45
makomo
i want it to hold globally, i don't want to have to wrap everything into a symbol-macrolet
18:11:16
Shinmera
Or just define a function that does an ecase to return the value, and have the function exist at compile-time with eval-when
18:11:54
makomo
i guess that's also an option. i suppose i could write a macro that would automatically give me the other direction as well right?
18:12:20
Shinmera
In that case I'd store the map as an alist in a variable, and define two functions to do the lookup in either direction.
18:12:33
scymtym
emacs' object system has an interesting combination of CLOS and an advice facility: method qualifiers can always be augmented with :extra STRING, basically allowing the "same" method to be defined multiple times, like named pieces of advice