libera/#commonlisp - IRC Chatlog
Search
19:21:10
White_Flame
kenran: the typical way to interact/develop CL programs is through emacs & the SLIME interface
19:21:30
White_Flame
you can build CL binaries that have the server to that, and connect into it via emacs and open up a remote REPL into it
19:26:36
pjb
kenran: actually, the "create binary part" is usually called "saving a lisp image" or "saving an executable lisp image".
19:27:44
pjb
kenran: by default when you do that, you'll get a lisp image that when rebooted drops back in the REPL (only with all that was loaded before saving already loaded after booting it). You have to give specific options to the function saving the lisp image to install your own "toplevel function" replacing the REPL.
19:28:22
pjb
kenran: see some example: https://gitlab.com/informatimago/hw generate.lisp generate-hw.lisp
19:29:26
pjb
kenran: ecl is different, it doesn't have lisp images, instead it saves an ELF binary. But you get mostly the same result.
20:06:37
kenran
pjb: ah, I think I might have done the save-lisp-and-die thing once in the past to create an executable with sbcl
21:02:50
nij-
How do I get the name of the function? E.g. something like (function-name #'+) => "+" ?
21:06:26
Alfr
nij-, that usually isn't a valid function name, as those are either symbols or (setf some-symbol).
21:17:24
NotThatRPG
I'm having the oddest problem. I have a function that computes four values, the last of which is a closure. I print out that closure and then return it in a values construct in the next line. But when I trace the function, it displays as only returning THREE values. Any idea what could account for this? It's driving me bonkers.
21:24:47
pjb
Actually, we may consider that the name of the function (lambda () 42) #| --> #<Anonymous Function #x302005F3C76F> |# be (lambda () 42) it self! Since (function <my-function-name>) -> the function named my-function-name, and (function (lambda () 42)) -> the anonymous function in question.
21:25:56
pjb
nij-: (defun foo () 42) (setf (fdefinition 'bar) (fdefinition 'foo)) (defun foo () 33) (function-names (function foo)) #| --> (foo) |# (function-names (function bar)) #| --> (bar) |# (values (foo) (bar)) #| --> 33 ; 42 |#
21:26:31
pjb
(defun foo () 42) (setf (fdefinition 'bar) (fdefinition 'foo)) (values (function-names (function foo)) (function-names (function bar))) #| --> (bar foo) ; (bar foo) |#
21:33:54
pjb
nij-: naming is always relative to some authority, to some registry. An object can be given several names. So if you want to name your functions perhaps you should manage your own registry. https://termbin.com/6fmc
21:36:24
pjb
NotThatRPG: there's an infinite number of programs that behave as you describe !!! Why don't you paste the code immediately when you want debugging help?
21:36:36
White_Flame
NotThatRPG: how high are your optimization settings? maybe some things might become opaque to the tracer?
21:40:59
NotThatRPG
Will do. BTW, this couldn't be a valid compiler optimization: I'm trying to catch the fourth return value and use it, and it errors out right after return.