freenode/#lisp - IRC Chatlog
Search
12:54:05
drmeister
What is the relationship between specializers and classes? There is a specializer class and class classes.
13:03:01
drmeister
Huh is right. Adding slots to specializer slides all of the class slots indices up.
13:41:05
drmeister
I do have it in two places - it's in C++ and it's in Common Lisp. There is a sanity check that causes the build to fail if the information gets out of sync.
14:06:18
beach
If you can make a sanity check, why can't you automatically generate one of the instances?
14:09:47
beach
A significant fraction of my time is spent coming up with techniques to avoid having a particular piece of information in more than one place.
14:11:44
beach
No, I think the opposite would be a maintenance nightmare, especially for people coming after me.
14:19:23
beach
I meant: No, I think having a particular piece of information in more than once place would be a maintenance nightmare, especially for people coming after me.
14:20:38
scymtym
ACTION thinks beach is talking about duplication in source code while ralt is talking about duplication at runtime (hence "caching")
14:21:21
beach
scymtym: You are definitely right that I am talking about duplication in source code.
14:24:43
Shinmera
In a way code duplication is like caching-- you also have the problem of knowing when to expire.
14:45:56
drmeister
It's better to specify the slots in the Common Lisp CLOS code - of course - but the C++ code needs to run loooong before the Common Lisp bootstraps up to CLOS and it needs to know where the slots are.
14:46:18
drmeister
To avoid circularity/bootstrapping problems it's easier to just bake it into the C++ code.
14:50:08
beach
But you are planning to use SBCL to bootstrap Clasp. Then you can extract that information from the Common Lisp code and generate the C++ code.
14:50:56
drmeister
The indices of standard-class slots and the number of standard-class, and structure-class slots and the layout of a couple of types are the only places where I had to do this. They all have sanity checks.
14:53:11
drmeister
We may have to do this... (1) Run the Clasp interpreter to generate a configuration file (2) Run SBCL to compile the Clasp Common Lisp code to an intermediate representation (long lists of generic function calls) (3) Run the Clasp interpreter to load and interpret the intermediate representation to llvm bitcode.
14:57:59
drmeister
We still haven't decided if we are going to use sbcl to bootstrap Clasp. There are nasty issues with environments that I'm not sure we have solutions to yet.
14:58:39
drmeister
We can save a discussion about that at a later time - Bike is more up on the details. I've had my head in fastgf for weeks.
15:16:25
beach
Though I don't think I have much to contribute. I am just asking questions that come to mind.
15:42:44
green_
ok, I have a newbie lisp package question... see here: https://paste.fedoraproject.org/paste/2nnzraEoqHCH2EdElS1~-w
15:43:54
beach
green_: When the reader sees your DEFPACKAGE form, it creates a symbol named MYFUNC in the COMMON-LISP-USER package.
15:44:43
mfiano
green_: the WHY package is using all of the symbols from CL-USER, then you are adding all of those symbols to CL-USER.
15:45:51
beach
green_: To avoid this problem, the typical solution is to use a "symbol designator" that is not a symbol in your DEFPACKAGE form.
15:47:08
beach
green_: You can also use (:export "MYFUNC"), but that looks ugly because the string needs to be upper case, whereas your function name is written in lower case.
15:50:29
beach
green_: Just use explicit package prefixes when you are in the COMMON-LISP-USER package, like why:myfunc.
15:51:56
rpg
the former is mildly preferable, in case there's any chance your code will be run in a case-sensitive lisp session
15:52:36
green_
but when I call why:myfunc I get "The symbol "MYFUNC" is not external to the WHY package".
15:52:39
beach
green_: The package system can be confusing to newbies because it is not a module system. A package does not contain function definitions. Only symbols. So as soon as a symbol is read, it is created in some package.
16:06:55
minion
jollygood2, memo from pjb: dang! I was find -ing to find the reference, but I was ssh-logged into another computer! Here it is: http://metamodular.com/reverse-order.pdf
16:08:30
jollygood2
an unrelated question. is it ok to use 'function in most cases over #'function (when passing a function to a function)?
16:10:33
_death
it's ok when you expect the function in the symbol's function slot to be used and the receiver takes a function designator
16:11:38
|3b|
'function will let called function notice changes to FUNCTION if it stores it for a while before using it, #'function is required if you want to pass a local function
16:11:41
_death
the time when the actual function is looked up and whether it's looked up more than once is then determined by the callee
16:12:25
Shinmera
I mean, function calling goes through either funcall or apply and both take a function designator, so by extension everything else should too.
16:13:20
dlowe
For instance, if you store a #'function in a variable, it will not update if you redefine it
16:13:36
jollygood2
|3b| so if I got it right in f('g), assuming f stores the passed argument and that g is updated after the call, updated 'g will be called, while in f(#'g) case definition at the time of this call will always be called?
16:14:13
_death
Shinmera: sometimes you declare things to be functions, or force a function designator to be a function.. usually for performance reasons.. sometimes you treat symbols differently from functions so you don't expect to receive a function designator..
16:15:26
dlowe
jollygood2: it's not a question of which you like more, you can want the other behavior too in some situations
16:16:09
|3b|
if F contains a function name (as you would get from 'function), (funcall f) will always call the global function named by that name at that point in time. if F contains an actual function object (as returned by #'function), (funcall f) will always call that exact function object, even if the function has been redefined since
16:16:13
jollygood2
dlowe sure it is. I can't think of a situation where I'd want old definition to be called, the way i work
16:16:44
|3b|
ACTION isn't sure if that is more clear or not, but seems like you got the idea from other explanations anyway :)
16:18:37
|3b|
most useful thing i can thing of that you can do with a function name but not a function object is generating the name of a corresponding setf function, but still not something you would do too often (and no guarantee SETF uses a SETF function for that name even then)
16:19:10
jollygood2
a bit surprising then that, from what I've seen, that #'function is prefered, when one of the purported benefits of CL is live programming, defining and redefining functions as you go
16:20:45
|3b|
don't even usually have to recompile, just run the thing containing the #' again, since it gets the value when #"foo is evaluated
16:21:22
_death
jollygood2: local functions, anonymous functions, performance... basically passing a symbol is just a useful hack added to lisp at some point.. not meant to serve as the general use
16:23:36
_death
3b: I think I read at some point someone from the CL committee (maybe GLS) and he used the word "hack" to describe it, so I follow ;)
16:25:11
dlowe
oh, yeah. Calling a function can be faster (but not necessarily) than a function symbol
16:38:31
beach
jollygood2: (flet ((less (x y) ...)) (sort list #'less)) works, but (flet ((less (x y) ...)) (sort list 'less)) does not.
17:51:05
mfiano
What is the proper way to ignore unknown initargs unknown to the given class with make-instance? I see &allow-other-keys in the signature, but I'm not sure how to make use of it.
17:59:24
mfiano
This works on SBCL, without a method added: (defclass foo () ((x :initarg :x))) (make-instance 'foo :x 1 :y 2 :allow-other-keys t)
18:02:30
jasom
cl-unicode is the biggest blocker to packages in ql2nix now; both from direct dependencies and via cl-interpol which depends on it
18:35:46
hjudt
i noticed that as time and updates pass, more and more versions of installed libraries pile up in the quicklisp directory. is there a command to clean old versions, keeping only the newest one?
18:37:03
Xach
it is not called automatically, yet, because i was concerned about deleting too much. it will be automatic in the future.