libera/#commonlisp - IRC Chatlog
Search
9:00:09
pve
Good morning! Is it reasonable to provide default initargs to make-instance that may be "overridden", like in this situation, where I want to inherit properties from a parent object:
9:01:56
pve
an alternative would be to set the properties using accessors, but I can't really tell which is preferable
9:14:03
prxq
ah so only the values provided as initargs in the spawn-foo function should overwrite. Then yeah I guess you can do it this way.
9:15:57
pranavats
Also, initforms are different from default-initargs. initforms are default values for slots, default-initargs are default values for initargs. The latter is assigned before initforms.
9:21:13
pranavats
This article explains the differences between the two: https://courses.cs.northwestern.edu/325/readings/clos.php
13:50:35
bitblit1
Hello everyone! Is there a cross platform way to get command line arguments (any libraries) or is it better I just manually do #+clisp ext:args or whatever
14:45:21
bitblit1
I have seen many programs in common lisp which don't update in real time. Whereas programs like McCLIM and CEPL update as you recompile your code. Is there any reason for this. I don't understand how you make code update on the fly in common lisp.
14:57:04
pjb
bitblit1: you need to structure your program to be able to update on the fly. This is automatic for notinline functions, but for the other functions, you need to ensure that the main loop is replaced by the new version, so that new code is taken into account.
14:57:45
pjb
bitblit1: that said, the main loop doesn't need to change often, so just having it refer notinline functions (eg. functions compiled in a different compilation-unit), would be enough in most cases.
18:49:43
bitblit1
Are global variables dicouraged in comparison to passing something like XDisplay to everrrrry function?
18:50:25
bitblit1
Thinking about it common lisp symbols and packages mostly solve the issues with global vars no?
18:57:37
random-nick
and sometimes a keyword argument is used with a default value looking up a special variable
18:58:19
random-nick
that's kind of similar to how streams can be passed to standard functions via arguments or via special variables
18:59:55
random-nick
if you don't like special variables and don't like passing everything via arguments, you can try somehow hiding passing via arguments using macros, but that can be tricky and hard to read to everyone unfamiliar with your technique