jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | offtopic --> #lispcafe
phoebe has joined #lisp
lottaquestions_ has quit [Read error: Connection reset by peer]
lottaquestions_ has joined #lisp
lottaquestions_ has quit [Client Quit]
marusich has joined #lisp
rig0rmortis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phoebe has quit [Ping timeout: 265 seconds]
rig0rmortis has joined #lisp
Jeanne-Kamikaze has joined #lisp
akoana has left #lisp ["Leaving"]
phoebe has joined #lisp
phoebe has quit [Ping timeout: 240 seconds]
Oladon has quit [Quit: Leaving.]
_jrjsmrtn has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 244 seconds]
yitzi has joined #lisp
Kundry_Wag has joined #lisp
jgodbout has joined #lisp
Kundry_Wag has quit [Ping timeout: 246 seconds]
gko_ has joined #lisp
phoebe has joined #lisp
akoana_ has joined #lisp
<AeroNotix> % swig -cffi
<AeroNotix> Target language option -cffi (CFFI) is no longer supported
<AeroNotix> did swig remove support for cffi then?
phoebe has quit [Ping timeout: 260 seconds]
<AeroNotix> Should I go find an old version?
Misha_B has quit [Remote host closed the connection]
akoana_ has quit [Client Quit]
<AeroNotix> :(
<AeroNotix> I am sure at some point I used swig to do cffi bindings, must be before they removed it
akoana has joined #lisp
<AeroNotix> What do people use nowadays?
<AeroNotix> Verrazano looks well complicated for what's needed, maybe just finding crap examples of how to use it
<no-defun-allowed> CFFI has a "groveller" which sounds useful, but I haven't had to generate FFI bindings before.
<AeroNotix> I just want to generate a basic set of Lisp functions from a header file
<AeroNotix> I'll poke around
madage has joined #lisp
<AeroNotix> verrazano looks baroque
<AeroNotix> I'll try the groveller
<AeroNotix> it looks like cffi-groveller is intended to be used with swig...
<AeroNotix> or maybe not.. still reading
EvW1 has quit [Ping timeout: 260 seconds]
neil-lindquist has joined #lisp
AeroNotix has quit [Quit: WeeChat 2.9]
neil-lindquist has quit [Remote host closed the connection]
phoebe has joined #lisp
phoebe has quit [Ping timeout: 240 seconds]
wsinatra has joined #lisp
rig0rmortis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Oladon has joined #lisp
iAmDecim has joined #lisp
rig0rmortis has joined #lisp
iAmDecim has quit [Ping timeout: 264 seconds]
iAmDecim has joined #lisp
iAmDecim has quit [Ping timeout: 240 seconds]
akoana has left #lisp ["Leaving"]
phoebe has joined #lisp
dxtr has joined #lisp
phoebe has quit [Ping timeout: 256 seconds]
Jeanne-Kamikaze has quit [Ping timeout: 264 seconds]
orivej has joined #lisp
space_otter has joined #lisp
muf4sa has joined #lisp
muf4sa has quit [Client Quit]
cgay has quit [Quit: Connection closed for inactivity]
Alfr_ has joined #lisp
mrcom has quit [Ping timeout: 265 seconds]
Alfr has quit [Ping timeout: 260 seconds]
iAmDecim has joined #lisp
FennecCode has quit [Ping timeout: 246 seconds]
drmeister has quit [Ping timeout: 246 seconds]
drmeister has joined #lisp
iAmDecim has quit [Ping timeout: 240 seconds]
rig0rmortis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FennecCode has joined #lisp
phoebe has joined #lisp
rig0rmortis has joined #lisp
<beach> Good morning everyone!
shangul has joined #lisp
phoebe has quit [Ping timeout: 265 seconds]
minerjoe has quit [Ping timeout: 240 seconds]
Necktwi has quit [Ping timeout: 246 seconds]
abhixec has quit [Ping timeout: 264 seconds]
shangul has quit [Quit: Leaving]
rig0rmortis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
terpri_ has quit [Remote host closed the connection]
terpri_ has joined #lisp
parjanya has joined #lisp
iAmDecim has joined #lisp
reggie__ has quit [Read error: Connection reset by peer]
iAmDecim has quit [Ping timeout: 256 seconds]
reggie_ has joined #lisp
paul0 has joined #lisp
_paul0 has quit [Ping timeout: 256 seconds]
brown121407 has quit [Remote host closed the connection]
brown121407 has joined #lisp
gravicappa has joined #lisp
toorevitimirp has joined #lisp
Bike has quit [Quit: Lost terminal]
gko_ has quit [Ping timeout: 265 seconds]
toorevitimirp has quit [Remote host closed the connection]
toorevitimirp has joined #lisp
toorevitimirp has quit [Client Quit]
Oladon has quit [Quit: Leaving.]
karlosz has quit [Quit: karlosz]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
iAmDecim has joined #lisp
karlosz has joined #lisp
iAmDecim has quit [Ping timeout: 260 seconds]
nullman has joined #lisp
xrash has quit [Ping timeout: 240 seconds]
narimiran has joined #lisp
minerjoe has joined #lisp
phoebe has joined #lisp
gaqwas has joined #lisp
gaqwas has joined #lisp
gaqwas has quit [Changing host]
phoebe has quit [Ping timeout: 256 seconds]
iissaacc has joined #lisp
Oladon has joined #lisp
nullman has quit [Quit: leaving]
nullman has joined #lisp
libertyprime has joined #lisp
iAmDecim has joined #lisp
_whitelogger has joined #lisp
aeth has joined #lisp
wxie has joined #lisp
bsd4me has quit [Quit: Clap on! , Clap off! Clap@#&$NO CARRIER]
minerjoe has quit [Ping timeout: 256 seconds]
marusich has quit [Remote host closed the connection]
aartaka has joined #lisp
Necktwi has joined #lisp
_whitelogger has joined #lisp
jprajzne has joined #lisp
wxie has quit [Ping timeout: 264 seconds]
jgodbout has quit [Quit: Connection closed for inactivity]
treflip has joined #lisp
ym has joined #lisp
aartaka has quit [Read error: Connection reset by peer]
<markasoftware> (symbolp nil) is trippy
<beach> Why?
vegansbane has joined #lisp
<beach> And, in code, if you want a form that evaluates to the symbol NIL, you should write 'nil.
ggole has joined #lisp
<beach> clhs 1.4.1.4.4
libertyprime has quit [Ping timeout: 265 seconds]
libertyprime has joined #lisp
aartaka has joined #lisp
aartaka has quit [Read error: Connection reset by peer]
simendsjo has joined #lisp
narimiran has quit [Ping timeout: 246 seconds]
jonatack has quit [Ping timeout: 272 seconds]
Bourne has joined #lisp
gaqwas has quit [Remote host closed the connection]
toorevitimirp has joined #lisp
notzmv` has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
ym has quit [Remote host closed the connection]
hendursaga has joined #lisp
notzmv has quit [Ping timeout: 240 seconds]
hendursa1 has quit [Ping timeout: 240 seconds]
gaqwas has joined #lisp
ym has joined #lisp
treflip has quit [Quit: WeeChat 2.6]
bilegeek has quit [Quit: Leaving]
aartaka has joined #lisp
_whitelogger has joined #lisp
libertyprime has quit [Read error: Connection reset by peer]
edgar-rft has joined #lisp
simendsjo has quit [Ping timeout: 258 seconds]
jonatack has joined #lisp
zaquest has quit [Quit: Leaving]
zaquest has joined #lisp
cosimone has joined #lisp
liberliver has joined #lisp
libertyprime has joined #lisp
<treflip> Hi! Has anyone used cl-earley-parser? I'm having troubles with parsing words that aren't defined in the lexicon.
iAmDecim has joined #lisp
brown121407 has quit [Read error: Connection reset by peer]
wxie has joined #lisp
random-nick has joined #lisp
iAmDecim has quit [Ping timeout: 260 seconds]
space_otter has quit [Remote host closed the connection]
mindCrime has quit [Ping timeout: 244 seconds]
aartaka has quit [Ping timeout: 258 seconds]
wxie has quit [Ping timeout: 256 seconds]
libertyprime has quit [Quit: leaving]
brown121407 has joined #lisp
iAmDecim has joined #lisp
minerjoe has joined #lisp
brown121407 has quit [Ping timeout: 240 seconds]
rippa has joined #lisp
iAmDecim has quit [Ping timeout: 260 seconds]
jasom has quit [Ping timeout: 244 seconds]
Volt_ has joined #lisp
wxie has joined #lisp
brown121407 has joined #lisp
jasom has joined #lisp
brown121407 has quit [Remote host closed the connection]
<iissaacc> any libraries with a util function for currying functions with keyword args? I've written my own but thought it might be better to use a widely used library for readability
<iissaacc> or is this not generally donw
<phoe> iissaacc: rcurry
<phoe> (alexandria:rcurry #'foo :bar baz :quux 42)
<phoe> that slaps keyword args at the end of the function call
<iissaacc> chur phoe
<iissaacc> (= chur cheers)
parjanya has quit [*.net *.split]
kinope has quit [*.net *.split]
infra_red[m] has quit [*.net *.split]
l1x has quit [*.net *.split]
bhartrihari has quit [*.net *.split]
wxie has quit [Quit: wxie]
madage has quit [Read error: Connection reset by peer]
madage has joined #lisp
infra_red[m] has joined #lisp
parjanya has joined #lisp
kinope has joined #lisp
bhartrihari has joined #lisp
l1x has joined #lisp
liberliver has quit [Ping timeout: 272 seconds]
wxie has joined #lisp
Bourne has quit [Ping timeout: 258 seconds]
wxie has quit [Ping timeout: 244 seconds]
yitzi has quit [Quit: yitzi]
cosimone has quit [Quit: Quit.]
iAmDecim has joined #lisp
iAmDecim has quit [Ping timeout: 246 seconds]
ym has quit [Quit: Leaving]
iAmDecim has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
Alloc has joined #lisp
bitmapper has quit [Ping timeout: 240 seconds]
iAmDecim has quit [Ping timeout: 256 seconds]
Alloc has quit [Ping timeout: 260 seconds]
Alloc has joined #lisp
sonologico has quit [Remote host closed the connection]
Alloc has quit [Ping timeout: 240 seconds]
Alloc has joined #lisp
jonatack has quit [Quit: jonatack]
sm2n has quit [Quit: Leaving]
treflip has quit [Quit: WeeChat 2.8]
sm2n has joined #lisp
treflip has joined #lisp
aartaka has joined #lisp
aartaka has quit [Read error: Connection reset by peer]
Alloc has quit [Ping timeout: 240 seconds]
Alloc has joined #lisp
jprajzne has quit [Quit: jprajzne]
gko_ has joined #lisp
EvW has joined #lisp
iissaacc has quit [Ping timeout: 265 seconds]
puchacz has joined #lisp
<puchacz> hi, has anybody used plump html parser to convert HTML into (with-output-to-string ...) template using <%= any code %> convention?
<puchacz> shinmera's plump I mean
<puchacz> actually it has nothing to do with plump - it has to be done on text level before parsing it to html, having thought of it for a minute
notzmv` is now known as notzmv
notzmv has quit [Changing host]
notzmv has joined #lisp
notzmv` has joined #lisp
notzmv is now known as Guest5375
notzmv` is now known as zmv
Guest5375 has quit [Ping timeout: 240 seconds]
zmv has joined #lisp
zmv has quit [Changing host]
zmv is now known as notzmv`
notzmv` is now known as notzmv
AeroNotix has joined #lisp
jw4 has quit [Read error: Connection reset by peer]
jw4 has joined #lisp
_whitelogger has joined #lisp
notzmv` has joined #lisp
notzmv has quit [Ping timeout: 256 seconds]
notzmv` is now known as zmv
zmv has quit [Changing host]
zmv has joined #lisp
lavaflow has quit [Quit: WeeChat 2.8]
Oladon has joined #lisp
lavaflow has joined #lisp
reb has joined #lisp
`IceK1ng has joined #lisp
rig0rmortis has joined #lisp
reb has quit [Ping timeout: 240 seconds]
reb``` has joined #lisp
`IceK1ng has quit [Quit: Reboot The Universe: (Y/N/Quit) https://imgur.com/a/ki6Mgcv]
orivej has joined #lisp
reb``` has quit [Ping timeout: 258 seconds]
reb`````` has joined #lisp
reb`````` has quit [Ping timeout: 256 seconds]
Bike has joined #lisp
reb`````` has joined #lisp
Krystof has joined #lisp
reb`````` has quit [Ping timeout: 256 seconds]
reb`````` has joined #lisp
reb`````` has quit [Ping timeout: 240 seconds]
reb`````` has joined #lisp
reb`````` has quit [Ping timeout: 260 seconds]
reb`````` has joined #lisp
hendursaga has quit [Quit: hendursaga]
hendursaga has joined #lisp
reb`````` has quit [Ping timeout: 265 seconds]
reb`````` has joined #lisp
rig0rmortis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aeth has quit [Ping timeout: 240 seconds]
aeth has joined #lisp
reb`````` has quit [Ping timeout: 265 seconds]
reb`````` has joined #lisp
rig0rmortis has joined #lisp
bitmapper has joined #lisp
reb`````` has quit [Ping timeout: 256 seconds]
zmv is now known as notzmv
duuqnd has joined #lisp
rig0rmortis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cosimone has joined #lisp
Volt_ has quit [Quit: ]
<AeroNotix> What's the most ideal way to run a specific function once when my system is initialized?
oxum has joined #lisp
<AeroNotix> e.g. a ffi'd library needs to run a global init function prior to being used.
<AeroNotix> I can think of a few hundred ways, but wondering if there's a proper built in way for this kind of thing
<dlowe> puchacz: have you looked at the stencl library?
oxum has quit [Remote host closed the connection]
<dlowe> AeroNotix: wrap it in the function that loads the library
orivej has quit [Quit: No Ping reply in 180 seconds.]
<AeroNotix> dlowe: well right now I have the cffi just run `use-foreign-library` you're saying that's not a good idea?
<AeroNotix> any way, not a big deal
EvW has quit [Ping timeout: 240 seconds]
oxum has joined #lisp
oxum has quit [Remote host closed the connection]
<dlowe> AeroNotix: Sure, I'm just saying you could wrap that call in with a function that also inits the library
orivej has joined #lisp
<dlowe> so that you don't have to think about it
<AeroNotix> cool ok, sounds good
yitzi has joined #lisp
rig0rmortis has joined #lisp
TwoNotes has joined #lisp
edgar-rft has quit [Quit: Leaving]
<TwoNotes> It is not clear to me how to make an advance declaration of a 'labels' function so they can recurseively call each other.
yitzi has quit [Read error: Connection reset by peer]
<Bike> you don't need to do anything in advance. if they're in the same labels they can call each other.
<Bike> (labels ((odd-p (n) (even-p (1- n))) (even-p (n) (or (zerop n) (odd-p (1- n))))) (odd-p 7)) => T
<TwoNotes> Ah, this is different from how defuns work
<beach> Oh?
<TwoNotes> If (defun a()) comes after (defun b()) then 'a' can not call 'b'. No?
<beach> It can.
<TwoNotes> wait I have that wrong
<TwoNotes> Only can make backward references I thought
<beach> What?
<beach> What made you think that?
<TwoNotes> If (defun a) comes before (defun b), can a call b?
<sjl> Yes.
<beach> Of course.
<TwoNotes> (in the same file)
<beach> Common Lisp is a dynamic language.
<beach> Even so, yes.
<TwoNotes> hmm, I must have gotten an error long ago about something else, and had to throw in a (declaim)
<beach> But you can't call them until the file has been loaded.
<Bike> you should never have _had_ to add a declaim for something function related
<beach> TwoNotes: If you LOAD the file rather than compiling it (which you probably shouldn't) you will get a warning that B is not defined.
<TwoNotes> I must have been doing that in early stages of development
<beach> TwoNotes: But B will be defined eventually, so then they can call each other.
<Bike> even a static language could have definitions calling each other throughout a file, if they were less braindead than C
<TwoNotes> I don't use load any more. I let ASDF do all the work
<beach> Then it should all be wrapped in a compilation unit, and you should see no warning.
<TwoNotes> ok, ty
<TwoNotes> it is working now
<beach> yaw
shka_ has joined #lisp
orivej has quit [Ping timeout: 264 seconds]
narimiran has joined #lisp
ebrasca has joined #lisp
akoana has joined #lisp
Oladon has quit [Quit: Leaving.]
orivej has joined #lisp
xrash has joined #lisp
cgay has joined #lisp
jprajzne has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life_ is now known as Lord_of_Life
simendsjo has joined #lisp
rig0rmortis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gko_ has quit [Ping timeout: 256 seconds]
jonatack has joined #lisp
liberliver has joined #lisp
yitzi has joined #lisp
treflip has quit [Quit: WeeChat 2.6]
mindCrime has joined #lisp
pve has joined #lisp
cosimone has quit [Quit: Quit.]
Oladon has joined #lisp
corpix_ has joined #lisp
corpix has quit [Ping timeout: 240 seconds]
nullheroes has quit [Quit: WeeChat 2.9]
nullheroes has joined #lisp
<mseddon> beach: interesting, so LOAD will raise warnings because it processes each top-level form in order?
vegansbane has quit [Quit: The Lounge - https://thelounge.chat]
vegansbane has joined #lisp
nadare has joined #lisp
flazh has quit [Ping timeout: 240 seconds]
<beach> Well, it can. SBCL does. I don't think the standard mentions anything about it.
vegansbane has quit [Quit: The Lounge - https://thelounge.chat]
skapata has joined #lisp
vegansbane has joined #lisp
gravicappa has quit [Ping timeout: 256 seconds]
ebrasca has quit [Ping timeout: 265 seconds]
gravicappa has joined #lisp
skapata has left #lisp ["Ĝis"]
edgar-rft has joined #lisp
aartaka has joined #lisp
pve has quit [Ping timeout: 265 seconds]
pve has joined #lisp
flazh has joined #lisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
jprajzne has quit [Quit: jprajzne]
<mseddon> beach, right. Because in my toy implementations I defer checking until after LOAD has processed the whole file.
beinnblade has joined #lisp
choegusung has joined #lisp
orivej has joined #lisp
<Alfr_> mseddon, beach, ``load sequentially executes each form it encounters in the file [...]''. And then some about top level form when implicit compilation is involved.
orivej_ has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
nicktick has quit [Ping timeout: 258 seconds]
choegusung has quit [Quit: leaving]
EvW has joined #lisp
nicktick has joined #lisp
pve has quit [Ping timeout: 240 seconds]
nadare has quit [Ping timeout: 240 seconds]
<Bike> sure, but the implementation doesn't have to issue warnings about undefined functions immediately.
<Bike> or at all, i don't think
TwoNotes has quit [Quit: Leaving]
simendsjo has quit [Ping timeout: 256 seconds]
Alfr_ has quit [Quit: Leaving]
nadare has joined #lisp
liberliver1 has joined #lisp
liberliver has quit [Ping timeout: 246 seconds]
liberliver1 is now known as liberliver
nadare has quit [Remote host closed the connection]
vegansbane has quit [Quit: The Lounge - https://thelounge.chat]
vegansbane has joined #lisp
IAmRasputin has joined #lisp
<AeroNotix> if a c function wants to take a `void *` for context in a callback. Is it a bad idea to get a pointer to any lisp object and use that? Does the GC guarantee that an object's address doesn't change?
<AeroNotix> or should I implement the void* context as a key to some map which looks it up- therefore circumventing any issues with the GC relocating objects?
IAmRasputin has quit [Quit: WeeChat 1.9.1]
<phoe> wait what
<phoe> for context? what do you mean by context?
<AeroNotix> A lot of C libraries that you provide callbacks to, will also take a void* which is some arbitrary value that will also be passed to the callback
<AeroNotix> it's so you can have some state (i.e. context)
<phoe> oh, so basically, that's arbitrary user-provided data
<AeroNotix> yeah
<phoe> do you make any use of that inside the callback? if not, pass a null pointer
<AeroNotix> I will make use of that inside the callback
IPmonger_ has joined #lisp
<phoe> oh, so you need a piece of raw memory that you will operate on in the C world
<AeroNotix> Well I want it to be a lisp object at some point, whether directly or being able to use the pointer to find that lisp object
IPmonger has quit [Ping timeout: 256 seconds]
<phoe> wait a second, manipulating Lisp data in C isn't really something that you would want to do
<phoe> you could try to allocate a static vector and fill it with your data of choice and grab the vector-sap and pass it that way, but that data is going to be ub8s or something similar
<Bike> no, the gc does not necessarily guarantee that objects's addresses don't change. your implementation may have a way to "pin" objects to get that guarantee for them in particular.
natj212_ has joined #lisp
<AeroNotix> I looked up pinning for SBCL, didn't seem like it would be ideal for this
<phoe> what exactly are you trying to do in the callback?
<AeroNotix> The callback handles network packets
<Bike> how is it not ideal? it's what you asked for.
<AeroNotix> Bike: it looked as if the pinning is tie to the life time of a scope
<Bike> well, yes. you can't permanently pin objects I don't think.
IPmonger has joined #lisp
IPmonger_ has quit [Ping timeout: 246 seconds]
<AeroNotix> phoe: the idea would be that the library calls your callback function when there is data to be sent out. My plan was to make a basic callback function and then the void*/user-data it would contain a method to retrieve an actual lisp function
<phoe> I am confused now
<Bike> aeronotix wants to use a closure as a callback.
<phoe> who calls into C? is the callback provided by you, or already existing? who passes in that void* data and who receives it and who decides what it is and how it should be parsed?
<AeroNotix> not a closure
Alfr has joined #lisp
<Bike> if it's the usual C callback idiom it sounds like a closure to me.
<Bike> you give it a function pointer and a void*, and then it calls the function pointer with the value you gave it. that's what you do if your language doesn't have closures.
<AeroNotix> Bike: yes the latter
<AeroNotix> I wouldn't call that a closure, though
<AeroNotix> but whatever, semantics.
<phoe> it isn't a closure in the C world
<AeroNotix> right
<phoe> but you can write a Lisp closure and have that called when your defcallback function is created
<phoe> or, if you call into C and then C calls back into Lisp, you can use dynavars for providing dynamic context
<Alfr> Bike, that's what they meant. Thanks for the clarification.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<AeroNotix> phoe: I can't provide dynamic variables for this
<AeroNotix> the callbacks will be called whenever and from multiple threads
<AeroNotix> I don't control that
<AeroNotix> so I can't bind a dynamic variable hoping that it will be bound properly
Codaraxis has quit [Remote host closed the connection]
<AeroNotix> which is why I wanted to use the void* to hold some lisp function and then it will be available all the time every time the callback is called.
<phoe> you don't need to do that if you define a callback via cffi:defcallback
<phoe> when control reaches such a callback function then that function has all of Lisp at its disposal
Codaraxis has joined #lisp
<phoe> it can do whatever, intern symbols, find fdefinitions, etc
<AeroNotix> is there an equivalent of defcallback which doesn't bind the callback to a name?
<AeroNotix> like an "anonymous" callback
<natj212_> I'm trying to remember this common lisp macro. It's similar to let but it doesn't evaluate the expression and just stores the expression. I'm trying to avoid copy-pasting aref everywhere
<natj212_> Does anyone remember this?
<phoe> natj212_: macrolet?
<phoe> AeroNotix: I don't know if it's in CFFI
<natj212_> Macrolet is for storing macros right?
<natj212_> That'd probably work just might be overkill
aartaka has quit [Ping timeout: 265 seconds]
<phoe> natj212_: what do you mean by "storing the expression"
<phoe> AeroNotix: sb-alien::alien-lambda
<Bike> that sounds more like symbol-macrolet
<Bike> though "storing the expression" is not the ideal way to think of it
<phoe> that's not portable though, I don't know if CFFI has anonymous callbacks like that./
<phoe> how many callbacks do you want to define like that, anyway? why not name them?
<AeroNotix> well I will just be using sbcl any way
<Bike> you can do like (symbol-macrolet ((x (aref y z))) (setf x 4)) which is equivalent to (setf (aref y z) 4).
puchacz has joined #lisp
<AeroNotix> phoe: because the library is intended to be arbitrarily used with user-code. The whole API is intentionally created so you can override tonnes of parts of it with callbacks.
<Bike> also it's a special operator rather than a macro.
<AeroNotix> it would be a crap API if I took that ability away
<natj212_> Symbol-macrolet might work
<phoe> AeroNotix: I don't understand, why can't the user just (defcallback my-package:my-callback ...) and pass my-package:my-callback as their callback?
<phoe> that's customizability right there
<AeroNotix> phoe: because I am trying to hide that it's a CFFI wrapper? I want to provide a nice API instead of something disgusting like that
<AeroNotix> I want them to just be able to provide pure lisp functions, no cffi, no nothing
<phoe> I see, so you might need to generate alien closures on the fly that close over Lisp functions.
<AeroNotix> I don't think so
<AeroNotix> if we go back to the beginning of my question
<phoe> defcallback over a gensym might work, but that's ugly stuff.
<AeroNotix> I had already mostly figured a nice API before we got into the weeds with interrogation
<phoe> what does your API look like?
<AeroNotix> there just needs to be one callback function defined, inside my wrapper, the library already has a void* user-data. Just set the void* to point to however you need to look the user's code up again.
<AeroNotix> for example: `(make-instance 'my-class :handle-event-type-x #'some-function)`
<AeroNotix> rather than what you're suggesting which is to leak the internals of the library (i.e. cffi details) to the user.
<AeroNotix> the goal here would be to make #'some-function the void* that the c lib already takes
<AeroNotix> and my generic callback uses that
<phoe> hmmmm
<AeroNotix> phoe: does that not make more sense?
<phoe> yes, it does
<AeroNotix> right
Codaraxis has quit [Remote host closed the connection]
<phoe> in the general case passing Lisp pointers to C is impossible because of Lisp GC being able to move objects at any time
<AeroNotix> yeah I get that, which is why I was going to set the void* to a key on some datastructure. Like a map protected with a RW lock
<phoe> you could index Lisp functions in some sorta hash table that is keyed with integer keys.
Codaraxis has joined #lisp
<AeroNotix> yeah ok
<AeroNotix> I will do that
natj212_ has quit [Ping timeout: 260 seconds]
<puchacz> hi, is http://clhs.lisp.se/Body/m_case_.htm required to use eq (so I can use keywords, or list of keywords in keys? or just symbols, t and otherwise? it says it has to be the "same", and the word "same" is linked, and "same" is explained that it is indistinguishable by a predicate, not saying which preidcate....
<AeroNotix> this is a http3/quic library. So far nothing I've found available aside from two libraries work with Google's load balancers.
<AeroNotix> so hence needing to use this daft library to do things. I hate the way the library is, but them's the breaks.
<phoe> puchacz: as far as I remember CASE uses EQL
<AeroNotix> There's a bunch of http3/quic libraries out there, but they don't support talking to Google load balancers... which is tedious to say the least.
<Alfr> AeroNotix, how do you decide that those functions won't be used again and you may loose your last reference to it? Otherwise you're going to accumulate some-functions.
Codaraxis has quit [Remote host closed the connection]
<puchacz> phoe: is it specified officially?
Codaraxis has joined #lisp
<AeroNotix> Alfr: you mean "how do you not leak memory" - the usual techniques.
<puchacz> eql should match on characters
<AeroNotix> by being diligent and not writing code that leaks.
<phoe> AFAIK there is a minor hole in the CASE page, it doesn't mention that EQL is used
<phoe> but AFAIK somewhere the spec says that if a predicate is not specified then EQL is assumed
<phoe> some things like CATCH explicitly use EQ.
<phoe> but it is explicitly noted
<puchacz> phoe: I would need to try but I had an impression that it was not matching characters from string
<Alfr> AeroNotix, I mean do you get some notification from the C side that some provided callback won't ever be used again?
<AeroNotix> Alfr: you explicitly close/free the library. It won't keep using things after you've closed it, barring a bug in the underlying library
<phoe> puchacz: (case #\b (#\a 1) (#\b 2) (#\c 3) (t 0))
<puchacz> phoe: it works (case (aref " " 0) (#\space "space"))
<phoe> try macroexpanding this
<puchacz> one sec
<puchacz> eql in sbcl
<puchacz> why is it quoting '#\b etc?
<Alfr> AeroNotix, so you have some points where you know that something won't be used again and can thus feed those some-functions to the GC on the lisp side. I was only curious. :)
<phoe> because it should
<phoe> the keys in CASE are not evaluated
<puchacz> okay :)
<phoe> see the second meaning
<phoe> from CLHS CASE: "If the test-key is the same as any key for that clause (...)"
<phoe> where "same" goes to the glossary
<puchacz> yes, "eql is the default predicate when none is mentioned explicitly."
<puchacz> from the glossary
<phoe> <3
<phoe> that's the spot
<puchacz> :)
<puchacz> thks
natj212_ has joined #lisp
yitzi has quit [Quit: yitzi]
yitzi has joined #lisp
secretmyth has quit [Ping timeout: 260 seconds]
akoana has left #lisp ["Leaving"]
rig0rmortis has joined #lisp
shka_ has quit [Ping timeout: 260 seconds]
brass has quit [Ping timeout: 246 seconds]
mindCrime has quit [Excess Flood]
space_otter has joined #lisp
mindCrime has joined #lisp
dmiles has quit [Ping timeout: 240 seconds]
dmiles has joined #lisp
random-nick has quit [Ping timeout: 246 seconds]
brass has joined #lisp
ggole has quit [Quit: Leaving]
gxt__ has joined #lisp
narimiran has quit [Quit: leaving]
<AeroNotix> phoe: https://github.com/AeroNotix/weird-pointers stuck all that into a system
eta has quit [Ping timeout: 258 seconds]
eta has joined #lisp
ebrasca has joined #lisp
gravicappa has quit [Ping timeout: 256 seconds]
<phoe> yes
<AeroNotix> Thanks for the help!
natj212_ has quit [Ping timeout: 258 seconds]
notzmv` has joined #lisp
notzmv has quit [Ping timeout: 256 seconds]
rig0rmortis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
notzmv` is now known as notzmv
notzmv has quit [Changing host]
notzmv has joined #lisp
Conductor has joined #lisp
duuqnd has quit [Remote host closed the connection]
MichaelRaskin has quit [Quit: MichaelRaskin]
jesse1010 has joined #lisp
beinnblade has quit [Remote host closed the connection]
gaqwas has quit [Ping timeout: 240 seconds]
bsd4me has joined #lisp
yitzi has quit [Read error: Connection reset by peer]
rig0rmortis has joined #lisp
Jeanne-Kamikaze has joined #lisp
aaaaaa has joined #lisp
puchacz has quit [Remote host closed the connection]
SenasOzys has joined #lisp
SenasOzys has quit [Client Quit]
SenasOzys has joined #lisp
rig0rmortis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rig0rmortis has joined #lisp
nicktick has quit [Ping timeout: 265 seconds]
gravicappa has joined #lisp
igemnace has joined #lisp
xrash has quit [Ping timeout: 240 seconds]
space_otter has quit [Remote host closed the connection]
bilegeek has joined #lisp
grewal has joined #lisp
mindCrime has quit [Excess Flood]
secretmyth has joined #lisp
mindCrime has joined #lisp