freenode/#lisp - IRC Chatlog
Search
5:45:46
Shinmera
seok: "all it does" is pretty dismissive of the amount of work involved in actually doing so.
7:23:23
scymtym
this SBCL commit https://github.com/sbcl/sbcl/commit/ab976f48db4ba8d72fb7bc13388bc4fc6e97c0fd will break named-readtable here https://github.com/melisgl/named-readtables/blob/master/src/cruft.lisp#L166
7:52:21
pve
Good morning! Is there a tutorial somewhere on how to define new asdf component types (specifically modules)? Something a bit more detailed than what's in the manual..
7:56:52
pve
I'm going to have a directory containing some source files and a custom loader that knows how to compile and load them. So now I'd like to tell asdf about the custom loader.
8:01:19
easye
pve: unfortunately there is no good tutorial to extending ASDF that I know of: I learned about ASDF from copying what others had done, and studying the ASDF source code.
8:02:24
easye
<https://gitlab.common-lisp.net/abcl/abcl/-/blob/master/contrib/abcl-asdf/abcl-asdf.lisp> extends ASDF to understand :mvn components, and might be interesting.
8:03:03
easye
There is an extension for ASDF for dealing with Parenscript artifacts somewhere that might be a conceptually a little more in line what you want to do.
8:06:39
easye
A reasonable strategy to search for examples would be to examine Quicklisp systems that end in "-asdf" as these are usually ASDF extensions.
8:16:19
nicktick
how to define a function (compose f g) which could be used as (funcall (compose #'char-upcase #'code-char) 100) ?
8:17:56
Harag
finally got sbcl and woo to work on "google cloud run" using buildapp to get around the HOME switching (/root to /home) that the "google cloud run" is doing on CMD command
8:21:59
McParen
if I define a function A, then define an alias B using (setf (fdefinition 'B) #'A), I get warnings when trying to use that new alias immediately when defining the next function.
8:22:54
McParen
yes, they are in the same file. i figured out that i have to use an eval-when, but i dont really understand why
8:22:58
nicktick
why don't use (defun compose (f g x) (funcall f (funcall g x))) and (funcall #'compose #'char-upcase #'code-char 100) ? the result is the same as (defun compose (f g) (lambda (x) (funcall f (funcall g x)))) and (funcall (compose #'char-upcase #'code-char) 100).
8:23:11
beach
McParen: Top-level forms in a file are executed when the file is loaded, but you get the warning when the call is compiled.
8:23:15
no-defun-allowed
Try (eval-when (:compile-toplevel :load-toplevel :execute) (setf (fdefinition 'b) #'a))?
8:23:28
no-defun-allowed
nicktick: Because the former doesn't really perform composition, but the latter does.
8:24:01
McParen
no-defun-allowed: i have already figured that out, but dont really understand why. are the defun and setf not evaluated at the same time?
8:24:48
no-defun-allowed
I think the compiler gets function binding information at compile time, and the SETF isn't done at compile time; but I'm not very well versed on those.
8:25:26
beach
McParen: What no-defun-allowed said. You get the warning when the file is compiled, and then the DEFUN and the SETF have not been executed yet.
8:27:14
beach
If this is SBCL, at compile time, it checks whether the function being referred to exists, and if not, gives a warning. But the standard says that the definitions do not happen until the compiled code is loaded. And that includes other top-level forms like (SETF ...).
8:28:50
beach
Now, for the first top-level DEFUN, the SBCL compiler makes a note that it WILL EXIST at load time and doesn't emit any warning. But the (SETF (FDEFINITION ....)) does not result in such a note being made.
8:30:17
McParen
thanks, that makes sense, the function using the alias had no runtime errors, it was a compile time warning by sbcl.
8:31:37
beach
McParen: I suggest you read the Common Lisp HyperSpec page on DEFUN. It can be instructive.
8:32:20
no-defun-allowed
nicktick: Now, if I was to rearrange that, we get our definition of COMPOSE: f o g = λx . f(g(x))
8:32:29
nicktick
I can write function (compose f g x) == f(g(x)),but it's not (compose f g)(x) == f(g(x)) , so I should use a lambda function to define (compose f g)(x). is it right ?
8:32:48
beach
McParen: "In particular, DEFUN does not make the function definition available at compile time."
8:33:27
no-defun-allowed
Yes, you need to return a function of one argument that calls g with the argument, then f with the value of that.
8:33:49
beach
nicktick: You don't want the ultimate argument to be part of the composition. You want the composition to work for any argument.
8:35:22
no-defun-allowed
The Alexandria implementation allows for an arbitrary number of arguments, and an arbitrary number of functions to be composed, but in the case of one argument and two functions to compose, it is basically the definition I gave.