<Guest74>
i think you get the gist from this https://pastebin.com/K1YwNwS5 , randomize, kintern, and time-nogc should be self explanatory.
s-liao has joined #commonlisp
kevingal has quit [Remote host closed the connection]
s-liao has quit [Quit: Ping timeout (120 seconds)]
s-liao has joined #commonlisp
<White_Flame>
yeah, a rule of thumb that I've heard is that 10-15 elements is where hash tables become faster
<White_Flame>
it all of course depends on your implementation, as well as how expensive the hash function is
<moon-child>
I tested a modified version of guest74's code, in which hash tables were faster for just one element
<White_Flame>
hmm, no how expensive the full key comparison function is
<Guest74>
yeah i really wasn't expecting this since I've had trouble with hash tables being really slow in the past. Not for accessing something but orders of magnitude slower than redoing a colour blend instead of storing it.
<White_Flame>
moon-child: if you only have 1 element, then the last value cache will immediately hit and it doesn't have to do any testing at all
* moon-child
nods
<White_Flame>
EQL is also going to be a bit slower than EQ, and since you're comparing for the same symbol object, EQ is fine
<Guest74>
yeah i stuck in the collects and storing of result so that stuff wouldn't get optimized away.
<moon-child>
well, hmm, now changing some stuff it is slower
<Guest74>
I think sbcl default is eql. i wonder how much different eq is.
<White_Flame>
you have a timing test ready to try ;)
<Guest74>
already adding it :)
<White_Flame>
EQ is like one instruction. EQL, if the EQ test fails, then goes into checking & branching on the type of the value
<Guest74>
about 75% of eql
<White_Flame>
so why EQL=>EQUAL=>EQUALP does get progressively slower, EQ (if immediately compiled) can be substantially faster in searches like these
<White_Flame>
*while
<Guest74>
actually, seems rather variable.
<White_Flame>
and that progressively slower generally is just if it does more testing on the given data type. I don't think more than EQUAL/EQUALP should be any slower than EQL itself if it's an EQL-comparable value
<moon-child>
http://ix.io/3Prf/lisp (test 10) the array consistently outperforms the hash table for me
<moon-child>
switching to eql closes the gap
<moon-child>
(sbcl)
<moon-child>
(speed 3) seems to make a big difference
<White_Flame>
yep. the hashing function is called ones, but the key test function is called all the time
<moon-child>
safety 0 improves performance a bit, but do you really want safety 0?
<White_Flame>
you'd have to recompile SBCL's hashtable implementation to really gain that advantage, I'd think
<AeroNotix>
(safety -1)
<Guest74>
huh, i get faster array with the-cost-of-nothing as well
<moon-child>
the-cost-of-nothing isn't the differentiator, it's speed 3
<Guest74>
It'd be so much easier to do some automated testing of where the limit is if any of these times returned an actual time instead of just printing information.
<Guest74>
On mine, taking out any declarations array is slower even with 10 elements.
<White_Flame>
check the docs
<moon-child>
use benchmark instead of bench
<Guest74>
thanks, that's good to know for the future.
<White_Flame>
Guest74: array bounds checking is a big part of declaration-based speed
* moon-child
wonders if sbcl eq does simd
<moon-child>
err
<moon-child>
sbcl position
<Guest74>
I've noticed that in my graphics code. Though not sure anybody would appreciate that in a library.
<moon-child>
probably not. That would get you more speedup
<White_Flame>
I seriously doubt it. Plus, M-. makes it easy to look :-P
<White_Flame>
(hmm, maybe not with the various complation layers that can affect it)
dre has joined #commonlisp
dre has quit [Client Quit]
<gjvc>
breggsit
<gjvc>
misfire
<Guest74>
well at least on my machine, 13 elements is where hashtable outdoes array with speed3. so array will probably not help me with my 780 element array :)
<mon_aaraj>
it seems i am already having issues with death/dbus - this error `; Debugger entered on #<SIMPLE-ERROR "No server addresses left to try to open." {100533EF33}>` always springs up when I am trying out their https://github.com/death/dbus/blob/master/examples/notify.lisp example to run in the sly repl, which i assume is an attempt to send a notification via dbus?
<Guest74>
though I'm guess doing aref on that array will still be faster to get the keyword from an integer than using a hashtable.
<mon_aaraj>
for the record, just using the `notify-send` binary works pretty well, so i don't think it is an issue with my system
<Guest74>
sorry mon_arraj: I've never actually used death's because of the libfixposix requirement. I just wrote my own.
<mon_aaraj>
ah, i see, that sounds interesting to do
<mon_aaraj>
it was quite simple for me to install libfixposix, so that's not a big barrier for me
random-nick has quit [Ping timeout: 256 seconds]
<Guest74>
it's probably just the way my brain works, but I find the easiest way to understand a protocol is to implement it.
<mon_aaraj>
it might as well be, haha
bae has joined #commonlisp
<bae>
Can Emacs Lisp be thught of as a subset of CL?
<moon-child>
you can think of anything any way you like
<_death>
mon_aaraj: you could try using dbus:system-server-addresses instead of dbus:session-server-addresses
<mon_aaraj>
ah, i see, thank you very much!
<Guest74>
bae: no. something about scope I think.
<mon_aaraj>
huh, it seems to output a new error: `Method error: "The name org.freedesktop.Notifications was not provided by any .service files".`, i assume it isn't detecting any notification daemon or something?
<moon-child>
elisp has lexical scope now
<bae>
Guest74 moon-child: I'm working through a Common Lisp book right now using Elisp. So far no problems.
<Guest74>
meh, what do I know, I don't elisp.
<_death>
mon_aaraj: right, probably need to start a notification daemon
<bae>
Guest74 You should...Emacs is the Shizzle, my Nizzle.
<Guest74>
meh, too busy replacing it with cl.
<mon_aaraj>
well, the thing is.. one does exist already, it's how i've been making sure notify-send works, it was just me guessing what the error meant
<mon_aaraj>
i use one called wired-notify
<mon_aaraj>
should i try with something else?
<bae>
Guest74: No you're not, LOL
bae has left #commonlisp [ERC (IRC client for Emacs 27.1)]
<_death>
mon_aaraj: well, you could try to send the same message to the same address.. the error you got is from the dbus server
<mon_aaraj>
huh, i see, i am not quite sure how i'd do that
morganw has quit [Remote host closed the connection]
<mon_aaraj>
oh, interesting... so i might need to do more than just launch the daemon for the notification service, ill see what i can do. thank you so very much for your help!
rgherdt has quit [Ping timeout: 256 seconds]
lisp123 has quit [Ping timeout: 256 seconds]
<_death>
currently I also get that error btw.. because I use (an old version of) stumpwm without any notification daemon.. back when I wrote that example I used gnome and didn't need to do anything iirc
<Guest74>
do new versions have a notification system?
<_death>
executing notify-send doesn't do anything in my case
<_death>
(and returns 0)
<_death>
Guest74: maybe.. I remember seeing some code that uses my dbus library to set up a notification daemon.. could've been some personal fork
<mon_aaraj>
well i did add the file, made it point to the wired executable. then checked that dbus detects the file and does what its supposed to do, which it does. but the code snippet still seemingly doesn't work - so i think ill have to first reboot to see if it magically fixes anything (hopefully, haha), but it should work after a reboot if the archwiki is correct
<_death>
mon_aaraj: you can try to compile notify-send and do some printf debugging
karlosz has quit [Quit: karlosz]
karlosz has joined #commonlisp
<mon_aaraj>
noted! ill be hoping a reboot just fixes it though
karlosz has quit [Remote host closed the connection]
karlosz has joined #commonlisp
<Guest74>
looks like there's a contrib for it that sets up a notification server. might have to take a closer look at it.
mon_aaraj has quit [Read error: Connection reset by peer]
mon_aaraj has joined #commonlisp
s-liao has joined #commonlisp
Bike has joined #commonlisp
<mon_aaraj>
well. my hopes were incorrect
<mon_aaraj>
i mean, even firefox works how it it supposed to with notifications, i cant really fathom why it doesn't work with the library
<_death>
looking at notify-send source code, it seems to use the session bus..
jeosol has quit [Quit: Client closed]
<mon_aaraj>
not even using dunst works.. hm.
<_death>
if you don't have a DBUS_SESSION_BUS_ADDRESS environment variable, dbus spec says you can "try to read the address from the X Window System root window property _DBUS_SESSION_BUS_ADDRESS." .. so "xprop -display $DISPLAY -root" might show it
<_death>
but my library just checks the environment
<mon_aaraj>
i indeed do not have the environment variable, nor do i use Xorg
<mon_aaraj>
how would i set it?
notzmv has quit [Ping timeout: 250 seconds]
<_death>
well, that depends on your system.. maybe you can check logs to see the address
<Guest74>
i think it defaults to /run/user/1000(if first user)/bus
<_death>
here the environment variable is set to "unix:path=/run/user/1000/bus"
<mon_aaraj>
well, in /run/user/1000, only dbus-1 exists as a folder, and when i set it to that it still doesn't want to work, though there's /run/dbus which has system_bus_socket but im not sure that's what i am looking for
<_death>
it should be a unix domain socket "file"
<mon_aaraj>
yeah, it looks like a socket, after setting the environment variable to that folder, there seems to be no difference
<_death>
maybe you have a file in ~/.dbus/session-bus/ with the details
<_death>
well, at least accept a PR.. it's under the X windows section, though, so maybe won't work for you. I don't remember this stuff being in the spec when I wrote most of the code.. but that's probably because it was written in 2010
<_death>
well, does that address work?
<mon_aaraj>
huh.. nothing, its just the same error, despite that .service file existing in the directory as per the page you showed, and the environment variables all being set from that file
<mon_aaraj>
wait, it works with the old code after setting all of them up, not system-server-addresses
<mon_aaraj>
thank you so much for your help! and i am really sorry for taking so much of your time haha
<mon_aaraj>
so i guess i needed to always export what's in ~/.dbus/?
<_death>
at last :) .. I guess, not up to date with dbus practices
karlosz has quit [Ping timeout: 240 seconds]
mon_aaraj has quit [Ping timeout: 272 seconds]
mon_aaraj has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
rgherdt_ has quit [Ping timeout: 272 seconds]
mon_aaraj has joined #commonlisp
mon_aaraj has quit [Ping timeout: 272 seconds]
mon_aaraj has joined #commonlisp
tyson2 has joined #commonlisp
lisp123 has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
mon_aaraj has joined #commonlisp
s-liao has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
mon_aaraj has quit [Ping timeout: 256 seconds]
mon_aaraj has joined #commonlisp
waleee has quit [Ping timeout: 245 seconds]
<dbotton>
I received a bug report recently with compile errors on windows using portacle of "error in FORMAT: Unknown directive (character: Return)" I use portacle often and never saw. Has anyone seen such an error before?
<beach>
Good morning everyone!
AeroNotix has quit [Quit: WeeChat 3.4]
<mfiano>
dbotton: I think I have seen this when using the #\Newline directive on SBCL/Windows, which it is broken for, or something along those lines.
<mfiano>
Probably has to do with line endings, or setting up git to use the correct ones.
<dbotton>
Thanks
<mfiano>
I don't know much else, as I do not use Windows, other than I've seen it reported to some projects before.
<White_Flame>
presumably this is a tilde at the end of the line to concatenate the rest of the string?
<dbotton>
Yes
<dbotton>
Advice?
<White_Flame>
so yeah, literal crlf when it's looking for a lf
<mfiano>
I think there's a gitconfig setting to pull code correctly or something
<White_Flame>
well, "correct" for this case would presumably be unix line endings
<mfiano>
|3b| told me about it a while ago as he's a Windows user. Maybe he knows more.
<mfiano>
Right
<dbotton>
Thanks!
* mfiano
imagines all the bytes on the Internet wasted by Windows line endings
lambdart has quit [Remote host closed the connection]
<White_Flame>
including http and all sorts of other non-windows textual protocols
<dbotton>
It was once worse.
<dbotton>
Windows the only offender now. Mac also had alternative scheme.
<White_Flame>
yeah, but mac was its own little bubble
<White_Flame>
mac-specific formats & protocols didn't have much spread
<White_Flame>
(at least not when compared to http and the like)
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 272 seconds]
semz_ has joined #commonlisp
semz has quit [Ping timeout: 260 seconds]
mon_aaraj has quit [Ping timeout: 256 seconds]
mon_aaraj has joined #commonlisp
semz_ is now known as semz
notzmv has joined #commonlisp
masinter has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
mon_aaraj has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
Bike has quit [Quit: and now, sleep]
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
<|3b|>
will configure a specific git repo to convert crlf to lf on commit, and not change it on checkout (i think)
<|3b|>
git config --global core.autocrlf input to make that the default for you
treflip has joined #commonlisp
<|3b|>
you can also set it to false for no automatic conversion at all. see also core.eol, core.safecrlf configs and the text gitattributes
s-liao has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
mon_aaraj has joined #commonlisp
Alfr has joined #commonlisp
lisp123 has joined #commonlisp
<CodeBitCookie[m]>
Hello Everyone!
<jackdaniel>
hey
lisp123 has quit [Ping timeout: 272 seconds]
pillton has joined #commonlisp
mon_aaraj has quit [Ping timeout: 272 seconds]
mon_aaraj has joined #commonlisp
cage has joined #commonlisp
wacki has joined #commonlisp
OlCe has quit [Remote host closed the connection]
karlosz has quit [Quit: karlosz]
pillton has quit [Quit: ERC (IRC client for Emacs 27.2)]
hineios has quit [Ping timeout: 240 seconds]
s-liao has quit [Quit: Client closed]
s-liao has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
hineios has joined #commonlisp
Inline has quit [Quit: Leaving]
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
pve has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
Dynom has joined #commonlisp
Inline has joined #commonlisp
<phoe>
hey
random-nick has joined #commonlisp
s-liao has quit [Quit: Client closed]
mon_aaraj has quit [Ping timeout: 272 seconds]
mon_aaraj has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
mon_aaraj has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
<dbotton>
|3b|: thanks!
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
aeth has quit [Ping timeout: 256 seconds]
aeth has joined #commonlisp
gxt has quit [Quit: WeeChat 3.4]
gxt has joined #commonlisp
Bike has joined #commonlisp
tyson2 has joined #commonlisp
s-liao has joined #commonlisp
cross has quit [Quit: leaving]
cross has joined #commonlisp
pve has joined #commonlisp
mon_aaraj has quit [Ping timeout: 272 seconds]
yewscion has joined #commonlisp
mon_aaraj has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
_73 has left #commonlisp [ERC (IRC client for Emacs 27.2)]
Rue has joined #commonlisp
s-liao has quit [Quit: Client closed]
hafat has joined #commonlisp
psf has quit [Ping timeout: 256 seconds]
psf has joined #commonlisp
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
tyson2 has quit [Remote host closed the connection]
hafat has quit [Quit: Leaving]
mon_aaraj has quit [Ping timeout: 250 seconds]
mon_aaraj has joined #commonlisp
_death has left #commonlisp [ERC (IRC client for Emacs 28.0.50)]
_death has joined #commonlisp
singsong has joined #commonlisp
singsong is now known as yagami
yagami is now known as yagami^
yagami^ has left #commonlisp [#commonlisp]
yagamisato has joined #commonlisp
tyson2 has joined #commonlisp
<yagamisato>
hello everyone
treflip has quit [Quit: ERC (IRC client for Emacs 27.2)]
treflip has joined #commonlisp
yagamisato has quit [Quit: leaving]
Rue has quit [Quit: WeeChat 3.4]
Rue has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
shka has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
lisp123 has joined #commonlisp
mon_aaraj has quit [Ping timeout: 272 seconds]
Bike has quit [Quit: Connection closed]
mon_aaraj has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 272 seconds]
<beach>
Sometimes it looks like ASDF was made to purposely defeat my attempts at using it for SICL.
<lisp123>
Which part?
<beach>
I wouldn't know.
<lisp123>
I see
<beach>
I tried to call MAKE-PLAN to just get a list of source files in dependency order.
<beach>
But it defeated me because it takes into account whether those files are already loaded.
<lisp123>
Interesting
Bike has joined #commonlisp
<beach>
So then I tried doing what MAKE-PLAN does which is (MAKE-INSTANCE 'SEQUENTIAL-PLAN :FORCING ???)
<beach>
and I tries T for ??? but that is wrong too.
<beach>
I am betting I will eventually need some feature that is not part of the API.
<lisp123>
What would happen if two source files depend on each other?
<beach>
The plan would take that into account and give me the files in dependency order.
<lisp123>
Which one would occur first?
silasfox has joined #commonlisp
<beach>
The last one to be processed it looks like.
<lisp123>
Got it
mon_aaraj has quit [Ping timeout: 272 seconds]
mon_aaraj has joined #commonlisp
<etimmons>
lisp123: If you mean something like ((:file "a" :depends-on ("b")) (:file "b" :depends-on ("a"))), ASDF should signal a circular dependency error
<lisp123>
etimmons: Cheers
<beach>
I give up.
<beach>
I just want a simple list of all the source files in dependency order, no matter whether the system has already been loaded.
<beach>
How hard can it be?
<lisp123>
i had some code lying around before that calculated the dependencies based on 1 package 1 file
<lisp123>
I guess something similar could be done based on each file vs. each package using Eclector
<beach>
I thought (asdf/forcing:make-forcing :force t) would do it, but no.
amb007 has quit [Ping timeout: 272 seconds]
<|3b|>
beach: i think you want :all there instead of T
amb007 has joined #commonlisp
<beach>
Oh, let me try that.
<|3b|>
though when i tried it, it made asdf thing the thing i planned wasn't loaded anymore, so probably not completely right
<|3b|>
*made asdf think the thing
<beach>
Worked! Thank you very much!
<beach>
That won't be a problem for me.
<beach>
I will experiment with that tomorrow. Now it is time to go fix dinner for my (admittedly small) family.
aartaka has joined #commonlisp
<lisp123>
dbotton: Does CLOG text editor have the notion of buffers and buffer manipulation (i.e. access to POINTS and MARKS etc)
<|3b|>
beach: actually, maybe (asdf/plan:required-components system :other-systems t) is what you want?
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
mon_aaraj has quit [Ping timeout: 250 seconds]
mon_aaraj has joined #commonlisp
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
<|3b|>
maybe (mappend (curry #'asdf:input-files 'asdf:compile-op) (asdf/plan:required-components 'system :other-systems t)) to go directly to pathnames if all the systems compile/load the desired files normally
Lord_of_Life has joined #commonlisp
Lord_of_Life has quit [Read error: Connection reset by peer]
Lord_of_Life has joined #commonlisp
lisp123 has quit [Quit: Leaving...]
Lord_of_Life has quit [Read error: Connection reset by peer]
cosimone has joined #commonlisp
silasfox has quit [Ping timeout: 240 seconds]
Lord_of_Life has joined #commonlisp
Lord_of_Life has quit [Read error: Connection reset by peer]
<dbotton>
lisp123 the one in the demo of a lisp editor does. It is using the ace editor https://ace.c9.io/
<dbotton>
From playing around with SWANK it would be trivial to add most features to a CLOG app and use that is the editing buffer.
mon_aaraj has quit [Ping timeout: 272 seconds]
mon_aaraj has joined #commonlisp
yewscion has quit [Ping timeout: 272 seconds]
mon_aaraj has quit [Ping timeout: 272 seconds]
waleee has joined #commonlisp
mon_aaraj has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.4]
<Guest74>
for those who understand c is 1<<8 just (ash 1 8)?
<Guest74>
I've probably asked that before, but I can't remember this c crap.
<_death>
yes
<Guest74>
thanks
<Guest74>
and is OR IOR?
<_death>
| is logior
<Guest74>
ok, thanks again.
<Guest74>
I really need to automate this ioctl conversion stuff so I don't have deal with this again.
treflip has quit [Quit: good night]
Lord_of_Life has joined #commonlisp
Lord_of_Life has quit [Read error: Connection reset by peer]
Lord_of_Life has joined #commonlisp
Lord_of_Life has quit [Read error: Connection reset by peer]
Lord_of_Life has quit [Read error: Connection reset by peer]
<Guest74>
nice! Thanks a lot.
Lord_of_Life has joined #commonlisp
Lord_of_Life has quit [Read error: Connection reset by peer]
<Guest74>
that's an interesting project.
pingpongball has quit [Client Quit]
Lord_of_Life has joined #commonlisp
Lord_of_Life has quit [Read error: Connection reset by peer]
Lord_of_Life has joined #commonlisp
Lord_of_Life has quit [Read error: Connection reset by peer]
morganw has joined #commonlisp
Lord_of_Life has joined #commonlisp
Lord_of_Life has quit [Read error: Connection reset by peer]
mon_aaraj has quit [Ping timeout: 256 seconds]
mon_aaraj has joined #commonlisp
aeth has quit [Ping timeout: 256 seconds]
aeth has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
mon_aaraj has joined #commonlisp
Lord_of_Life has joined #commonlisp
Bike has quit [Quit: Connection closed]
Lord_of_Life has quit [Read error: Connection reset by peer]
AeroNotix has joined #commonlisp
Lord_of_Life has joined #commonlisp
Lord_of_Life has quit [Read error: Connection reset by peer]
Lord_of_Life has joined #commonlisp
parjanya has joined #commonlisp
Lord_of_Life has quit [Read error: Connection reset by peer]
Lord_of_Life has joined #commonlisp
Lord_of_Life has quit [Read error: Connection reset by peer]
jeosol has joined #commonlisp
<parjanya>
why the slot 'text doesn’t get set here? https://plaster.tymoon.eu/view/2943 if it has to do with the :after method, I thought the slots were set before it
<Xach>
parjanya: :after goes before the lambda list, not after it.
<Xach>
what you have now is a pointless evaluation of a keyword as the first form of the method
<parjanya>
Xach: d'oh, thanks
<_death>
and the method is primary, and doesn't call-next-method, so the next method is suppressed
<Xach>
also, better to use defpackage. your file won't compile as is.
<parjanya>
ah, that was just me trying a quick minimal example
attila_lendvai has joined #commonlisp
perrierjouet has joined #commonlisp
<|3b|>
equivalent defpackage forms is a few characters shorter anyway, if you are being quick :) (and no longer even if you use #: to avoid interning extra symbols)
* |3b|
doesn't think SXHASH makes any guarantees of uniqueness, if that is important for your IDs
<parjanya>
huahua, oh well, the problem was the cognitive burden of doing this right for once :-$
Guest74 has quit [Quit: Connection closed]
Lord_of_Life has joined #commonlisp
theBlackDragon has quit [Ping timeout: 256 seconds]
theBlackDragon has joined #commonlisp
Lord_of_Life has quit [Read error: Connection reset by peer]
parjanya has quit [Ping timeout: 250 seconds]
Bike has joined #commonlisp
aeth has quit [Ping timeout: 256 seconds]
aeth has joined #commonlisp
masinter has joined #commonlisp
Lord_of_Life has joined #commonlisp
spm has joined #commonlisp
Rue has quit [Quit: WeeChat 3.4]
<theothornhill>
I'm struggling with stumpwm installation on debian. I'm getting a "does not know how to require sb-cltl2" message, which from a cursory glance at google means I need to set SBCL_HOME to /usr/lib/sbcl. Doesn't seem to work though. Anyone knows how to compile itfrom source and make it load on a fairly new debian?
<spm>
Hi all. Probably a very silly question about symbol creation and equality. I've created a hash-table and would like lookups to be able to use uninterned symbols (:foo) as the keys into hash-map. I have a string value I'm trying to turn into the symbol. I've tried to (make-symbol "FOO") and (intern "FOO") but no matter what I've tried I can't seem to get the symbol that ends up as the key to match with a directly used key on the
<spm>
lookup. If I iterate over the keys of the hash, I *can* retrieve the values. I think the crux of my problem is that (eql (make-symbol "FOO") :FOO) => NIL. I'm sure that makes perfect sense if you understand symbols properly, but it's clear I don't.
<_death>
:foo is a symbol that's interned in the "KEYWORD" package
<Xach>
spm: :FOO is not an uninterned symbol, it's a keyword symbol.
<Xach>
#:FOO is the syntax for apparently uninterned symbols
<Xach>
INTERN is one way to go from a string a symbol - you don't normally need to involve your own table.
<Xach>
MAKE-SYMBOL returns a new object every time. it won't be eq or eql to an existing key in a table.
<spm>
Thank you _death and Xach. I think the light went on a bit here. I'm still stuck in the thinking that I need to lookup my function from a set of functions, but that's not true. I can simply NAME the functions what I was going to use as the lookup and then no-longer need a layer of indirection. Thanks so much.
* spm
feels very silly now
<Xach>
glad to help. i have a lot of practice with symbols and packages so feel free to ask if you are confused about something.
mrcom has quit [Read error: Connection reset by peer]
aeth has quit [Quit: Reconnecting]
aeth has joined #commonlisp
cjb has joined #commonlisp
<White_Flame>
theothornhill: compile SBCL from source you mean?
<White_Flame>
my notes are `sh. make.sh --prefix=~/sbcl --fancy --xc-host=~/sbcl/bin/sbcl` then `sh install.sh`
<White_Flame>
the xc-host is an existing lisp to use to compile sbcl, it can be apt installed, like CLISP or whatever
Krystof has quit [Ping timeout: 250 seconds]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<White_Flame>
of course, I have ~/sbcl/bin in my $PATH, you might want to omit a prefix and just use the default
<White_Flame>
I did to avoid colliding with any apt installed sbcl
<White_Flame>
s/did/used my own prefix/
yewscion has joined #commonlisp
<theothornhill>
White_Flame: Thanks! I tried doing something similar, but I couldn't get it to work. Removing sbcl and stumpwm and installing from apt seems to be the only answer, at least for preserving my sanity... It's a shame is such an old version though.
<White_Flame>
yeah, wipe all trace of SBCL first, and use CLISP as the xc-host
<White_Flame>
that ensures no weird leakage
<White_Flame>
you really don't want to use old SBCL versions with quicklisp and any FFI sort of utilities that might reach into internals, even something like SLIME
rgherdt_ has joined #commonlisp
<theothornhill>
Yeah. My guess is that's what happens. I might just go back to a different linux though, where things are simpler :)
rgherdt_ has quit [Read error: Connection reset by peer]
yewscion has quit [Ping timeout: 256 seconds]
rgherdt_ has joined #commonlisp
cosimone has quit [Read error: Connection reset by peer]
cosimone has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
shka has quit [Ping timeout: 272 seconds]
<dbotton>
is there a way to add a method to a specific already created object not to its class? I know that may violate some terms used by CL but not sure how to express it elsewise
<dbotton>
I am looking to add an :after method to detect changes to a slot to be specific
<Xach>
dbotton: I don't think there's a conventional way. one approach that springs to mind is to have an :after method that checks for the target object(s) before acting.
phantomics has joined #commonlisp
<dbotton>
can there be multiple :after methods?
<etimmons>
You can add an :after method that's eql specialized on the object. No idea how performant that'd be if you add a lot of them, though.
<Xach>
Yes - I was mistaken and was overlooking eql methods for this use-case.
<dbotton>
interesting, what does that look like code wise?
hhdave has quit [Quit: hhdave]
<Xach>
I was thinking about in the context of a source file, where you would be less likely to have an actual object in an eql specializer.
<Xach>
"object" as in standard instance, not in the generic sense.
<dbotton>
so baz is an instance of bar?
<etimmons>
In that example bar is meaningless (just the name of the variable in the method body). baz is an instance of whatever class you want
<Xach>
dbotton: not necessarily. the syntax binds BAR, which must be EQL to whatever BAZ evaluates to when the method is defined.
pve has quit [Quit: leaving]
Dynom has quit [Quit: WeeChat 3.4]
attila_lendvai has quit [Ping timeout: 250 seconds]
cosimone has quit [Read error: Connection reset by peer]
cosimone has joined #commonlisp
parjanya has joined #commonlisp
aartaka has quit [Ping timeout: 272 seconds]
<dbotton>
creating a defgeneric for an accessor is done as a setf?
<jcowan>
wait, why can't spm look up his functions in a table of functions?
<jcowan>
((foo . #'foo) (bar . #'bar) ...)
<Xach>
dbotton: not really - an accessor would be two pieces, (defgeneric foo (object) ...) and (defgeneric (setf foo) (new-value object) ...), sort of.
<Xach>
slot option ":accessor foo" defines both methods for you
<Xach>
you can split the naming up by specifying :reader and :writer separately
<dbotton>
ok, so I will have to add my :after on the the setf method if trying to capture a value change to the slot
<dbotton>
unless slot-value has some sort of under the covers hook
<Xach>
here's a MOP function slot-value-using-class, but i don't know much about it.
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
wacki has quit [Quit: Leaving.]
aartaka has joined #commonlisp
gaqwas has joined #commonlisp
aartaka has quit [Ping timeout: 250 seconds]
gaqwas has quit [Quit: Leaving]
aartaka has joined #commonlisp
<Bike>
usually the interface you export is accessor functions rather than slot names, so just putting your hooks on the accessors is ok
alvaro121 has joined #commonlisp
alvaro121_ has quit [Ping timeout: 256 seconds]
kurth4cker has joined #commonlisp
rgherdt_ has quit [Read error: Connection reset by peer]
rgherdt_ has joined #commonlisp
<dbotton>
I can live with that
<dbotton>
was looking for easy ways out
edgar-rft has quit [Read error: Connection reset by peer]
edgar-rft has joined #commonlisp
kurth4cker has quit [Quit: ERC (IRC client for Emacs 27.2)]
rgherdt_ has quit [Ping timeout: 272 seconds]
tyson2 has joined #commonlisp
mrcom has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
mepy_ is now known as mepy
occ has quit [Ping timeout: 272 seconds]
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
<saturn2>
spm: it sounds like what you originally wanted was simply a hash table with strings as keys rather than symbols
<saturn2>
interning symbols at run time is usually not a good idea