freenode/#lisp - IRC Chatlog
Search
9:51:40
Godel[m]
I just noticed, upon putting defuns inside `(eval-when (:compile-toplevel :load-toplevel :execute) ... )`, CCL doesn't compile those functions, and I get `Undefined Function` errors. SBCL works fine.
9:53:56
Godel[m]
(I mean, I get the errors from the toplevel (sly) not when I call them inside the file.)
9:55:48
beach
Godel[m]: The standard allows for the compilation environment to be different from the startup environment.
9:56:30
beach
So it is possible that CCL defines the function in the compilation environment and then discards that environment once the compilation is done.
9:58:12
beach
Because compiling a file should not have any side effects on the run-time environment.
9:59:34
Godel[m]
I have an asdf package, I compile it and switch to the package, should I expect the symbols in it to be loaded after compilation of all the files?
10:00:41
beach
OK, let's try some correct terminology. I take it you have an ASDF *system* (not a package), right?
10:02:44
beach
When the compiled files in the system are loaded, you will see all the side effects of all the top-level forms in the files.
10:03:41
beach
So the effect should be very closed to the effect you get if you LOAD all the source files.
10:08:49
beach
Any symbol without a package marker, or with an explicit package marker in any of the files will typically exist.
10:13:40
beach
Not sure about names of lexical variables in a system where the packages are created only in the compilation environment.
10:18:32
beach
Names of lexical variables that are not otherwise needed in the compiled code (like, say, for debugging purposes) are not necessarily present after the system has been loaded.
10:20:00
beach
Example: Put this in a file: (defun ff (xxx) (1+ xxx)) or something like that. Start SLIME. Type (proclaim '(optimize (debug 0) (speed 3))) and then (compile-file <name-of-lisp-file>).
10:20:30
beach
This is SBCL I am trying now, so now, restart your Common Lisp system by typing ,restart or something like that.
10:22:40
beach
However, since SBCL does not distinguish between the compilation environment and the startup environment, if you stay inside your running SBCL system, compiling the file will create the symbol XXX, simply because the file is being read by READ.
10:47:32
Godel[m]
Actually, that's not what happens for me in case of sbcl 1.5.4. I compiled a file (test.lisp) with a factorial function, and load it with `--load test.fasl`, then when I evaluate `(find-symbol "FACT"), FACT is returned, an internal symbol. Contents of the test file: https://bin.disroot.org/?6b6ddb183282a081#L4vdMR3Q+IgLCcikl6+2uZpBq1g5xtkIzaF0q8Dtk8k=
10:55:16
ck_
but your discussion was about arguments to the function, not the function name ?! I'm confused. Of course the function symbol will be part of the fasl
11:02:33
Godel[m]
yes, I started a different session in the terminal with 'ros run --load test.fasl`.
11:21:08
ck_
hmm, you are right, that's what my sbcl does as well. I have not used slime for this either -- maybe there are some different settings in that environment?
11:25:58
ck_
or -- the ever-present forces of darkness have prevented you from removing superfluous symbols at this time
11:28:21
Godel[m]
Okay, that aside, how do I tell CCL to load the symbols in the startup environment?
11:29:58
no-defun-allowed
DEFPACKAGE will create the symbols when it creates the package too (to my knowledge).
11:48:31
Godel[m]
Well, I'm stupid. My init file for quicklisp had a form dependent on sb-ext which prevented it from loading anything other than the forms before that non-conforming form with CCL. Would have been easier if roswell's sbcl just used `.sbclrc` instead of roswell forcing the same init file on all implementations.
15:47:15
jmercouris
unfortunately, whenever I start Lispworks (personal edition) I have to manually enter in that stuff to start slime
15:57:13
jmercouris
Lycurgus: I'm not sure what you are saying, I have this .lispworks file where I am trying to launch Swank server with Lispworks, but it doesn't start it
15:59:34
jmercouris
I have SBCL as well, I'm looking to create a cross-platform user interface for a non-profit product, CAPI is the best
15:59:45
Lycurgus
but at least they don't try to take a cut of everything you make or charge for the run time
16:01:46
Lycurgus
if the resource usage is modest you can use their (LWs) version, work around the crippling
19:18:11
Josh_2
Although I thought there was a way with closer-mop (i think) that you can actually list the slots in a class
19:32:20
shka_
define generic function that will return list of slot names when called with the class name
19:35:56
Josh_2
I have my version of (with-accessors ..) and I defparamed a var which contains the the accessor names as symbols
19:47:15
shka_
if anyone is interested, that's how i do it https://github.com/sirherrbatka/cl-data-structures/blob/0e5df4640ade420305f2535453848a2bd67a5545/src/utils/macros.lisp#L318
19:50:11
saturn2
i don't see the problem with eval-always-ing your class definition if you want to use it at compile time
19:51:59
shka_
it wanted to call it lol (let over let) but in reality it is usually over lambda so it is let over let over lambda
20:03:52
ck_
A higher amount than usual of lisp on hacker news at the moment. Have I missed some anniversary?
20:05:02
aeth
ck_: I think people are just seeing what's getting karma and reposting old things for karma
20:06:23
aeth
Repost this one, "Beautiful Online SICP" (762 points in 2017): https://news.ycombinator.com/item?id=13918465
20:08:44
aeth
Mezzano was posted 19 days ago so that is probably too soon. Some others here could think of something, I'm sure, though.
20:09:31
aeth
borodust: You could try doing a Show HN of trivial-gamekit since HN's hivemind is filling its front page with Lisp articles right now. i.e. https://borodust.org/projects/trivial-gamekit/
20:31:09
Josh_2
hmm, so I can't use (setf (funcall accessor instance) "abc") :( Is there a way I can get around this?
20:42:31
aeth
borodust: ck_ is right, the front page is currently full of Lisp stuff for some reason. https://news.ycombinator.com/news
20:51:31
_death
it will only work if there's a function called (setf accessor) and the two last arguments transposed, assuming "abc" is the new value
20:51:35
dialectic
However you're passing accessor in, pass this instead: (cons #'accessor #'(setf accessor))
20:58:42
Josh_2
Okay that worked, but my logic was broken anyways. Thanks _death I'll fix when I get back
21:09:19
_death
Josh_2: in this case it may be enough just to read a list of initargs and (apply #'make-instance 'data-entry initargs)
21:16:05
dialectic
#| stuff |# is also used for (nestable) comments, so careful with that too if you're making a dispatch character.
21:19:51
MichaelRaskin
Well, borderline: they use that it looks || in code and ignore the fact that it has empty name
21:21:33
stacksmith
Yeah... It's kind of hard to enter it any other way than ||, so as much as I want to object to it, I can't find a good reason... I suppose (find-symbol "") to get '|| may be a little confusing.