freenode/#lisp - IRC Chatlog
Search
13:24:16
pierpal
anyway I recommend you this book https://www.amazon.it/dp/B004IASVJK it's highly educational, as are the other books by the same author.
14:52:47
HighMemoryDaemon
What's a good site for pasting my Lisp code to share a link? Hastebin, my go-to, seems to be down.
15:34:50
kilimanjaro
what's the idiomatic way to get just the first value from a call which returns multiple values
15:35:27
kilimanjaro
e.g. i have a function which ends with (gethash foo frob), but i don't want the user to see the second value
15:52:58
kenster
Streaming some lisp programming: https://youtu.be/ZYdsxGa78q4 or https://www.twitch.tv/kingherring
17:41:41
emaczen
How do you tell hunchentoot to serve an image with define-easy-handler? To serve HTML the body is just an HTML string, and so I am confused about how you would serve an image?
17:53:07
Demosthenex
ok, wait. in CL (cdr nil) is nil instead of throwing an error? maybe it's my time spent in scheme, but i thought that'd throw an error
17:55:17
Demosthenex
i always wrap assoc calls in (or (assoc :key alist) '(nil . nil)) so that i can safely cdr a default value when no key exists
17:58:57
Demosthenex
anyway, yeah, i'm enjoying common lisp. working with my son and trying to show him assoc lists.... but i guess we don't need that or for association lists ;]
18:00:31
Demosthenex
just amused that i was trying to show him a "TADAAAA" moment where it'd throw an error when we searched for a bad key, and.... instead it just returned nil. of course i was surprised l;]
18:02:24
pjb
Demosthenex: but since nil is both false, empty list, and no value, this is there reason why you can write (or (cdr (assoc key a-list)) "Hello")
18:03:12
pjb
Which doesn't prevent you to distinguish those cases (assoc key a-list) is true if it's present as `(,key . nil)
18:04:57
Demosthenex
just checking whether an exit is blocked in a room. he's chosen to keep his map data in a 2d array of alists
19:20:00
Bike
if you explain your problem in more detail, it's possible someone could come up with another solution.
19:21:13
kenster
the first argument is the class and the second the params you want to pass into make-instance
19:22:21
kenster
:content-file (make-instance 'hosted-content-file :id (b32c:b32c-decode content-id) :file-name filename))
19:22:53
Bike
Could you paste an example with-foreign-class form? If it's very long, on a pastebin site, please.
19:26:57
Bike
(defmacro with-foreign-class ((class-name &rest params) instance &body body) `(let ((,instance nil)) (unwind-protect-foreign-class ,instance (setf ,instance (make-instance ,class-name ,@params))) ,@body))) might be what you want?