freenode/#lisp - IRC Chatlog
Search
11:49:30
ukari
i found that it seems common to add (in-package :cl-user), is thete any benefit to it?
11:56:32
theemacsshibe[m]
meh: if I were selling a product I'd say non-destructive. Users don't really mind how you allocate data in their software. If I were describing processes in Lisp, reversible hopefully will confuse people less.
11:56:49
theemacsshibe[m]
nconc is destructive, append is not destructive. Neither is very reversible.
12:11:48
jdz
There's whole branch of since about "reversible computing", so I'd bet it has quite a specific meaning: https://en.wikipedia.org/wiki/Reversible_computing
16:24:21
Bike
it's not a matter of offense, it's just that we can't offer as good help as the emacs people
16:32:41
cgay
Funny that this timeline of Lisps is on the Lisp Machine Lisp page, not something more general... https://en.wikipedia.org/wiki/Lisp_Machine_Lisp I started with Zetalisp.
17:06:37
ukari
is it possible to pull a macrolet variable to outside? sth like this, (funcall (lambda () (macrolet ((fn (&body body) `(lambda () ,@body))) fn)))
17:09:36
phoe
in the base case, you can define an anonymous function that accepts two arguments, WHOLE and ENV, and funcall this on your forms, then eval that code.
17:09:38
Bike
that doesn't answer my question. you can use an anonymous function. you can funcall or apply it. an anonymous macro does not have a similar use.
17:11:12
Bike
Eval arguments when? how are you using this? What is example code? You can use an anonymous function like (funcall (lambda (x) x) 4) => 4.
17:12:46
Bike
macrolets disappear after compile time. they don't leave behind macros as values or anything.
17:39:20
flip214
the even bigger problem is that the compiler will already have computed all the _inputs_ as _values_, so splicing a macro in and expecting the source forms to be available is even harder.
18:32:22
foojin
What is the purpose of lambda as a symbol? I know that lambda as a macro inserts a (function ...) around an inner lambda, but is the inner one a mere symbol that doesn't "do" anything unless handed to "function"?
18:39:33
cgay
foojin, you seem to have some specific code in mind. Paste it somewhere so we can see?
18:40:36
MichaelRaskin
edgar-rft: I think they mean that CLHS has «Symbol LAMBDA» separately from «Macro LAMBDA»
18:40:45
Petit_Dejeuner
I guess it wouldn't work for ((lambda (a b c) (list a b c)) 1 2 3) code though
18:41:22
foojin
cgay: Actually I don't. I just want to understand if there's something like "function" which handles 'lambda in a special way.
18:42:23
foojin
That is, is 'LAMBDA something more that just a syntax convention for invoking FUNCTION?
18:42:54
Bike
(function (lambda ...)) means a function, yes. That's what the "Symbol LAMBDA" entry in the CLHS is about.
18:43:39
phoe
foojin: there's no function that handles "symbol LAMBDA" differently. It's the evaluator that handles it differently.
18:43:52
phoe
The CAR of each function call may be either a symbol that names a function, or a LAMBDA form.
18:44:16
phoe
If the evaluator wants to evaluate a list that looks like (foo ...) then it calls the function FOO.
18:44:34
phoe
If the evaluator wants to evaluate a list that looks like ((lambda (...) ...) ...) then it calls the anonymous function denoted by the lambda form.
18:46:23
Bike
the CAR of a cons being evaluated is not evaluated normally. That's why it can only be a symbol or a lambda expression.
18:47:28
foojin
Bike: So when it sees a form like this, it skips expansion for the (LAMBDA ...) and handles it directly?
18:52:41
Bike
(<symbol> ...) is valid. ((lambda ...) ...) is valid. everything else is invalid, so there's no need to macroexpand the car
18:54:15
foojin
I see. So, except for that and lambda-as-a-macro case, LAMBDA doesn't have any other special meaning, right?
18:55:15
phoe
it has two special uses: as a standard macro, and as a symbol naming an anonymous function in forms that are evaluated
19:00:10
phoe
edgar-rft: all symbols can be used as variable names, except 1) constants cannot be shadowed, 2) things get weird with symbols naming special variables and symbol macros
19:01:58
specbot
Constraints on the COMMON-LISP Package for Conforming Programs: http://www.lispworks.com/reference/HyperSpec/Body/11_abab.htm
19:07:35
phoe
"Some Exceptions to Constraints to Abridged Collection of Rules about the COMMON-LISP Package for Conforming Portable Programs Adhering to the Definition of the Standard for Safe Code"
19:10:11
p_l
(defun |Some Exceptions to Constraints to Abridged Collection of Rules about the COMMON-LISP Package for Conforming Portable Programs Adhering to the Definition of the Standard for Safe Code| () 'dafuq )
19:10:49
edgar-rft
SOME-EXCEPTIONS-TO-CONSTRAINTS-TO-ABRIDGED-COLLECTION-OF-RULES-ABOUT-THE-COMMON-LISP-PACKAGE-FOR-CONFORMING-PORTABLE-PROGRAMS-ADHERING-TO-THE-DEFINITION-OF-THE-STANDARD-FOR-SAFE-CODE
19:11:22
phoe
edgar-rft: quick, get this on quicklisp before Xach notices that it makes completely no sense
19:19:48
ealfonso
I wonder if it's very hard to get into a running lisp to change a value. or to force execution of a save-lisp-and-die, change something, and restart
19:21:34
ealfonso
phoe I have a long-running service where I would like to change something that isn't configurable except by changing a variable's value
19:22:14
ealfonso
phoe probably a silly question and not too important. but I know using gdb it is possible to attach to a running process and change things around
19:23:03
MichaelRaskin
Or just run the service inside a normal SBCL instance inside screen/tmux, connect and issue the (setf …)
19:24:01
ealfonso
MichaelRaskin can I use SLIME to connect to something that doesn't expose a swank server? how do I 'connect' to issue the (setf ...)?
19:24:26
phoe
you usually want these on long-running services anyway in order to introspect and debug the image
19:25:19
MichaelRaskin
But in any case, it is reasonable to have _some_ way to interact with the servuce
19:25:59
ealfonso
MichaelRaskin yeah. I was curious if it could be done without a swank server, I have root access to the system where the process is running
19:27:08
phoe
ealfonso: theoretically you could open up a tmux session, make it run SBCL, run your service from it, and still have access to stdio
19:27:55
ealfonso
phoe actually the process is compiled to an executable using buildapp, so it's not an interactive repl
19:29:19
phoe
ealfonso: in this case, make it use swank and add a start-server call as a part of its execution hooks.
19:30:10
ealfonso
phoe yeah, I can do this if I'm willing to kill the currently running process. which I am
19:31:21
ealfonso
I guess I could also attach to the process using gdb. but I would probably have no idea what to do
20:12:56
zxcvz
ERROR: invalid number of arguments: 2. Anyone know how to tell SBCL to tell me where the error actually is?
20:18:25
Xach
zxcvz: that will land you in the debugger, which starts out with "0]". :backtrace will show the backtrace.
20:20:45
Xach
zxcvz: oh. i haven't used Sublime, so I'm not sure what it might be doing, but if you are using the sbcl repl directly it will enter the debugger on error. I'm not sure how to get help with what sublime is doing, sorry.
20:21:01
Xach
with emacs and slime, "v" will jump from the frame to the error location. it is handy.
20:23:11
ealfonso
zxcvz maybe something is trapping your error? are you using a framework or library?
20:25:52
zxcvz
Xach: Running a program. Apparently I've made some change some where. A bit irritating with just an error message without the debugger.
20:39:22
aeth
In, practice, though, if you use enough libraries you're only going to get it to run on SBCL, CCL, and maybe ECL. At least, the libraries I've happened to use.
20:43:08
Xof
well, all CL implementations that I've found to play with today have the opposite behaviour for (:method-combination foo x) than I sort-of want
20:44:18
Xof
(probably very little: see previous discussions about no-one using long-form method combination)
20:48:52
Xof
I am imagining code a bit like (let ((shared (cons nil nil))) (defgeneric foo (x) (:method-combination weird shared) (:method foo (x) (car shared))) (defgeneric bar (x) (:method-combination weird shared) (:method bar (x) (cdr shared))))
20:49:54
Xof
but I know that it's not possible if you don't evaluate method combination args, whereas you can get the current de-facto standard behaviour by quoting everything
20:52:48
Xof
I don't know. This is probably not the hill I should be trying to climb, let alone making my last stand on
20:54:24
Bike
i did the same thing a while back trying to figure out if the options returned by make-method-lambda are evaluated