freenode/#lisp - IRC Chatlog
Search
22:28:06
plertrood
Is there a way I can get a list of all classes that have been defined with a given metaclass?
22:29:10
Bike
i guess you could look through all subclasses of standard-object, but i don't recommend that
22:30:27
plertrood
I'm sure I read in AMOP that there was a way to do this.. but damned if I can find it..
22:31:06
Shinmera
You could potentially do something with make-instances-obsolete & update-instance-fore-redefined-class, but I think the latter is only called lazily, which means when an instance is accessed.
22:34:19
plertrood
If it is the one i am thinking about, then validate superclass only gets called once an instance of that class is instantiated.
22:37:26
plertrood
It did surprise me that validate-superclass wasn't being called when I compiled a class with that metaclass.
0:59:06
billitch
svn: E170013: Unable to connect to a repository at URL 'svn://common-lisp.net/project/cl-irc/svn'
1:15:11
billitch
pjb: yes but the cl-uri page on common-lisp.net still references subversion and the WebSVN has content
1:17:32
pmc_
I tried this on CLISP and SBCL: (pprint (macroexpand-1 '(dotimes (x 5) (print x)))) but everything is printed on one line. Is there another way to pretty print a macro?
1:25:19
emaczen
How can I make (hunchentoot:define-easy-handler ((gensym) :uri ...)) accept (gensym)?
1:33:39
emaczen
pjb: I have this form inside of a function, and I really just want a different value everytime the function is called...
1:39:29
pjb
If you don't give a :initial-element or :initial-contents, then the slots are not initialized, and you are forbiddent to read them!
1:41:01
pjb
(map-into (make-array '(3)) (lambda () (make-array 4 :element-type 'double-float :initial-element 42.3d4))) #| --> #(#(423000.0D0 423000.0D0 423000.0D0 423000.0D0) #(423000.0D0 423000.0D0 423000.0D0 423000.0D0) #(423000.0D0 423000.0D0 423000.0D0 423000.0D0)) |#
1:41:46
pjb
Compare with: (make-array '(3) :initial-element (make-array 4 :element-type 'double-float :initial-element 42.3d4)) #| --> #(#1=#(423000.0D0 423000.0D0 423000.0D0 423000.0D0) #1# #1#) |#
1:42:33
pjb
You may of course use closures too: (map-into (make-array '(3)) (let ((i 0.0d0)) (lambda () (make-array 4 :element-type 'double-float :initial-element (incf i 1.0d0))))) #| --> #(#(1.0D0 1.0D0 1.0D0 1.0D0) #(2.0D0 2.0D0 2.0D0 2.0D0) #(3.0D0 3.0D0 3.0D0 3.0D0)) |#
2:08:44
fiddlerwoaroof
I've been symlinking libraries into ~/quicklisp/local-projects for a while now and, lately, recent versions of sbcl seem to ignore them
2:15:59
krwq
is there an alist equivalent for this example? (defparameter *x* nil) (pushnew 'test (getf *x* :foo)) (pushnew 'test (getf *x* :foo)) (pushnew 'test2 (getf *x* :foo)) *x* => (:FOO (TEST2 TEST))
2:41:07
pjb
(let ((a '())) (pushnew 'test (aget a :foo)) (pushnew 'test (aget a :foo)) (pushnew 'test2 (aget a :foo)) (aget a :foo)) #| --> (test2 test) |#
2:41:32
krwq
thanks pjb! I thought there was something inside cl but assoc didn't work for me - this looks good though :) thank you!
2:46:29
Timzi
when I'm using the (time form) macro to get a runtime of something, how do I capture that info? Describe says it's printed out to *TRACE-OUTPUT*, how do I get to that?
2:49:00
pierpa
(let ((*trace-output* (make-string-output-stream))) (time (+ 1 1)) (get-output-stream-string *trace-output*))