jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
dino_tutter has quit [Ping timeout: 268 seconds]
josrr has quit [Read error: Connection reset by peer]
decweb has quit [Ping timeout: 240 seconds]
kevingal has quit [Remote host closed the connection]
AndreiDuma has joined #commonlisp
AndreiDuma has quit [Client Quit]
decweb has joined #commonlisp
rendar has joined #commonlisp
czy has joined #commonlisp
decweb has quit [Ping timeout: 252 seconds]
anticrisis has joined #commonlisp
yitzi has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
mhcat` has quit [Ping timeout: 256 seconds]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
Odin-LAP has quit [Quit: What's this button do?]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dra has quit [Quit: Leaving]
varjag has quit [Ping timeout: 260 seconds]
dnhester26 has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life has joined #commonlisp
meritamen has joined #commonlisp
daox_ has joined #commonlisp
daox has quit [Ping timeout: 260 seconds]
meritamen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
decweb has joined #commonlisp
mulk has quit [Ping timeout: 256 seconds]
mulk has joined #commonlisp
bilegeek has joined #commonlisp
bilegeek has quit [Max SendQ exceeded]
bilegeek has joined #commonlisp
bilegeek has quit [Max SendQ exceeded]
bilegeek has joined #commonlisp
bilegeek has quit [Max SendQ exceeded]
bilegeek has joined #commonlisp
Inline has quit [Ping timeout: 252 seconds]
Inline has joined #commonlisp
bilegeek has quit [Max SendQ exceeded]
yitzi has quit [Remote host closed the connection]
zetef has joined #commonlisp
zetef has quit [Ping timeout: 260 seconds]
rgherdt has quit [Ping timeout: 264 seconds]
random-nick has quit [Ping timeout: 252 seconds]
ym has quit [Ping timeout: 240 seconds]
<jmercouris> anyone have suggestions for the best font for common lisp editing?
<Inline> depends
<Inline> terminal or some ide ?
<jmercouris> Some IDE
<Inline> and what are you using now ?
<Inline> i mean fontwise
<jmercouris> It doesn't matter what I'm using now
<Inline> i always try to opt for dejavu-sans mono when i can
<jmercouris> that's good advice, thank you
<Inline> it's fixed-width
<jmercouris> Right, I was looking at bitstream vera sans mono
<Inline> some people use the hack font or so
<jmercouris> I use Hack, I am asking for the default face I should be using in my IDE
<jmercouris> that I am writing
<Inline> ah
<jmercouris> The problem is that Public Sans, my interface font collides poorly with Hack
<BrokenCog> does anyone use CL for oauth2 authentication?
<BrokenCog> i can't seem to get passed an "invalid grant_type" error.
Inline has quit [Quit: Leaving]
NicknameJohn has joined #commonlisp
Inline has joined #commonlisp
Inline has quit [Read error: Connection reset by peer]
Inline has joined #commonlisp
Pixel_Outlaw has quit [Quit: Leaving]
theBlackDragon has quit [Ping timeout: 256 seconds]
mooncat has joined #commonlisp
theBlackDragon has joined #commonlisp
justache- is now known as justache
slyrus has joined #commonlisp
meritamen has joined #commonlisp
danza has joined #commonlisp
decweb has quit [Ping timeout: 256 seconds]
puke has quit [Ping timeout: 268 seconds]
msavoritias has joined #commonlisp
bubblegum has quit [Ping timeout: 264 seconds]
bubblegum has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #commonlisp
bubblegum has quit [Ping timeout: 268 seconds]
bubblegum has joined #commonlisp
bubblegum has quit [Read error: Connection reset by peer]
bubblegum has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
mooncat has quit [Quit: Connection closed for inactivity]
johnjaye has quit [Ping timeout: 264 seconds]
igemnace has joined #commonlisp
puke has joined #commonlisp
danza has quit [Quit: Leaving]
tyson2 has quit [Remote host closed the connection]
DustyDynamite has joined #commonlisp
DustyDynamite has quit [Quit: Leaving]
DustyDynamite has joined #commonlisp
DustyDynamite has quit [Client Quit]
NicknameJohn has quit [Ping timeout: 246 seconds]
azimut has quit [Ping timeout: 240 seconds]
Catie has quit [Ping timeout: 256 seconds]
danse-nr3 has joined #commonlisp
msavoritias has quit [Ping timeout: 256 seconds]
danse-nr3 has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
danse-nr3 has quit [Ping timeout: 260 seconds]
<beach> I just discovered a bunch of Lisp-related videos on YouTube by Gavin Freeborn. Does Gavin hang out here?
shka has joined #commonlisp
msavoritias has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
mgl_ has joined #commonlisp
danse-nr3 has joined #commonlisp
<waleee> he drove by #nyxt about a year ago I think
<waleee> at that time at least he used his github-handle (gavinok)
<beach> I see. Thanks.
dino_tutter has joined #commonlisp
khrbtxyz has quit [Ping timeout: 256 seconds]
khrbtxyz has joined #commonlisp
_cymew_ has joined #commonlisp
bendersteed has joined #commonlisp
NotThatRPG_away has quit [Ping timeout: 260 seconds]
AndreiDuma has joined #commonlisp
jmdaemon has joined #commonlisp
varjag has joined #commonlisp
AndreiDuma has quit [Client Quit]
chomwitt has joined #commonlisp
AndreiDuma has joined #commonlisp
khrbtxyz has quit [Ping timeout: 260 seconds]
attila_lendvai has joined #commonlisp
khrbtxyz has joined #commonlisp
Cymew has joined #commonlisp
traidare has joined #commonlisp
igemnace has quit [Read error: Connection reset by peer]
waleee has quit [Ping timeout: 252 seconds]
puke has quit [Ping timeout: 256 seconds]
attila_lendvai has quit [Ping timeout: 256 seconds]
khrbtxyz has quit [Ping timeout: 260 seconds]
anticrisis has quit [Read error: Connection reset by peer]
igemnace has joined #commonlisp
dcb has quit [Quit: Connection closed for inactivity]
Odin-LAP has joined #commonlisp
khrbtxyz has joined #commonlisp
treflip has joined #commonlisp
makomo has quit [Ping timeout: 256 seconds]
attila_lendvai has joined #commonlisp
pranavats has joined #commonlisp
treflip has quit [Ping timeout: 260 seconds]
mzan has quit [Ping timeout: 264 seconds]
msavoritias has quit [Ping timeout: 252 seconds]
mzan has joined #commonlisp
rgherdt has joined #commonlisp
meritamen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
makomo has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
random-nick has joined #commonlisp
attila_lendvai has quit [Ping timeout: 256 seconds]
villageidiot has joined #commonlisp
msavoritias has joined #commonlisp
meritamen has joined #commonlisp
dnhester26 has joined #commonlisp
jmdaemon has quit [Ping timeout: 240 seconds]
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
supercode has joined #commonlisp
rogersm has joined #commonlisp
danse-nr3 has quit [Ping timeout: 276 seconds]
Inline has quit [Quit: Leaving]
zups has quit [Quit: WeeChat 3.6]
ym has joined #commonlisp
rogersm has quit [Remote host closed the connection]
daox_ has quit [Quit: WeeChat 4.0.4]
decweb has joined #commonlisp
rogersm has joined #commonlisp
rogersm has quit [Ping timeout: 268 seconds]
igemnace has quit [Quit: WeeChat 4.1.2]
yitzi has joined #commonlisp
Odin-LAP has quit [Quit: What's this button do?]
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chiselfuse has quit [Ping timeout: 240 seconds]
tyson2 has joined #commonlisp
chiselfuse has joined #commonlisp
khrbtxyz has quit [Ping timeout: 260 seconds]
dcb has joined #commonlisp
Odin-LAP has joined #commonlisp
chomwitt has quit [Ping timeout: 256 seconds]
khrbtxyz has joined #commonlisp
danse-nr3 has joined #commonlisp
<mfiano> jmercouris: You can check out Monaspace for the "shiny-new font tech". I don't usually go running towards the light though...it gets pretty blinding
rogersm has joined #commonlisp
rogersm has quit [Remote host closed the connection]
supercode has quit [Quit: Client closed]
rogersm has joined #commonlisp
rogersm has quit [Remote host closed the connection]
rogersm has joined #commonlisp
AndreiDuma has joined #commonlisp
rogersm has quit [Remote host closed the connection]
supercode has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
<mfiano> jmercouris: That said, it doesn't look too bad and has a nice idea/gimmick, though my current recommendation for readable code is Iosevka, one of the Slab variants, specifically.
rogersm has joined #commonlisp
<supercode> In https://www.lispworks.com/documentation/HyperSpec/Body/f_nconc.htm what does (nconc nil . lists) == (nconc . lists) mean?
<ixelp> CLHS: Function NCONC
<supercode> I mean what does dot (.) mean there?
<mfiano> it is reader syntax to separate the cdr of a cons.
<mfiano> (1 . 2) = (cons 1 2)
rogersm has quit [Remote host closed the connection]
rogersm has joined #commonlisp
<supercode> I guess what I am unable to understand is what does (nconc . lists) mean on the right hand side.
<supercode> (cons nconc lists)?
<supercode> I am trying to understand the behavior of (let ((a nil) (b (list 10 20 30))) (format t "~a~%" (nconc a b)) (format t "~a~%" a))
<supercode> this prints (10 20 30) and NIL. which recursion rules there explains both outputs. that's what I am having trouble with.
<supercode> If this invokes this rule: (nconc list-1 list-2) == (progn (rplacd (last list-1) list-2) list-1) then should I not get an error when it tries (rplacd (last nil)) ?
<mfiano> any of the remaining rules
<mfiano> the . is basically &rest, and both syntaxes can be used in destructuring-bind's destructuring-lambda-list's to test.
<mfiano> s/remaining/subsequent/
<supercode> ok, let me share what I understand and please point to me where I am going wrong
<bike> it applies the second rule, (nconc nil . lists) = (nconc . lists). so (nconc nil (list 10 20 30)) = (nconc (list 10 20 30)).
<supercode> (let ((a nil) (b (list 10 20 30))) (nconc a b)). will this perform (nconc nil b) == (progn (rplacd (last nil) b) nil)
<supercode> ?
<bike> it will not rplacd.
rogersm has quit [Ping timeout: 246 seconds]
<supercode> bike: just saw your message. I think that is explaining the behavior. let me take a few more minutes to wrap my head around it.
overclucker_ has quit [Read error: Connection reset by peer]
overclucker has joined #commonlisp
<supercode> bike: yes, that is it. so it does (nconc (list 10 20 30)) and returns (list 10 20 30) according to 3rd rule. And a remains unchanged as nil
<bike> yep.
<supercode> wow! so much going on here.
<supercode> I was expecting (let ((a nil) (b (list 10 20 30))) (nconc a b)) to set a to (10 20 30).
<mfiano> Also note that nconc is pretty special, and may be the only function that guarantees destructive modifications. Usually it is up to the implementation to decide.
<supercode> because (let ((a (list 1 2 3)) (b (list 10 20 30))) (nconc a b)) sets a to (1 2 3 10 20 30).
<mfiano> the only n* function, rather.
<supercode> does it not bother anyone that nconc does not set a to (10 20 30) in the former case when a is nil?
<supercode> would it have been trouble to implement nconc in such a way that (let ((a nil) (b (list 10 20 30))) (nconc a b)) would set a to (10 20 30)? why or why not?
msavoritias has quit [Ping timeout: 276 seconds]
<supercode> I guess one problem is that the CDR of nil is also nil, so there is no place to set the 2nd list to.
<bike> it would be impossible to do that
<bike> nconc is a function. it doesn't know anything about variable bindings. it just gets the lists as inputs.
<supercode> yes
<supercode> getting the hang of it
<bike> consider (nconc nil (list a b c))
<bike> nil is a constant. it cannot be modified.
<supercode> so 'a' really needs to be a cons cell if I want to make 'a' grow with nconc calls.
<bike> you can just do (setf a (nconc a ...))
<mfiano> I would be curious to know if there is any code out there using ,. that is 'acceptable code'.
supercode has quit [Ping timeout: 250 seconds]
cmack has joined #commonlisp
<mfiano> ie; when is it useful to do such a thing at read time? it has only bitten me, by using comma in backquoted expressions that were variables beginning with a #\. in their name/
danse-nr3 has quit [Ping timeout: 260 seconds]
supercode has joined #commonlisp
khrbtxyz has quit [Ping timeout: 256 seconds]
<bike> it's never acceptable, because anyone looking at it will go "wait, what the heck is this syntax" and be lost
khrbtxyz has joined #commonlisp
Inline has joined #commonlisp
<mfiano> Thanks for the confirmation.
meritamen has quit [Remote host closed the connection]
olnw_ has joined #commonlisp
olnw has quit [Ping timeout: 244 seconds]
NicknameJohn has joined #commonlisp
NotThatRPG has joined #commonlisp
<dnhester26> I'm declaring a variable in a let and getting a defined but never used warning from the compiler, however, **I am** declaring it ignorable beforehand, so why am I getting the warning? am I doing the declaration in the wrong place? Here's the code https://plaster.tymoon.eu/view/4082#4082
<dnhester26> the clhs doesn't have any examples... https://www.lispworks.com/documentation/HyperSpec/Body/d_ignore.htm
<ixelp> CLHS: Declaration IGNORE, IGNORABLE
<ixelp> ignore, ignorable | Common Lisp (New) Language Reference
<beach> dnhester26: Is it json-params-name you are referring to?
<dnhester26> beach: yeah
<dnhester26> it get's set in the let with-json-params
<beach> No, it doesn't get set. It gets bound.
<dnhester26> maybe I should've declared it inside the let??
<beach> So that's a different variable.
<dnhester26> sorry bound
<beach> But that's probably what makes the difference.
<dnhester26> hm I did not understand.
<dnhester26> in the macro: defjson-route-with-preflight-params I am definitely using json-params-name
<beach> Where?
<dnhester26> only in the with-json-params macro it's possibly not being used, but it's declared ignorable beforehand. Or should I declare it ignorable in that with-json-params macro??
rogersm has joined #commonlisp
<dnhester26> (with-json-params (,json-params-name ,@route-params)
<dnhester26> I am passing it down to wihth-json-params
<dnhester26> *with-json-params
<beach> That expands to (let* ((,json-params-name...
<beach> So that's a different variable, because it is bound, not set.
<beach> If you have (let ((x 234)) (let ((x 345)) ...)) then the second X is not a use of the first one.
<dnhester26> ah ok, that's what am not understanding between bound and set. Bound I thought was about slots in CLOS, set I thought was about any variable. How does that affect what am doing? Should I declare it ignorable in a different way or place in the code?
NicknameJohn has quit [Ping timeout: 256 seconds]
<beach> LET creates a new variable, it does not set an existing variable.
<beach> That's what it means to bind it.
<dnhester26> thanks for explaining the difference between bind and set
<beach> I would think you need the IGORABLE declaration at the top-level body in your macro.
<beach> ... before `(defpost...
<dnhester26> So in the let I am declaring a variable that is never used and that's why I get warning, but I declared it ignorable in the macro
<dnhester26> why does the order make a difference?
rogersm has quit [Ping timeout: 268 seconds]
<beach> You are basically declaring as IGNORABLE a variable that is not in scope in the resulting expansion.
rogersm has joined #commonlisp
<beach> Your macro defjson-... expands to (defpost... (declare (ignorable <some-name>)) But that variable no longer exists.
<dnhester26> so the ignorable should be inside the let?
<beach> It should be outside the `(...
<beach> Consider this simplified macro: (defmacro bla (x) `(let ((y 234)) (declare (ignorable x)) y))
<dnhester26> I tried but still gave me a warning
<dnhester26> macroexpand for some reason is not expanding every macro
<dnhester26> ah so it inside the let then
<beach> Consider this simplified macro: (defmacro bla (x) `(let ((y 234)) (declare (ignorable x)) y))
<beach> ,((defmacro bla (x) `(let ((y 234)) (declare (ignorable x)) y))) ,(macroexpand-1 '(bla 222))
<ixelp> ((defmacro bla (x) `(let ((y 234)) (declare (ignorable x)) y))) ERROR: Car of ((DEFMACRO BLA (X) '(LET ((Y 234)) (DECLARE (IGNORABLE X)) Y))) is not a function name or lambda-expression. , further (macroexpand-1 '(bla 222)) => (BLA 222); NIL
<dnhester26> in this simplified macro you are making the declaration inside the let, that's the point? because that's the context where the variable is defined?
<beach> ,(defmacro bla (x) `(let ((y 234)) (declare (ignorable x)) y)) ,(macroexpand-1 '(bla 222))
<ixelp> (defmacro bla (x) `(let ((y 234)) (declare (ignorable x)) y)) ;Compiler warnings : ↩ ; In BLA: Unused lexical variable X ↩ => BLA, and then (macroexpand-1 '(bla 222)) => (LET ((Y 234)) (DECLARE (IGNORABLE X)) Y); T
<beach> This is basically what you are doing.
<beach> Even if I do:
<beach> Sorry, give me some time.
<beach> ,(defmacro bla (x) (declare (ignorable x)) `(let ((y 234)) y)) ,(macroexpand-1 '(bla 222))
<ixelp> (defmacro bla (x) (declare (ignorable x)) `(let ((y 234)) y)) => BLA, and then (macroexpand-1 '(bla 222)) => (LET ((Y 234)) Y); T
varjag has quit [Quit: ERC (IRC client for Emacs 27.1)]
<beach> If I were to try to use the expansion of the first macro: ,(LET ((Y 234)) (DECLARE
<beach> (IGNORABLE X)) Y)
<beach> Sorry.
<beach>
<beach> If I were to try to use the expansion of the first macro: ,(LET ((Y 234)) (DECLARE (IGNORABLE X)) Y)
<ixelp> (LET ((Y 234)) (DECLARE (IGNORABLE X)) Y) ;Compiler warnings : ↩ ; In an anonymous lambda form: IGNORABLE declaration for unknown variable X ↩ => 234
<beach> This is basically what you do.
<beach> You can safely do (defmacro defjson... (...) (declare (ignore json-params-name)) `(defpost-rout...
<beach> Er, no wait, that might not be right.
<dnhester26> ah outside the backquote, I was doing backquote and comma, but the point is to do it outside?
<beach> My second example puts it there.
<beach> I am a bit tired, so my explanation might be off.
<dnhester26> i am not really understanding. Is this basically what I'm doing (copy paste from your comment)? ,(LET ((Y 234)) (DECLARE (IGNORABLE X)) Y)
<ixelp> (LET ((Y 234)) (DECLARE (IGNORABLE X)) Y) ;Compiler warnings : ↩ ; In an anonymous lambda form: IGNORABLE declaration for unknown variable X ↩ => 234
<beach> The expansion of your macro defjson-... will be:
<beach> (defpost-route... (declare (ignorable <some-name)) ...)
kensanata has joined #commonlisp
<beach> But <some-name is not in scope, so you are declaring a variable ignorable that is not in scope.
kensanata has left #commonlisp [OK]
<bike> if this is the code in paste 4082, it looks like the ignorable doesn't even make it into the expansion
<beach> bike: What do you mean?
<beach> It is right there.
<bike> defjson-route-with-preflight-params, right? the code is (defmacro ... (declare (ignorable ,json-params-name)) `(defpost-route-with-preflight ...))
<beach> But in the expansion, there will be an IGNORABLE declaration of a variable that does not exist.
epony has quit [Remote host closed the connection]
<bike> this doesn't even seem valid, it's got a comma out of a backquote
Inline has quit [Quit: Leaving]
<beach> No, the code is not that.
<bike> dnhester26, have you edited this or something?
<beach> Oh!
<dnhester26> i edited it
<beach> Oh, wow.
<dnhester26> i should've just copy paste from my editor
<dnhester26> one sec, I'll make a new one with copy paste
<dnhester26> sorry for the confusion
<beach> dnhester26: I never told you to put a comma in there.
<beach> I should let bike do this.
<dnhester26> beach: sorry that was a typo later that I fixed in the editor and instead of just copy paste i tried editing the pastebin with the same changes, my bad
<bike> sorry to add to the confusion here
<dnhester26> bike: can you please take a look at the new one? https://plaster.tymoon.eu/view/4083#4083
<bike> this is wrong in kind of the opposite way from what beach was talking about, i think
<bike> if you want to declare a variable ignorable, you put the declaration where the variable is bound
<bike> here, you're declaring the _macro parameter_ json-params-name ignorable. this parameter is a symbol, a variable _name_. and it's pointless, since you always use it, on line 17
Inline has joined #commonlisp
<bike> what you actually want to declare ignorable is the variable bound by with-json-params, right? or do i have that wrong?
<dnhester26> in this new pastebin, I think the correct place is really line 15, not 13 as it is now, because that marcro is a progn with two lambda definitions and only the second one which is the body uses json-params-name
<bike> line 15 would be wrong, since that's not where the variable is bound
<dnhester26> yeah, meaning some variable my-var that I am passing in
<bike> if you want to declare my-var ignorable you need to do that where my-var is bound
<dnhester26> I get the compiler warning when calling defjson-route-with-preflight-params with some my-var saying it's unused
<dnhester26> bike: so that should be line 3? but I was also getting the warning there
<bike> and that'll be on line 18, in with-json-params. (with-json-params (,json-params-name ,@route-params) (declare (ignorable ,json-params-name)) ,@body)
<bike> now say you have (json-route-with-preflight-params whatever myvar ...). The expansion will have (with-json-params (myvar ...) (declare (ignorable myvar)) ...)
<bike> the with-json-params form then expands into (let* ((myvar ...) ...) (declare (ignorable myvar)) ...)
<bike> which is just what youw ant.
<dnhester26> bike: what's the difference between line 18 and 3? or for that case between lines 7 and 8?
<dnhester26> bike: ah so it had to be inside the let?
<bike> the declaration needs to go where the variable is bound
<beach> It has to be where the variable is bound.
<bike> which in this case is the let* form
<bike> line 3 would be inappropriate, because then you are, again, declaring the MACRO PARAMETER json-params ignorable
anticomputer has quit [Remote host closed the connection]
<dnhester26> bike: finally, just did it between 7 and 8 and got rid of the warning. So the whole problem was that it had to be **inside** the let scope. correct? that's what I was trying to understand
<bike> Yes, you put the declaration in the form that binds the variable.
a51 has quit [Quit: WeeChat 4.1.2]
anticomputer has joined #commonlisp
<bike> (let ((foo ...)) (declare (ignorable foo)) ...), that's the syntax.
<dnhester26> got it, ok, I think this is prime material for the technical reference, at least examples, or maybe I'm just a bit tired today
<beach> dnhester26: Again, in (LET ((X 234))... the variable X is not a reference, so declaring x ignorable outside the LET does not refer to that X.
anticomputer has quit [Remote host closed the connection]
<dnhester26> beach: bike: thank you both! :D
<dnhester26> yeah got it
<beach> Great!
azimut has joined #commonlisp
anticomputer has joined #commonlisp
<dnhester26> the declaration is always after it's bound? or as long as it is in the same context it's OK? meaning could I do ,(let (declare (ignorable x))((x 24)))?
<ixelp> (let (declare (ignorable x))((x 24))) ERROR: While compiling an anonymous function : ↩ In the form ((X 24)), (X 24) is not a symbol or lambda expression.
<dnhester26> ok, so it looks like it has to be after the variables are bound from that error
<dnhester26> so always in this order ,(let ((x 24)) (declare (ignorable x)))
<ixelp> (let ((x 24)) (declare (ignorable x))) => NIL
<bike> ::clhs let
<ixelp> CLHS: Special Operator LET, LET*
<bike> let ({var | (var [init-form])}*) declaration* form* => result*
azimut has quit [Remote host closed the connection]
<dnhester26> bike: ah wow, I never noticed that "declaration" in the syntax
<dnhester26> that's great
azimut has joined #commonlisp
mzan has quit [Ping timeout: 240 seconds]
<dnhester26> thank you so much! I feel like my eyes have been opened a bit to notice the syntax better and understand this ignorable business
khrbtxyz has quit [Ping timeout: 256 seconds]
<bike> glad to help
Pixel_Outlaw has joined #commonlisp
epony has joined #commonlisp
khrbtxyz has joined #commonlisp
puke has joined #commonlisp
<dnhester26> :D
NotThatRPG has quit [Ping timeout: 260 seconds]
puke has quit [Max SendQ exceeded]
cdegroot has quit [Ping timeout: 260 seconds]
a51 has joined #commonlisp
puke has joined #commonlisp
puke has quit [Max SendQ exceeded]
puke has joined #commonlisp
donleo has joined #commonlisp
lucasta has joined #commonlisp
danse-nr3 has joined #commonlisp
kevingal has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
yitzi has quit [Remote host closed the connection]
makomo has quit [Ping timeout: 260 seconds]
<dnhester26> can anyone please proofread the examples for the ignore declaration I just added? https://lisp-docs.github.io/cl-language-reference/chap-3/d-i-dictionary/ignore_ignorable_declaration#expanded-reference-ignore-ignorable
<ixelp> ignore, ignorable | Common Lisp (New) Language Reference
zups has joined #commonlisp
<dnhester26> are there any other examples that may be useful to know? or any other explanation that is good to write?
bjorkintosh has quit [Quit: Leaving]
<beach> dnhester26: I would not use the term "statement".
<beach> Especially not for declarations.
<beach> dnhester26: The only mention of "statement" in the standard is in the equivalent of TAGBODY.
<dnhester26> beach: what should I replace it with? the declaration and remove `declare`? saying the `declare` declaration sounds bad...
<dnhester26> beach: thanks for the proofreading btw
<beach> Yes, "declaration" is good.
<beach> Also, you don't ignore the binding. You ignore the variable.
Cymew has quit [Ping timeout: 255 seconds]
<beach> "after the variables" -> "after the bindings"
<beach> Replace ") (" by ") (" in (defun foo ...
<dnhester26> beach: was that an extra white space in the defun?
<beach> Yes.
<dnhester26> got it, thanks
<Alfr> dnhester26, nitpicking: (defvar *x* 42) (locally (declare (ignore *x*)) (1+ *x*))
<beach> What, what?
<beach> Alfr: What do you mean?
<Alfr> dnhester26, not sure if above still complies with "declaration must be within the scope where the binding happens".
zyd has quit [Remote host closed the connection]
<Alfr> beach, I'd expect a warning for using *x* withing that locally.
<dnhester26> ,(defvar *x* 42) (locally (declare (ignore *x*)) (1+ *x*))
<ixelp> (defvar *x* 42) => *X*
olnw_ has quit [Quit: ZNC - https://znc.in]
<aeth> dnhester26: you have to , each expression that's top level
<aeth> for the bot
<dnhester26> Alfr: you mean that since the defvar is outside of the locally form?
<dnhester26> aeth: thanks
<aeth> ,(defparameter *one*) ,(1+ *one*)
<ixelp> (defparameter *one*) ERROR: (*ONE*) can't be destructured against the lambda list (CCL::VAR CCL::VALUE &OPTIONAL CCL::DOC), because it contains 1 elements, and at least 2 are expected. , also (1+ *one*) ERROR: Unbound variable: *ONE*
<aeth> ,(defparameter *one* 1) ,(1+ *one*)
<ixelp> (defparameter *one* 1) => *ONE*, while (1+ *one*) => 2
<aeth> my bad
<aeth> coding live without an IDE, so tough
<dnhester26> ,(defvar *x* 42) ,(locally (declare (ignore *x*)) (1+ *x*))
<ixelp> (defvar *x* 42) => *X*, also (locally (declare (ignore *x*)) (1+ *x*)) => 43
<dnhester26> ,(defvar *x* 42) ,(locally (declare (ignore *x*)) (1+ *x*)) ,(princ *x*)
<ixelp> (defvar *x* 42) => *X* and (locally (declare (ignore *x*)) (1+ *x*)) => 43 finally (princ *x*) 42 => 42
<beach> The compiler is not obliged to signal warnings for any of these cases.
<dnhester26> Alfr: thanks for the proofreading. Did you mean that since the defvar is outside of the locally form?
olnw has joined #commonlisp
<aeth> are you trying to incf it instead of 1+ it or...?
<dnhester26> beach: maybe Alfr means that the way I wrote it implies there should be a warning, and the language has to be changed.
<dnhester26> this is the sentence I wrote: "A key point to declaring variable bindings to be ignored is that the declaration must be *within* the scope where the binding happens."
<dnhester26> So here the declaration is not within the scope
<dnhester26> aeth: I was just trying to execute the example Alfr wrote ;)
<beach> It is within the scope, but it is not a bound declaration, and it's iffy anyway to have special variable declared IGNORE.
<dnhester26> beach: Oh, and I think I now understood what you said: since there is no warning anyway, there is no need for the declaration either
<dnhester26> beach: in conclusion: should I leave the text as it?
<Alfr> dnhester26, in a sense it is, should be in the global environment. But, yeah, textually it isn't,
<beach> *sigh*
<beach> Declarations can be "bound" or "free".
olnw has quit [Ping timeout: 244 seconds]
<beach> In a LOCALLY, declarations are "free", but they are still in scope if the are in scope outside the LOCALLY.
<beach> So in (locally (declare ignore *x*) ...) the declaration is free, but since the variable is bound in the global environment, the declaration is in scope.
<beach> It also does not make much sense to me to have free IGNORE or IGNORABLE declarations.
<beach> At least I can't think of a use case for such a thing.
<aeth> ,(declaim (ignore *x*)) ,(defvar *x* 42)
<ixelp> (declaim (ignore *x*)) => NIL, further (defvar *x* 42) => *X*
<aeth> ,(declaim (ignore *x*)) ,(defvar *x* 42) ,*x*
<ixelp> (declaim (ignore *x*)) => NIL, also (defvar *x* 42) => *X*
<aeth> ,(declaim (ignore *x*)) ,(defvar *x* 42) ,(progn *x*)
<ixelp> (declaim (ignore *x*)) => NIL and (defvar *x* 42) => *X* finally (progn *x*) => 42
NotThatRPG has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
<beach> I mean, if you have (let ((x 234) (y 234)) (locally (declare (ignore x)) y)), then X is still unused in the (locally ...) form. And in fact, SBCL gives a style warning for a free IGNORE declaration.
<beach> And, again, SBCL gives a style warning that X is not used.
olnw has joined #commonlisp
<beach> So I maintain that it doesn't make much sense to have free IGNORE or IGNORABLE declarations.
olnw has quit [Client Quit]
olnw has joined #commonlisp
ldb has joined #commonlisp
<Alfr> beach, that's when you want to check that you used everything you introduced. But does make sense when you want a warning for using *x* with that scope.
<Alfr> within*
<Alfr> ... and before you ask, no idea if it's actually used that way.
dnhester26 has quit [Ping timeout: 264 seconds]
<beach> SBCL gives a style warning for IGNORE declarations of special variables.
zxcvz has joined #commonlisp
<Alfr> ... guess that's a no.
<beach> Well, here is how I see it. Special variables have dynamic scope, but declarations have lexical scope. So if you do (let ((*x* 234)) (declare (ignore *x*)) (foo)), then you won't know whether FOO uses *x*.
<beach> So then what does it mean to not use *x* within its scope?
<beach> Should you be given a warning of FOO is inlined, but not if it is not?
<beach> *a warning if FOO...
<beach> So I think SBCL is doing the right thing here. Signal a style warning for free IGNORE and IGNORABLE declarations, and for IGNORE and IGNORABLE declarations of special variables.
<Alfr> beach, fine ... in (let ((foo 21)) (list (locally (declare (ignore foo)) foo) (* 2 foo))) I want a warning for the foo producing the first list element.
<Alfr> ... and I see that sbcl complains that the ignore is about a variable from "outer scope". xD
<beach> I see your point.
<Alfr> ... so doesn't work as envisioned.
<beach> Yes, SBCL could have used the proper term "a free declaration".
<Alfr> beach, and I don't know an answer to whether macros expanding to such should or should not trigger such a warning.
<beach> Yes, good question.
rogersm has quit [Remote host closed the connection]
easye has quit [Ping timeout: 268 seconds]
makomo has joined #commonlisp
ldb has quit [Quit: shoujo moving]
lucasta has quit [Remote host closed the connection]
robin has joined #commonlisp
Cymew has joined #commonlisp
traidare has quit [Ping timeout: 256 seconds]
ldb has joined #commonlisp
johnjaye has joined #commonlisp
danse-nr3 has quit [Ping timeout: 255 seconds]
yitzi has joined #commonlisp
supercode has quit [Quit: Client closed]
ldb has quit [Ping timeout: 252 seconds]
NicknameJohn has joined #commonlisp
AetherWind has joined #commonlisp
jmdaemon has joined #commonlisp
jmdaemon has quit [Ping timeout: 245 seconds]
Cymew has quit [Ping timeout: 264 seconds]
ldb has joined #commonlisp
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
dnhester26 has quit [Ping timeout: 252 seconds]
AndreiDuma has quit [Ping timeout: 264 seconds]
AndreiDuma has joined #commonlisp
traidare has joined #commonlisp
gaze_____ is now known as gaze__
a51 has quit [Quit: WeeChat 4.1.2]
jmdaemon has joined #commonlisp
ldb has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1)]
dnhester26 has joined #commonlisp
zxcvz has quit [Quit: zxcvz]
tyson2 has quit [Remote host closed the connection]
reb has joined #commonlisp
mgl_ has quit [Ping timeout: 255 seconds]
reb has quit [Ping timeout: 264 seconds]
reb has joined #commonlisp
msavoritias has joined #commonlisp
msavoritias has quit [Remote host closed the connection]
pranavats has left #commonlisp [Disconnected: Hibernating too long]
mzan has joined #commonlisp
NicknameJohn has quit [Ping timeout: 245 seconds]
a51 has joined #commonlisp
rogersm has joined #commonlisp
pranavats has joined #commonlisp
rogersm has quit [Remote host closed the connection]
rogersm has joined #commonlisp
NotThatRPG has quit [Ping timeout: 245 seconds]
rogersm has quit [Remote host closed the connection]
NotThatRPG has joined #commonlisp
cage has joined #commonlisp
jasom has joined #commonlisp
villageidiot has quit [Quit: Client closed]
tyson2 has joined #commonlisp
waleee has joined #commonlisp
reb has quit [Ping timeout: 268 seconds]
pranavats has left #commonlisp [Error from remote client]
bendersteed has quit [Quit: bendersteed]
ldb has joined #commonlisp
green__ has quit [Ping timeout: 260 seconds]
markb1 has quit [Ping timeout: 240 seconds]
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AndreiDuma has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
green_ has joined #commonlisp
green__ has joined #commonlisp
ec has quit [Ping timeout: 240 seconds]
mgl_ has joined #commonlisp
green_ has quit [Ping timeout: 255 seconds]
ec has joined #commonlisp
rogersm has joined #commonlisp
markb1 has joined #commonlisp
mgl_ has quit [Ping timeout: 260 seconds]
chomwitt has joined #commonlisp
anticrisis has joined #commonlisp
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
Eoco has quit [Ping timeout: 260 seconds]
anthk_ has quit [Ping timeout: 268 seconds]
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
Eoco has joined #commonlisp
varjag has joined #commonlisp
selwynning has joined #commonlisp
_cymew_ has quit [Ping timeout: 252 seconds]
selwynning is now known as selwon
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tyson2 has quit [Read error: Connection reset by peer]
Eoco has quit [Remote host closed the connection]
jmdaemon has quit [Ping timeout: 252 seconds]
Eoco has joined #commonlisp
donnodk has joined #commonlisp
pranavats has joined #commonlisp
kevingal has quit [Ping timeout: 268 seconds]
kevingal has joined #commonlisp
Eoco has quit [Remote host closed the connection]
Eoco has joined #commonlisp
attila_lendvai has joined #commonlisp
rogersm has quit [Remote host closed the connection]
rogersm has joined #commonlisp
triffid has quit [Remote host closed the connection]
Eoco has quit [Remote host closed the connection]
rogersm has quit [Ping timeout: 252 seconds]
Eoco has joined #commonlisp
yitzi has quit [Remote host closed the connection]
triffid has joined #commonlisp
AndreiDuma has joined #commonlisp
amb007 has joined #commonlisp
Eoco has quit [Remote host closed the connection]
Eoco has joined #commonlisp
st_aldini has joined #commonlisp
mgl_ has joined #commonlisp
Eoco has quit [Remote host closed the connection]
Eoco has joined #commonlisp
kevingal has quit [Ping timeout: 256 seconds]
kevingal has joined #commonlisp
ldb has quit [Quit: go home]
Eoco has quit [Ping timeout: 252 seconds]
Eoco has joined #commonlisp
villageidiot has joined #commonlisp
travis has quit [Quit: OS upgrade time]
varjag has quit [Ping timeout: 264 seconds]
ello has quit [Read error: Connection reset by peer]
cage has quit [Remote host closed the connection]
ello has joined #commonlisp
AetherWind has quit [Quit: leaving]
reb has joined #commonlisp
khrbtxyz has quit [Ping timeout: 256 seconds]
khrbtxyz has joined #commonlisp
AndreiDuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
traidare has quit [Ping timeout: 264 seconds]
chomwitt has quit [Ping timeout: 276 seconds]
decweb has quit [Ping timeout: 240 seconds]
reb has quit [Remote host closed the connection]
decweb has joined #commonlisp
tibfulv has quit [Remote host closed the connection]
mgl_ has quit [Ping timeout: 252 seconds]
tibfulv has joined #commonlisp
varjag has joined #commonlisp
attila_lendvai has quit [Ping timeout: 256 seconds]
bubblegum has quit [Ping timeout: 276 seconds]
rgherdt has quit [Ping timeout: 255 seconds]
scymtym has quit [Quit: Application exit]
bubblegum has joined #commonlisp
varjag has quit [Ping timeout: 252 seconds]
younder has quit [Remote host closed the connection]
younder has joined #commonlisp
rgherdt has joined #commonlisp
cdegroot has joined #commonlisp
NicknameJohn has joined #commonlisp
donnodk has quit [Ping timeout: 264 seconds]
NicknameJohn has quit [Ping timeout: 260 seconds]
cdegroot has quit [Ping timeout: 245 seconds]
shka has quit [Ping timeout: 264 seconds]
donleo has quit [Remote host closed the connection]
jmdaemon has joined #commonlisp