Search
Monday, 26th of June 2017, 13:59:26 UTC
0:19:40
Bike
ok i have no idea how cmpliteral works now.
0:20:26
Bike
my fix didn't work. i tried reversing the order of run-all calls, and it went from a segfault to a null pointer reference
0:20:32
Bike
i don't know how that's even possible
0:23:24
drmeister
What? You told me how to write it!
0:28:05
drmeister
Could you paste that minimal example?
0:30:12
Bike
file with (defun foo () (cons 'special-variable (load-time-value #.(find-class 'special-variable))))
0:34:31
drmeister
Is that what you meant? 'special-variable' isn't a class so the find-class fails.
0:34:46
Bike
er, no, sorry, you have to define a special variable class. empty is fine.
0:34:55
Bike
(defclass special-variable () ())
0:35:08
drmeister
https://www.irccloud.com/pastebin/NhjOXb7l/
0:35:25
Bike
No, it can't be in the file
0:35:31
drmeister
No - I have to do it outside of the file - right
0:37:27
Bike
so the run-all should include like (setf [special-variable] (intern "SPECIAL-VARIABLE" "CL-USER")), then (setf [ltv] (find-class [special-variable]))
0:37:45
stassats
(load-time-value #.(find-class 'special-variable)) sounds a bit superfluous
0:38:58
drmeister
stassats: We have a problem cropping up because of how I chop up the RUN-ALL function to keep it short enough for LLVM to compile it quickly.
0:39:02
stassats
but do consider (load-time-value (find-class 'foo)) and (setf (find-class 'foo) nil) (defclass foo () ())
0:40:29
Bike
you... might have a point there
0:40:44
Bike
(but this should definitely not cause a segfault)
0:41:38
Bike
that does mean i can edit my thing so that it will probably not break, though
0:43:24
drmeister
Hmm, it works fine in cclasp - were you aware of that?
0:43:39
Bike
i don't think it worked fine for me
0:44:12
drmeister
It crashes in bclasp with "NULL pointer error"
0:44:18
drmeister
It crashes in bclasp with "NULL pointer error"
1:50:12
Bike
urgh. if i want to do it right i have to look up the class at runtime for every call
1:50:31
Bike
sbcl does it by updating ctors every time you (setf (find-class ...) ...) but i don't have that hook
1:50:43
drmeister
Is that even if/when I fix run-all?
1:51:06
drmeister
Or do you want a hook?
1:51:18
drmeister
Do you want a hook?
1:51:26
Bike
i was really hoping to do this without a hook, but i guess it could help in clasp
1:51:36
Bike
and by "a hook" i pretty much just mean putting something in (setf find-class)
1:51:42
drmeister
There is an old saying "The end justifies the means".
1:52:35
drmeister
https://github.com/drmeister/clasp/blob/dev/src/core/lisp.cc#L1800
1:53:18
drmeister
https://github.com/drmeister/clasp/blob/dev/src/core/lisp.cc#L1766
1:58:11
Bike
i'll try it without such tricks first and see how it goes
Tuesday, 27th of June 2017, 1:59:26 UTC