<jason_m>
Is there a way to see the expanded result of a symbol-macrolet form? For example, if I evaluate: (macroexpand '(with-slots (x y z) (obj) (setf z (+ x y)))), I see a symbol-macrolet form in the output (using sbcl). Is there a way to further expand the result? I am interested because I want to write some macros of my own that make use of symbol-macrolet.
<pjb>
jason_m: macroexpand doesn't work recursively.
<pjb>
You can use slime-macroexpand-all
<pjb>
or do it manually.
<jason_m>
pjb: I thought that was the difference between macroexpand and macroexpand-1?
<pjb>
Nope. Both only work on the toplevel operator.
<pjb>
-1 once, macroexpand until it cannot expand.
<pjb>
Then you need to code walk. If the result of macroexpand is a special-operator, apply the rules. If it's a function, applies on the arguments recursively.
slyrus_ has joined #lisp
<pjb>
Anyways, symbol-macrolet is a special operator, so it probably won't macroexpand.
<pjb>
(it could be implemented as a macro, but probably not).
<jason_m>
pjb: Yeah, I tried plugging the symbol-macrolet form directly into macroexpand, and it did not further expand so you are probably right about the implementation.
slyrus__ has quit [Ping timeout: 240 seconds]
pmai has quit [Read error: No route to host]
<jason_m>
I better understand the difference between macroexpand and macroexpand-1 now. I was misinterpreting "repeatedly" to mean "recursively".
lucasb has quit [Quit: Connection closed for inactivity]
<pjb>
jason_m: I like to implement those operators myself to understand them. It's not hard in general. Remember, lisp was invented on a 32KW computer system…
<edgar-rft>
... and 32 kiloWatt is a lot of power :-)
<pjb>
Kilo Words.
<pjb>
kilo watt is kW, not KW.
malm has quit [Ping timeout: 240 seconds]
zotan has quit [Ping timeout: 240 seconds]
Bourne has quit [Ping timeout: 240 seconds]
malm has joined #lisp
gigetoo has quit [Ping timeout: 240 seconds]
jdz has quit [Ping timeout: 240 seconds]
ym has quit [Ping timeout: 240 seconds]
xantoz has quit [Ping timeout: 240 seconds]
Tordek has quit [Ping timeout: 240 seconds]
davsebamse has quit [Ping timeout: 240 seconds]
ineiros has quit [Ping timeout: 240 seconds]
gigetoo has joined #lisp
zotan has joined #lisp
jdz has joined #lisp
davsebamse has joined #lisp
ineiros has joined #lisp
ym has joined #lisp
Tordek has joined #lisp
<edgar-rft>
pjb: k = kilo, K = Kelvin, KW are KelvinWords!
<pjb>
edgar-rft: units cannot be used as prefix, so there's no ambiguity.
<edgar-rft>
William Thomson Kelvin was a human speaking words.
shifty has joined #lisp
elfmacs has quit [Ping timeout: 276 seconds]
ebrasca has quit [Remote host closed the connection]
elfmacs has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
slyrus__ has joined #lisp
enrio has joined #lisp
<oni-on-ion>
PoundCake
slyrus_ has quit [Ping timeout: 276 seconds]
megalography has left #lisp [#lisp]
useful_illusion has joined #lisp
<moon-child>
oni-on-ion: is that an order?
jackdaniel has joined #lisp
Blukunfando has quit []
<oni-on-ion>
=P
jackdaniel has quit [Read error: Connection reset by peer]
<oni-on-ion>
KiloByte. being silly at pjb
cosimone has quit [Quit: Quit.]
Necktwi has quit [Ping timeout: 276 seconds]
<useful_illusion>
h=Hello all :)
<equwal>
Good morning beach!
<useful_illusion>
Good morning (assume u r in UK/Europe.. or,,)
Bike has quit [Quit: Lost terminal]
<equwal>
No, I just always use Good morning to avoid confusion.
jason_m has quit [Ping timeout: 265 seconds]
malfort has joined #lisp
<useful_illusion>
Ahh, probably a good idea! Thanks.
blt has joined #lisp
libertyprime has joined #lisp
akoana has left #lisp ["Leaving"]
davepdotorg has joined #lisp
rotucer has quit [Ping timeout: 265 seconds]
rotucer has joined #lisp
davepdotorg has quit [Ping timeout: 268 seconds]
clothespin has joined #lisp
oni-on-ion has quit [Ping timeout: 245 seconds]
oni_on_ion has joined #lisp
clothespin has quit [Ping timeout: 250 seconds]
torbo has quit [Remote host closed the connection]
clothespin has joined #lisp
adolby has quit [Remote host closed the connection]
adolby has joined #lisp
rotucer has quit [Read error: Connection reset by peer]
rotucer has joined #lisp
adolby has quit [Remote host closed the connection]
adolby has joined #lisp
useful_illusion has quit [Remote host closed the connection]
davepdotorg has joined #lisp
shifty has quit [Read error: Connection reset by peer]
shifty has joined #lisp
davepdotorg has quit [Ping timeout: 252 seconds]
enrioog has joined #lisp
ArthurStrong has quit [Quit: leaving]
enrio has quit [Ping timeout: 265 seconds]
enrioog is now known as enrio
brown121408 has quit [Ping timeout: 246 seconds]
brown121407 has joined #lisp
oni_on_ion is now known as oni-on-ion
jfb4 has joined #lisp
jfb4_ has quit [Ping timeout: 268 seconds]
sjl has quit [Ping timeout: 240 seconds]
sjl has joined #lisp
jackdaniel has joined #lisp
keep_learning has joined #lisp
jackdaniel has quit [Read error: Connection reset by peer]
keep_learning has quit [Client Quit]
jackdaniel has joined #lisp
sauvin has quit [Ping timeout: 250 seconds]
jackdaniel has quit [Read error: Connection reset by peer]
varjag has joined #lisp
keep_learning has joined #lisp
keep_learning has quit [Client Quit]
Necktwi has joined #lisp
zooey_ has joined #lisp
zooey has quit [Ping timeout: 260 seconds]
sauvin has joined #lisp
varjag has quit [Ping timeout: 250 seconds]
lottaquestions_ has quit [Ping timeout: 246 seconds]
lottaquestions has quit [Ping timeout: 260 seconds]
Kaisyu7 has joined #lisp
enrio has quit [Ping timeout: 268 seconds]
shka_ has joined #lisp
amerlyq has quit [Quit: amerlyq]
JohnMS_WORK has joined #lisp
aeth has quit [Ping timeout: 240 seconds]
aeth has joined #lisp
flamebeard has joined #lisp
<beach>
Good morning everyone!
dddddd has joined #lisp
buffergn0me has quit [Ping timeout: 250 seconds]
<edgar-rft>
Mom said "follow your dreams" so I went back to bed.
jfb4_ has joined #lisp
shka_ has quit [Ping timeout: 246 seconds]
gxt has quit [Ping timeout: 260 seconds]
jfb4 has quit [Ping timeout: 276 seconds]
scymtym has quit [Ping timeout: 245 seconds]
rgherdt has joined #lisp
libertyprime has quit [Ping timeout: 268 seconds]
rgherdt has quit [Remote host closed the connection]
snapekang has joined #lisp
CrazyEddy has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
karlosz has joined #lisp
edgar-rft has quit [Quit: Leaving]
jprajzne has joined #lisp
libertyprime has joined #lisp
varjag has joined #lisp
libertyprime has quit [Ping timeout: 268 seconds]
malfort has quit [Ping timeout: 240 seconds]
elfmacs has quit [Ping timeout: 250 seconds]
elfmacs has joined #lisp
<boeg>
Is there a way to tell sbcl' repl to use a specific package as it's main "namespace". Like say I have a package at some.package with a function hello which I can call with `some.package::hello`, is it possible to say "right now i'm always at some.package" so I can just call the function with `hello` ?
<Xach>
boeg: (in-paaakge <the package name>)
<Xach>
err, package, not paaakge
igemnace has joined #lisp
<boeg>
Xach: Didn't realize I could do that in the REPL. Thanks!
scymtym has joined #lisp
<boeg>
oh, is it possible to reset it other than restart sbcl?
<Xach>
boeg: "reset" in what sense?
<Xach>
you can do (in-package :cl-user) to change back to the default package.
<Xach>
the default initial package for sbcl, that is
<boeg>
like, go back to whatever is sbcl starting "in-package state" which I don't know what is
<boeg>
ah, yes
<boeg>
exactly what I meant, of course
<boeg>
thank you
<Xach>
boeg: in slime, there is a shortcut with completion: ,change-package
<Xach>
or ,c-p SPACE
<boeg>
Xach: thanks! I'm using sly actually because I read somewhere it was "better", but I'm getting the feeling from this channel that most are using slime, and for example in this case, it's called ,set-package instead of ,change-package as far as I can see, so its not the first time I experience that, well, would be easier to get help if I were using slime :)
<boeg>
Maybe I should just revert to slime
<Xach>
boeg: i think sly may be better but i found it hard to switch
Necktwi has quit [Ping timeout: 250 seconds]
<boeg>
Right, I just started with sly when I started with common lisp so I didn't have to switch
<boeg>
arguably not long ago, so its limited what I would have to learn/unlearn either way
gxt has joined #lisp
Kevslinger has quit [Quit: Connection closed for inactivity]
Necktwi has joined #lisp
ralt has joined #lisp
<Xach>
i worry about a slime local maximum
<ck_>
Xach: maximum with respect to what?
<ck_>
usability in general?
libertyprime has joined #lisp
loskutak has joined #lisp
anewuser has joined #lisp
davepdotorg has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
femi has quit [Ping timeout: 252 seconds]
jackdaniel has joined #lisp
Cymew has joined #lisp
jackdaniel has quit [Read error: Connection reset by peer]
libertyprime has quit [Quit: leaving]
libertyprime has joined #lisp
jackdaniel has joined #lisp
ebzzry has joined #lisp
femi has joined #lisp
Lycurgus has joined #lisp
hhdave has joined #lisp
jackdaniel has quit [Read error: Connection reset by peer]
jackdaniel has joined #lisp
Cymew has quit [Quit: Konversation terminated!]
Cymew has joined #lisp
<Xach>
ck_: yes, vs sly
jackdaniel has quit [Read error: Connection reset by peer]
jackdaniel has joined #lisp
jackdaniel has quit [Read error: Connection reset by peer]
<jackdaniel>
were there attempts to implement The Nimble Type Inferencer in CL implementations? i.e is there some followup material except the paper by HBaker?
grabarz has joined #lisp
<jackdaniel>
I've only found a brief ramrk in https://www.pvk.ca/Blog/2013/04/13/starting-to-hack-on-sbcl/ that "a scheme (...) doesn't quite work for Common Lisp (it's very hard to propagate information backward while respecting the final standard)."
<jonatack>
jdz: ",in<RET>" nice, TIL
<beach>
jackdaniel: Yes, I don't think the technique works for standard Common Lisp.
nowhereman has quit [Ping timeout: 276 seconds]
<jackdaniel>
beach: thanks. I thought so basked on the the I've quoted. I'm curious of "why", so I've asked if there is a followup material which explains that. Is there some state of the art technique for CL, or it is "whatever CMUCL/SBCL does"?
<jackdaniel>
based*
xantoz has joined #lisp
<beach>
Let me see if I can come up with an example...
loskutak has quit [Ping timeout: 240 seconds]
JohnMS_WORK has quit [Read error: Connection reset by peer]
<nirved>
Xach: I used to do ,+p and when finished ,-p
JohnMS_WORK has joined #lisp
<ck_>
C-c M-p is another way to switch packages -- slime-repl-set-package
<beach>
jackdaniel: How about this: (progn (+ x 1) (f x) (assert (typep x 'fixnum)))
<Xach>
nirved: didn't know about that either
ljavorsk has joined #lisp
<nirved>
now just typing (in-package ...) is fast enough, and feels smoother
<jackdaniel>
beach: do you mean that it is not feasible, because it lifts declarations and type checks at the beginning, hence (f x) may never get executed because type is violated, while in comforming program error would be signalled only after (f x) is invoked?
<beach>
Yes, something like that.
<jackdaniel>
alright, thank you
<jackdaniel>
and regarding the second part of the question: is there a state of the art technique which may be used for common lisp?
<beach>
jackdaniel: I don't know. But in Cleavir the plan is to do type inference in HIR using the ordinary control flow.
<jackdaniel>
understood, thanks again
gxt_ has joined #lisp
gxt has quit [Ping timeout: 260 seconds]
<Xach>
jackdaniel: shoutout from stylewarning in his talk at sbcl20 - "[jackdaniel] does a wonderful job"
<ck_>
hear, hear :)
anewuser has quit [Ping timeout: 240 seconds]
<jackdaniel>
wow, thanks :)
jonatack has quit [Ping timeout: 252 seconds]
loskutak has joined #lisp
pilne has quit [Quit: If you think nobody cares, try missing a few payments]
rotty has quit [Quit: WeeChat 2.7-rc1]
edgar-rft has joined #lisp
Guest75462 has quit [Read error: Connection reset by peer]
Guest75462 has joined #lisp
vlatkoB has joined #lisp
_paul0 has quit [Ping timeout: 276 seconds]
jonatack has joined #lisp
jackdaniel has quit [Quit: jackdaniel]
jonatack has quit [Ping timeout: 240 seconds]
jonatack has joined #lisp
brown121407 has quit [Read error: Connection reset by peer]
brown121407 has joined #lisp
igemnace has quit [Quit: WeeChat 2.6]
ym has quit [Ping timeout: 250 seconds]
ggole has joined #lisp
akotlarski has joined #lisp
grabarz has quit [Read error: Connection reset by peer]
ym has joined #lisp
grabarz has joined #lisp
HDurer has quit [Remote host closed the connection]
<flip214>
question about mcclim: when using clouseau, heisig sees a small arrow (eg. for integers) and can open a menue with it (to increment numbers, for example).
thijso has quit [Ping timeout: 265 seconds]
<flip214>
I'm using QL mcclim 20191130, which also has these commands - but I don't see the arrow!
HDurer has joined #lisp
<flip214>
heisig suspects a window manager issue; I'm running lxqt with lightdm, I wouldn't expect that to be inferior!?!
<flip214>
Is there some configuration item that's wrong, is it a WM problem, ...?
<scymtym>
flip214: can you explain the "small arrow" part more? things that offer a context menu ("presentations" in CLIM terminology) should be highlighted with a thin black border (clouseau does additional highlighting for circularity indication, but that should be inconsequential here). right-clicking such a highlighted thing should open the context menu
<scymtym>
does the context menu maybe open on a different screen or at an odd position? clx/mcclim sometimes get that part wrong
smokeink has quit [Ping timeout: 250 seconds]
karlosz has quit [Quit: karlosz]
cosimone has joined #lisp
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 268 seconds]
stepnem_ has quit [Ping timeout: 250 seconds]
lucasb has joined #lisp
shifty has quit [Ping timeout: 268 seconds]
<flip214>
scymtym: I get a menu via right-click - but it only contains "Toggle inspect N", and not all the other goodies
<flip214>
and as for circularity detection: (clouseau:inspector `(1 #1=(2 3) #2=(#1# #2# #1#) 4))
<flip214>
gives me a "control stack exhausted" ;(
karlosz has joined #lisp
karlosz has quit [Quit: karlosz]
brown121407 has quit [Ping timeout: 268 seconds]
brown121407 has joined #lisp
stepnem has joined #lisp
<phoe>
flip214: evaluating `(1 #1=(2 3) #2=(#1# #2# #1#) 4) in SBCL blows the stack as well
<phoe>
same for a simpler case of `#1=(#1#)
<phoe>
looks like the SBCL quasiquote does not enjoy circularities
<phoe>
which means that no identity has a chance to be preserved
bitmapper has joined #lisp
<phoe>
which in turn implies that ## and #= do not work inside backquotes
<flip214>
is it just me, or are the names on https://www.cliki.net/CPS really badly broken not-any-longer UTF-8?
<phoe>
flip214: confirmed, broken for me too
<flip214>
phoe: thanks
omarish has joined #lisp
brown121407 has quit [Read error: Connection reset by peer]
brown121407 has joined #lisp
_Posterdati_ has joined #lisp
Posterdati has quit [Ping timeout: 265 seconds]
<scymtym>
flip214: the circularity example doesn't get to clouseau, it fails in the quasiquote expander
<scymtym>
flip214: is it possible that you are using an old version of clouseau? the entry-point should be CLOUSEAU:INSPECT (not CLOUSEAU:INSPECTOR). that would also explain the highlighting differences and the missing context menu
karlosz has joined #lisp
<Xach>
pfdietz: you suggested something a while ago that i have not been able to fully understand (and also I can't find the suggestion)
jmercouris has joined #lisp
<Xach>
pfdietz: it relates to the problem of suppressing output for quicklisp-provided systems and showing all output for other systems
<jmercouris>
I just wanted to point out in the topic that there is a much newer relese of SBCL available, what's the reasoning behind having the version numbers and implementations in the topic anyway?
<Xach>
jmercouris: it is a relic of an older time when more people got their news through IRC
<Xach>
I think it would be fine to leave them out
<jmercouris>
well, perhaps time to update it then!
<pfdietz>
Well, I'm not familiar with asdf plumping. Presumably this would go in an around method somewhere?
<Xach>
the leaves of the plan need different behavior depending on some property of the system to load
<Xach>
pfdietz: possibly, though i do not see a way forward with that idea
<phoe>
I just got a most crazy idea
<Xach>
i hope it solves all my problems and is nice and beautiful
<phoe>
replace *standard-output* with a Gray stream that, on each print, inspects the stack to figure out which system is currently being loaded - if it's not a system belonging to a list, then print nothing, otherwise, print the character to the wrapped *standard-output*
<phoe>
if anyone actually implements this, they should be shot
<jackdaniel>
systems may be loaded from local directories superseeding quicklisp ones
<Xach>
well, it may be crazy, but it is also ugly and not nice and does not solve my problem
<Xach>
aside from that it is fantastic!!
* phoe
sigh
<jackdaniel>
I have an idea, let me investigate for a minute
* phoe
goes back to performing dayjob things
<phoe>
jackdaniel: good luck
<Xach>
phoe: thank you anyway :)
<pfdietz>
It fills a much-needed gap in solution space!
<jackdaniel>
it will involve using internal asdf interface though (not exported)
<Xach>
jackdaniel: i do that now (lightly)
<Xach>
i might do it if it is not too deep
<jackdaniel>
Xach: specialize call-with-around-compile-hook (around method), which takes a) component, b) thunk; based on component pathname you may judge whether it is in ql directory or not and bind the appropriate dynamic variable
<jackdaniel>
you may control it per system, but also per module or even a file
<jackdaniel>
(and of course invoke call-next-method)
<Xach>
jackdaniel: hmm, and the idea is that because it is not external in asdf it is ok to add an :around?
<jackdaniel>
asdf does not add around, so there will be no conflict, unless someone is as rude as you and defines around themself! ;)
<jackdaniel>
(for internal interface)
jonatack has quit [Ping timeout: 268 seconds]
<jackdaniel>
or if asdf changes this interface without notification
<jackdaniel>
not something unseen of
<Xach>
right
kritixilithos has joined #lisp
<jackdaniel>
imo hooks should be implemented by means of registering and removing hooks
<jackdaniel>
so they are not limited with: one hook per class
<jackdaniel>
but whatever
<Xach>
so here is an idea i had that does not work
<Xach>
in my system search function, i can return a system object rather than a pathname
<Xach>
but i don't know how to make a system object with enough detail to replicate what should happen to the original system (which itself might be a system subclass, i think)
<Xach>
i don't think i could simply change-class without danger
<jackdaniel>
use a stealth mixin and you are golden
<Xach>
jackdaniel: how?
<jackdaniel>
(stealth-mixin:define-stealth-mixin my-class () asdf:system ()) ; and now you can add around method for your own class
<jackdaniel>
which will check where the system is located
<jackdaniel>
(your idea made me think of it)
<jackdaniel>
stealth-mixins are basically adding your class as a superclass for asdf:system in this example
<Xach>
that looks nice in the library but i cannot rely on any external code :(
<Xach>
no closer-mop etc
<Xach>
maybe that's not so bad
<jackdaniel>
another idea (not very efficient one though), you could define perform around method specialized on compile-op and (eql your-ql-system)
<copec>
I can't find any of the includes in libffi-types__grovel.c, so FFI_SYSV isn't defined
davepdotorg has joined #lisp
Davd33 has joined #lisp
clothespin has joined #lisp
<Bike>
You can't find or it can't find?
davepdotorg has quit [Ping timeout: 240 seconds]
stepnem has joined #lisp
Davd33 has quit [Remote host closed the connection]
pnp has joined #lisp
gravicappa has joined #lisp
Cerbb has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<Cerbb>
i am trying to install clisp. I am on debian stretch and the package is not in the repositories, so I am trying to build it from the source. I get this error when I run make
<Cerbb>
: #error oint_addr_mask does not cover CODE_ADDRESS_RANGE !!
<Cerbb>
krid has quit [Ping timeout: 250 seconds]
<jackdaniel>
Cerbb: is there a particular reason you are building clisp (and not i.e sbcl which is far more popular among common lisp developers)
Lycurgus has joined #lisp
<jackdaniel>
both implement the same standard (it is like i.e gcc and clang)
<Cerbb>
i mean...in principle i could try to make bergman understand that it can use something else instead of clisp, right?
<Cerbb>
thanks
efm has quit [Quit: Konversation terminated!]
<jackdaniel>
I'd still try to build it with another CL, bergman site mentions only, that it was tested on clisp, not that it depends on clisp internal features
<jackdaniel>
but who knows
<jackdaniel>
also, if you are looking for an algebra system, there is also maxima
<Cerbb>
actually, i usually use macaulay2. but i need to use a package on macaulay2 that calls bergman
amerlyq has joined #lisp
* jackdaniel
gives a blank stare
sjl has quit [Ping timeout: 250 seconds]
<Bike>
i can't even access the bergman website. blah.
<jackdaniel>
Bike: if that helps my browser got redirected to https
<jackdaniel>
wait, no, it didn't
<jackdaniel>
sorry for the noise
<Cerbb>
if you go to the download page on the left it actually sends you there
<Cerbb>
the download link in the middle of the page is broken
<Bike>
the readme says you can install it "with stand alone psl, with reduce, or with common lisp", so maybe those other two things won't involve clisp
<Bike>
never heard of them though
<jackdaniel>
Pssst, Lisp! ;-)
<Bike>
i think i don't want to know why math software is this dependent on the machine
Codaraxis has quit [Ping timeout: 245 seconds]
scymtym has quit [Ping timeout: 250 seconds]
<Cerbb>
i am trying to install psl or reduce
<copec>
Bike, I can't find, so I presume it can't find
<Bike>
this code looks fuckin ancient. some of it's as old as i am
<Bike>
but i found at least one ext:getvar, so using another lisp is nontrivial
<Bike>
but fixing bespoke 1996 code is a chore even if you are familiar with the language
nopolitica has joined #lisp
<Cerbb>
mmm...this sounds way beyond what i am able to do
<Cerbb>
xD
<Bike>
oh, and the readme ends "Good luck - you'll need it!"
<Cerbb>
yes
<Cerbb>
and the developer does not really answer emails
<Bike>
academia, mon
<pnp>
Cerbb: Good luck - you'll need it!
<pnp>
:-)
<Cerbb>
i guess i could upgrade to buster, get clisp from the repositories and try to see if it works that way
<Bike>
could maybe build clisp yourself... i don't know how stable that process is
<Bike>
keeping in mind the minimum version is from like 2006
<jackdaniel>
he tried (the first question prompting the discussion)
<Cerbb>
that is what i tried right before coming here...
<Cerbb>
i found a discussion that on my error suggests to configure with an option which should take care of it...but that solution did not work for me
<pnp>
yes but there are a lot of ways to calculate the things you need without that package
<Bike>
actually, emacs has this same code, so i guess simple-repl isn't used?
<jackdaniel>
exactly, so I'd just say that it doesn't conform to the standard (described in clhs)
<equwal>
CLtL2 has better explanation/examples on this.
<jackdaniel>
it may, but it is not what implementations adhere to
<Cerbb>
p_l: i ran your line...without sudo it gives a permission error...i tried with sudo and it runs, but i am not sure if it does what it downloads where it should
<Bike>
i have no idea what slime is actually running... what a mystery
<equwal>
I think mrepl is the server protocol extension to nrepl.
sammich has joined #lisp
Bike has quit [Quit: Bike]
hhdave has joined #lisp
brettgilio_ has quit [Remote host closed the connection]
Codaraxis has joined #lisp
milanj has joined #lisp
brettgilio has joined #lisp
rgherdt has quit [Ping timeout: 276 seconds]
gabiruh_ has joined #lisp
slyrus_ has joined #lisp
gabiruh has quit [Ping timeout: 245 seconds]
slyrus has quit [Ping timeout: 250 seconds]
rotucer has quit [Ping timeout: 252 seconds]
pnp has quit [Remote host closed the connection]
lottaquestions_ has joined #lisp
rotucer has joined #lisp
poet` has left #lisp ["ERC (IRC client for Emacs 26.3)"]
hhdave has quit [Quit: hhdave]
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
<no-defun-allowed>
With respect to the MOP, is the way slots are stored in an instance standardised?
<no-defun-allowed>
I think a few times in the book I read about a "storage vector" in instances, but I don't recall if that's just how their example works or if all MOP implementations work like that.
<no-defun-allowed>
Looks like I want standard-instance-access.
<phoe>
no-defun-allowed: I remember this being discussed some time ago
<phoe>
AFAIR all that is standardized is that each slot is indexed by an unsigned-byte
<no-defun-allowed>
Right.
<phoe>
so you can standard-instance-access with the slot index
<no-defun-allowed>
Maybe I am approaching this wrong, though. I have a metaclass which sets up instances in a way that I can access slots using either the normal CLOS machinery or the name used in the serialised format.
Bike has joined #lisp
<no-defun-allowed>
Currently to use the serialised name, we have a hash table of those names to slot names, and then take the slot-value from there, but I think having those two levels of indirection causes it to be much slower than just taking slot-value.
<phoe>
is the name used in the serialized format a string?
<no-defun-allowed>
Yes.
<phoe>
that's likely going to be slow anyway
orivej has joined #lisp
<phoe>
turn these strings into symbols, make them extra readers/writers for the slots.
loskutak has quit [Ping timeout: 252 seconds]
<phoe>
if you want isolation, intern them in a separate clean package.
<no-defun-allowed>
(We also want to avoid interning anything, because the serialised objects are sent to us from the network.)
Codaraxis has quit [Read error: Connection reset by peer]
<phoe>
ooh, untrusted input. Well.
<phoe>
I'd make an EQUAL hash table that binds strings to accessor functions. Don't think I can make this any faster.
<phoe>
Since each time we need to make a string comparison anyway.
<no-defun-allowed>
I did some micro-benchmarking and gethash-ing didn't seem too slow relative to the speed of the accessor.
<phoe>
Or slot names, that's equivalent.
<no-defun-allowed>
Yeah, that's exactly what we do, but I'm worried using slot names is going to be a problem since the slot name would have to be looked up too.
<phoe>
you can use lambdas that call standard instance access instead
<phoe>
that's as fast as you can get since it's literally array lookup
<no-defun-allowed>
That's what I have in mind to try now.
<phoe>
beware that you bypass most of CLOS this way.
<phoe>
so no generic functions, no methods, no :around/:after/:before, no access protocols for you.
<no-defun-allowed>
Sure.
<phoe>
are you using CLOS functionality anywhere else?