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.
18:37:40
jasom
Xach: am I misinterpreting systems.txt or does QL think that cl-unicode/build depends on the system cl-unicode? That seems wrong to me...
18:38:49
Xach
mfiano: i think a possible option there is to have a separate, infrequently-changing data project that the code depends-on
18:39:43
jasom
Xach: that makes sense; I'm re-running ql2nix completely ignoring the deps in quicklisp for now.
18:39:44
Xach
jasom: in the dist build process, slashed systems are replaced with their depends on or base name or both - don't recall at the moment.
18:44:03
jasom
ACTION also needs to clean-up how he detects missing systems and libraries. A little help on the lisp side of things would make my code much more compact...
18:47:39
hjudt
381M old total, 141M new total. while not much in raw numbers, it's quite some saving. anyways, why waste space?
18:48:10
jasom
ACTION is a digital packrat so his motto is "why delete something you might need later?"
18:49:16
jasom
I honestly agree that wastefulness is bad too, I just can't motivate myself to do anything about something less than 10GB
18:50:43
mfiano
When you scale horizontally and have dozens of servers around the world, sacrificing disk in place of needed resources for a task that takes a small disk footprint, like a website, is a smart choice.
19:03:46
hjudt
it's not the disk space i usually have to worry about, but rather it can complicate things in some cases, e.g. software not behaving as expected because the wrong files are read, people not daring to delete files because they don't know about the consequences, increasing backup time,...
21:31:15
ebrasca
phoe: Do you know how to make ssl certificate for hunchentoot with letsencrypt? ( https://letsencrypt.org )
21:38:58
shrdlu68
In that case you need to shut hunchentoot down so that certbot can take the port, 80 or 443.
21:46:56
shrdlu68
They use some protocol that verified that you really own the domain name you're trying to make the certificate for, which is why certbot needs to either take up port 80 temporarily or give you some files to place in the webroot with any server.
22:08:14
jasom
can't you also give certbot a directory to put a file in, and have hunchentoot serve it up?
22:11:56
shrdlu68
As far as I know, there's only the option of certbot giving you files to place in the web root.
23:45:53
jasom
ebrasca, shrdlu68: and then setup hunchentoot to serve up files in /foo/bar/baz/.well-known/ as the path /.well-known/
0:11:21
iqubic
Like let's say I have a lambda that I want to execute. Why would I use funcall over apply, or vice versa?
0:13:04
iqubic
Why wouldn't you know the number of args? Can you use appy with a function that has an &ress parameter?
0:13:33
pjb
of course. Or you can write a macro that has to call a function, but it doesn't know the number of arguments.