freenode/#lisp - IRC Chatlog
Search
3:17:49
joinr
Is it expected behavior that using varargs within a recursive labels form will cause an infinite loop?
3:18:03
joinr
(defun f (&rest args) (LABELS ((aux (X &REST XS) (PROGN (IF (not (null xs)) (PROGN (PPRINT X) (aux (FIRST XS) (rest XS))))))) (apply #'aux args)))
3:19:24
joinr
expectation is that the null condition will be met eventually and computation stops. Instead, you get Nil printing out
3:21:21
joinr
this is a small reproducible case for a larger metprogramming deal. I thought labels would work fine (and it does) seemingly as long as you don't go into &rest arg territory and try to apply.
3:23:32
no-defun-allowed
I'm not sure if you intend for this to happen, but (f 0) will print nothing.
3:24:28
joinr
the non-terminating phenomena was what got me. totally forgot I'd have to apply on recurse.
3:34:24
lottaquestions
Hi all, is there a way of listing all the global variables in a running instance in slime?
3:38:21
Bike
technically there could also be variables named by inaccessible symbols, but that doesn't happen much
3:39:41
no-defun-allowed
(do-symbols (s) (when (and (boundp s) (eql (symbol-package s) package)) (print s))) will print all the symbols that are bound in the current package, which isn't all of them, but might be what you want.
6:24:07
beach
jackdaniel: Thanks for the link to Graham's article. He seems to put his finger on something important.
7:07:25
boeg
second day with sick kid at home, keeping me up all night. Think I'm gonna see if I can optimize on my advent of code adventure from yesterday
8:54:34
ralt
did anyone write some ECL funsies to write emacs modules in CL? http://diobla.info/blog-archive/modules-tut.html
9:45:25
boeg
if I have a hash table `hash-t` and two variables `key-a` and `key-b` bound to `(cons 1 0)` and I do `setf (gethash key-a hash-t) 1)` why can't I do `(gethash key-b hash-t)` to access the value stored at `key-a`? My guess is that the key where I stored the `1` is a reference to the `key-a` variable, and so even though `key-b` contains a similar looking cons, it's not the same, so it doesn't work, but how do I make it work?
9:49:19
boeg
right, maybe I should check again, because I blindly tried telling gethash to use equal with `:test #'equal` but it didn't work and I just ... yeah, take a look at the documentation again :)
10:30:14
boeg
It throws you around in corners you wouldn't have thought of yourself. I have been reading practical common lisp and land of lisp a bit, but there's nothing like real experience, even though advent of code is taking me soo much longer compared to if I was doing it in a language I know better