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/>
<hexology> is it not possible to implement the above using uninterned symbols? (not that you would or should)
<phoe> how do you pass these while calling the function?
<phoe> if you do (defun foo (&key ((#:really-private-api r))) (if r :secret :nothing)) then you have no way of passing that keyword without magic like (sb-introspect:function-lambda-list #'foo)
pve has quit [Quit: leaving]
Lycurgus has joined #commonlisp
Lycurgus has quit [Changing host]
Lycurgus has joined #commonlisp
seletz has joined #commonlisp
<semz> #.(defparameter *api-key* (gensym)) (defun foo (&key ((#.*api-key* r))) (if r :secret :nothing)) (foo '#.*api-key*)
<semz> don't forget to #.(setf *api-key* nil) after you're done :p
<semz> (foo '#.*api-key* 'bar) I mean
seletz has quit [Ping timeout: 260 seconds]
perrierjouet has quit [Quit: WeeChat 3.7.1]
perrierjouet has joined #commonlisp
random-nick has quit [Ping timeout: 260 seconds]
ym has quit [Ping timeout: 255 seconds]
waleee has quit [Ping timeout: 248 seconds]
waleee has joined #commonlisp
Lycurgus has quit [Quit: Exeunt https://tinyurl.com/4m8d4kd5]
Lycurgus has joined #commonlisp
emacs-dw` has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.2)]
emacs-dwim has joined #commonlisp
synaps3 has joined #commonlisp
Demosthenex has quit [Ping timeout: 260 seconds]
Demosthenex has joined #commonlisp
Lycurgus has quit [Quit: Exeunt https://tinyurl.com/4m8d4kd5]
notzmv has joined #commonlisp
seletz has joined #commonlisp
zacque has joined #commonlisp
seletz has quit [Ping timeout: 268 seconds]
causal has joined #commonlisp
tibfulv has quit [Remote host closed the connection]
tibfulv has joined #commonlisp
waleee has quit [Ping timeout: 265 seconds]
igemnace has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
ns12 has quit [Quit: Ping timeout (120 seconds)]
ns12 has joined #commonlisp
aartaka has joined #commonlisp
sloanr has joined #commonlisp
hrberg has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
hrberg has joined #commonlisp
gateway2000 has joined #commonlisp
_cymew_ has joined #commonlisp
aartaka has quit [Ping timeout: 265 seconds]
sloanr has quit [Remote host closed the connection]
aartaka has joined #commonlisp
_cymew_ has quit [Ping timeout: 256 seconds]
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 264 seconds]
zacque has quit [Remote host closed the connection]
edgar-rft has quit [Remote host closed the connection]
edgar-rft has joined #commonlisp
seletz has joined #commonlisp
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
rgherdt has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
varjag has joined #commonlisp
azimut has quit [Ping timeout: 255 seconds]
enzuru has quit [Quit: ZNC 1.8.2 - https://znc.in]
enzuru has joined #commonlisp
Cymew has joined #commonlisp
ttree has quit [Ping timeout: 260 seconds]
synaps3 has quit [Quit: Leaving]
son0p has quit [Ping timeout: 256 seconds]
aartaka has quit [Ping timeout: 268 seconds]
shka has joined #commonlisp
aartaka has joined #commonlisp
pve has joined #commonlisp
frgo has quit [Ping timeout: 260 seconds]
lisp123 has joined #commonlisp
<lisp123> what libraries exist for rendering text or drawing on a canvas for CL?
<jackdaniel> mcclim, vecto, adw-charts
lisp123 has quit [Read error: Connection reset by peer]
<Shinmera> Alloy, if the canvas is GL.
thuna` has joined #commonlisp
MajorBiscuit has joined #commonlisp
lisp123 has joined #commonlisp
<lisp123> Might check out Alloy
ebrasca has joined #commonlisp
random-nick has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life_ is now known as Lord_of_Life
makomo has quit [Quit: WeeChat 3.6]
lisp123 has quit [Ping timeout: 256 seconds]
aartaka has quit [Ping timeout: 260 seconds]
aartaka has joined #commonlisp
nij- has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
son0p has joined #commonlisp
easye has quit [Ping timeout: 256 seconds]
Inline has quit [Quit: Leaving]
<nij-> How to distinguish "unbound" and "bound to NIL" in plists or hts?
<beach> nij-: For a hash table, the second value returned by GETHASH indicates the difference.
<beach> clhs gethash
<beach> clhs getf
<beach> For GETF, you can pass a unique optional value and compare.
random-nick has quit [Ping timeout: 260 seconds]
<nij-> GETF is very weird. I guess I will use hash table more often.. thanks!
easye has joined #commonlisp
<beach> Pleasure.
<phoe> nij-: beach: the notes for clhs getf say, " There is no way (using getf) to distinguish an absent property from one whose value is default; but see get-properties."
<phoe> I never thought of using the unique default this way
<phoe> TIL, thanks
<nij-> unique default feels dangerous to use though
<phoe> a gensym should be enough, especially if ltv'd for performance
<beach> nij-: Why is that?
<nij-> beach unique default may show up as a value in the plist.
<beach> I usually do (LIST NIL) to get a unique value.
<beach> That can't show up in the plist.
<phoe> nij-: it's not unique then
<phoe> by definition
<beach> But if you already have one at hand that you know can't be in there, you can use it, like the value of *PACKAGE* or that of *STANDARD-OUTPUT*.
<nij-> (getf (list :a (list NIL)) :a (list NIL))
ym has joined #commonlisp
<nij-> (getf (list :b (list NIL)) :a (list NIL))
<nij-> Both return (NIL)..
<beach> But they are not EQL.
<phoe> (let* ((unique (gensym)) (value (getf place indicator unique)) (presentp (eql value unique))) (values (if presentp value nil) presentp))
Cymew has quit [Ping timeout: 268 seconds]
<nij-> Oh I see.
<nij-> And then you can write a wrapper for getf.
ym has quit [Ping timeout: 260 seconds]
easye has quit [Ping timeout: 265 seconds]
seletz has quit [Ping timeout: 268 seconds]
zacque has joined #commonlisp
ym has joined #commonlisp
nij- has quit [Remote host closed the connection]
larix has quit [Ping timeout: 268 seconds]
<Shinmera> I like to do #1='#:NO-VALUE and then #1# to eq test.
tevo has quit [Ping timeout: 252 seconds]
seletz has joined #commonlisp
<beach> That's good.
aartaka has quit [Ping timeout: 246 seconds]
<thuna`> Should the quote be inside or outside #1=?
aartaka has joined #commonlisp
<Josh_2> For this case I would normally just use a custom keyword, unless my hash/plist values were keywords ofc
<thuna`> Doesn't seem to matter
<Shinmera> If it's outside the #1= then you also need to put it outside #1#
<thuna`> I just wondered if two (quote #:NO-VALUE)s were guaranteed to return the same object
mzan has quit [Quit: No Ping reply in 180 seconds.]
<Shinmera> the #1# inserts the literally same object.
<thuna`> But that object, in the case of #1='#:NO-VALUE is the sexp (quote #:NO-VALUE)
<Shinmera> yea? and quote just returns that object.
<thuna`> Not necessarily the symbol returned by (quote #:NO-VALUE)
<Shinmera> why not
mzan has joined #commonlisp
<thuna`> ,(eq '#:NO-VALUE '#:NO-VALUE)
<Shinmera> #1# inserts literally the same expression, it is not read twice.
<Shinmera> and quote returns the literal expression
<thuna`> Ah, quote just returns it's argument and in #1=(quote #:NO-VALUE) #1# that argument is the same. My bad
<thuna`> s/it's/its
tevo has joined #commonlisp
<Shinmera> Right.
pranavats has left #commonlisp [Error from remote client]
seletz has quit [Ping timeout: 268 seconds]
jolby has joined #commonlisp
pranavats has joined #commonlisp
seletz has joined #commonlisp
jmdaemon has quit [Ping timeout: 256 seconds]
<pve> Hi, is it hideous to have simple tests inline with the code? I.e. (defun foo () ...) (define-test foo ... ), where the test emits a warning when the file is loaded if some check fails.
seletz has quit [Ping timeout: 248 seconds]
Mitpatral has joined #commonlisp
seletz has joined #commonlisp
attila_lendvai has joined #commonlisp
tyson2 has joined #commonlisp
ym has quit [Ping timeout: 248 seconds]
_cymew_ has joined #commonlisp
Cymew has joined #commonlisp
easye has joined #commonlisp
causal has quit [Ping timeout: 256 seconds]
seletz has quit [Ping timeout: 256 seconds]
jolby has quit [Quit: Client closed]
causal has joined #commonlisp
seletz has joined #commonlisp
Guest296 has joined #commonlisp
<semz> I don't think so, unless the tests take a long time to run.
lisp123 has joined #commonlisp
frgo has joined #commonlisp
ec_ has quit [Ping timeout: 255 seconds]
anticomputer has quit [Quit: quit]
anticomputer has joined #commonlisp
Cymew has quit [Ping timeout: 265 seconds]
ec_ has joined #commonlisp
varjag has quit [Quit: ERC (IRC client for Emacs 27.1)]
lisp123 has quit [Ping timeout: 260 seconds]
<sbenitezb> Input/critics for my configuration DSL please? https://gist.github.com/sbenitezb/87fcf4801759f0005651b408e0fe4a44
<sbenitezb> I'm interested more on ideas about style, using keywords vs symbols, implicit lists, etc.
Cymew has joined #commonlisp
<phoe> whichever style you choose, lispers will complain it's not suited to their taste
aartaka has quit [Ping timeout: 260 seconds]
Inline has joined #commonlisp
aartaka has joined #commonlisp
<sbenitezb> Thanks, I guess I'll keep it this way.
<pjb> sbenitezb: you could avoid keywords, by defining local functions and macros with macrolet and flet or labels.
<pjb> This way, you could write stuff like (loop for tag in (generate-my-tags) do (tag tag)) instead of (:tags static-tag-1 … static-tag-n) for example.
<pjb> sbenitezb: find another name than process. Process doesn't mean anything. All functions perform some process.
<Josh_2> keywords :heart:
<sbenitezb> pjb: interesting. I was looking at how Clozure implemented the LOOP macro. I like keywords because though
morganw has joined #commonlisp
<pjb> sbenitezb: yes, but you need to parse them specially (like special forms). It's easier if you can avoid that, and let lisp do the parsing and evaluating itself.
<Josh_2> defsystem uses keywords, defpackage uses keywords
<pjb> So if you can define your DSL as a set of macros and functions, it's better.
<sbenitezb> pjb: It's called a process because it configures a process (as in flow based programming process). I could name it anything, but I went with the typical name for FBP
<pjb> = easier to use.
<pjb> sbenitezb: then configure-process sounds a good name.
<sbenitezb> pjb: it actually defines a process, more than configures it (it includes lisp code that runs when the process is executed). I guess defprocess is another option
<sbenitezb> I also looked at defsystem and that's why I picked keywords
<pjb> one would expect a defprocess to be a macro, and to define a process at compilation time, in the toplevel.
ym has joined #commonlisp
<pjb> Use rather a make-process function to be able to generate different processes at run-time.
<pjb> see make-package, vs. defpackage.
aartaka has quit [Ping timeout: 248 seconds]
<sbenitezb> Thank you. I'll consider all options. Certainly everyone will have a different opinion, I do, so it's as difficult as naming any other thing :(
aartaka has joined #commonlisp
_cymew_ has quit [Quit: Konversation terminated!]
_cymew_ has joined #commonlisp
<pjb> sbenitezb: in general, if you can design first a set of functions to build an object (ie. a process configuration in your case), you can define macros later to make it simplier to write syntaxwise. But then you have functions that you can use at run-time when you need to generate computed stuff.
<pjb> The macros can expand to function calls.
<sbenitezb> Well this will certainly be compiled into the system, so more like a defprocess, wouldn't it?
<sbenitezb> Plus, I want to parse all those parameters and build structures, and other functions from it, so I guess a macro is better
aartaka has quit [Ping timeout: 256 seconds]
leeb has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
aartaka has joined #commonlisp
Mitpatral has quit []
zacque has quit [Remote host closed the connection]
attila_lendvai has quit [Quit: Leaving]
attila_lendvai has joined #commonlisp
Mitpatral has joined #commonlisp
notzmv has quit [Ping timeout: 260 seconds]
fitzsim has joined #commonlisp
Cymew has quit [Ping timeout: 248 seconds]
MajorBiscuit has quit [Ping timeout: 268 seconds]
azimut has joined #commonlisp
aartaka has quit [Ping timeout: 252 seconds]
Guest296 has quit [Quit: Client closed]
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 260 seconds]
morganw has quit [Remote host closed the connection]
aartaka has joined #commonlisp
seletz has quit [Ping timeout: 256 seconds]
<dbotton> Is there a practical time I would use eval-when unrelated to macros?
<jackdaniel> if you want to define constants in the same file, then a conforming common lisp program will have them in eval-when
<jackdaniel> sbcl treats defconstant specially, but that's not required by the standard (and in fact it fails on ccl)
<dbotton> (sorry I just want to make sure I understand) defconstant does not work in the same file (outside sbcl) if used in a defun for example? or just in code executing during compile time?
<Bike> defconstant isn't defined to make the constant available at compile time
<jackdaniel> the latter
<Bike> so if you want the constant to be available you need to use eval-when. but you might only want that for the sake of using it in macros
<jackdaniel> say you have (defconstant +foo+ 42) (defvar *foo* +foo+) ; +foo+ is not known for some implementations
<dbotton> wow
<Bike> that shouldn't be a warning, should it? even if the value isn't available the compiler should still known it'll be bound at runtime
<dbotton> defconstant is like evil everywhere
<jackdaniel> you are right, and I have confused things, sorry
<jackdaniel> yes, defvar should work just fine
<Bike> eval-when is also used in in-package and in in-readtable (in the named-readtables) library, and i guess that's not macro related
<Bike> (in the named-readtables library)
cage has joined #commonlisp
<dbotton> so what is a good example then where defconstant would fail at compile time?
random-nick has joined #commonlisp
<Bike> (defconstant +foo+ ...) (defmacro bar (...) (if (something +foo+) ...)) (defun baz ... (bar ...))
<Bike> the macroexpander wants +foo+ to actually be bound
<dbotton> I meant outside macros which seems to be the only real practical need for eval-when
<dbotton> for most of us
<jackdaniel> and there is also the thing that it is conforming for the implementation to expect, that each subsequent time defconstant is evaluated, values assigned are #'eql
<Bike> (defconstant +foo+ ...) (eval-when (:compile-toplevel ...) (something +foo+))
<Bike> macros are most of the reason for eval-when, practically speaking
<Bike> stuff that alters compiler state like in-readtable or declaim is another use
<dbotton> code applied to EVAL is considered compile-toplevel?
<Bike> what?
<dbotton> if I use eval to load/execute code, when eval is loading that code does it first compile at so satisfy :compile-toplevel?
<dbotton> (hope that is more clear)
<Bike> If you are calling eval, compile-toplevel is not involved
<dbotton> so that is only the case with compile-file?
<Bike> what eval-when (with compile-toplevel) does is tell the compiler to eval stuff. it wouldn't eval it otherwise.
<Bike> when you do (eval-when (:compile-toplevel) foo), the compiler will basically do (eval foo)
<dbotton> sorry, I am trying to understand - when is the case
<dbotton> when I use load from the REPL
<dbotton> when I use compile-file from the REPL
<dbotton> for example
<Bike> when you load a source file, only the eval-when with :execute will be evaluated
<dbotton> I know eval-when is more of a directive
<beach> In what way is EVAL-WHEN a "directive"?
<Bike> when you compile-file a file, the eval-when with compile-toplevel will be evaluated at compile time by the compiler
<NotThatRPG> EVAL-WHEN can be helpful around DEFPARAMETER
<NotThatRPG> I find I often want constants that can't be made with defconst
<dbotton> beach by evaluating only under certain circumstances, a directive to what ever is compiling/loading the file
<NotThatRPG> TBH, I think I have only once in my life used this w/o all three of the possible specifiers
<Bike> .
<Bike> oops
<dbotton> NotThatRPG the question was for non macro use if I am using a defparameter chances are it is because I want to use it in a macro
<NotThatRPG> dbotton: I have some other cases that arise in symbolic computation (theorem-provery things)
<NotThatRPG> With data structures that get compiled...
<NotThatRPG> Side question: Is there any documentation out there to tell me how to read an SBCL code-deletion-note? There's an IN prefix which I kinda get, but then there's a right arrow (==>) with a partial construct after it and I don't know how to parse that...
ec has joined #commonlisp
ec_ has quit [Ping timeout: 255 seconds]
<Bike> i think the ==> is just the fully macroexpanded context?
<NotThatRPG> Thanks, Bike ! It might be helpful for the manual to link to this from the description of the compiler warning classes. I will try to make a MR...
<NotThatRPG> Bike: it looks like it's the endpoint of the processing path? I'm going to make a paste, because this leaves me quite confused still
anticomputer has quit [Ping timeout: 255 seconds]
tyson2 has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
ttree has joined #commonlisp
<dbotton> NotThatRPG do you have a link to that code say in git I could see?
<dbotton> (github)
<Shinmera> pve: I don't like a library pulling it a testing framework just to use it.
<Shinmera> *pulling in
attila_lendvai has quit [Quit: Leaving]
<NotThatRPG> dbotton Bike : I put it up here https://pastebin.com/UcXB3gU1
attila_lendvai has joined #commonlisp
<NotThatRPG> (The git repo is in a very transient (i.e., bad) state as I debug this
<Bike> sbcl code deletion notes are unfortunately pretty hard to understand all the time
<NotThatRPG> They often hide interesting facts about my code, though.
attila_lendvai has quit [Read error: Connection reset by peer]
<Bike> yeah, that's why it's unfrtunate :(
<jackdaniel> pay them back and make your code harder to read
attila_lendvai has joined #commonlisp
<NotThatRPG> I'm not even sure what it would mean for SBCL to decide that an argument variable can be deleted.
<NotThatRPG> Hm. There's a macro there (this is not my code) which explains it...
<NotThatRPG> Here's the solution to the riddle: https://pastebin.com/UcXB3gU1
attila_lendvai has quit [Quit: Leaving]
attila_lendvai has joined #commonlisp
attila_lendvai has quit [Remote host closed the connection]
attila_lendvai has joined #commonlisp
<Bike> i see
<Bike> sbcl definitely did not communicate that very well
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
varjag has joined #commonlisp
<NotThatRPG> Bike: I guess it would be nice if SBCL could tell me that it's compiling away an unreachable branch. But I don't know how hard that would be to do
<Bike> i think it would require some reorganizaation of how the compiler works. i have thought about how to do it in cleavir but haven't coded anything yet.
sedzcat has joined #commonlisp
Mitpatral has quit [Quit: Connection closed for inactivity]
ebrasca has quit [Remote host closed the connection]
son0p has quit [Ping timeout: 246 seconds]
terrorjack has quit [Ping timeout: 256 seconds]
terrorjack has joined #commonlisp
aartaka has quit [Ping timeout: 268 seconds]
prokhor has joined #commonlisp
_cymew_ has quit [Ping timeout: 260 seconds]
<pve> Shinmera: Yeah, fair point.
makomo has joined #commonlisp
son0p has joined #commonlisp
sedzcat has quit [Quit: sedzcat]
thuna` has quit [Remote host closed the connection]
ec has quit [Ping timeout: 255 seconds]
ec has joined #commonlisp
Lycurgus has joined #commonlisp
Lycurgus has quit [Quit: Exeunt https://tinyurl.com/4m8d4kd5]
attila_lendvai has quit [Ping timeout: 260 seconds]
_cymew_ has joined #commonlisp
<varjag> copilot has no concept of alists
<varjag> probably because its vocabulary is mapped from more popular languages
sloanr has joined #commonlisp
enzuru has quit [Ping timeout: 268 seconds]
sbenitezb1 has quit [Ping timeout: 260 seconds]
anddam has quit [Quit: WeeChat 3.7.1]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
Inline has quit [Quit: Leaving]
_cymew_ has quit [Ping timeout: 252 seconds]
anddam has joined #commonlisp
ec_ has joined #commonlisp
ec has quit [Ping timeout: 255 seconds]
waleee has joined #commonlisp
anddam has quit [Quit: WeeChat 3.7.1]
lisp123 has joined #commonlisp
jmdaemon has joined #commonlisp
akoana has joined #commonlisp
waleee has quit [Ping timeout: 246 seconds]
Brucio-61 has quit [Read error: Connection reset by peer]
Brucio-61 has joined #commonlisp
scymtym has quit [Ping timeout: 264 seconds]
scymtym has joined #commonlisp
Patternmaster has quit [Ping timeout: 264 seconds]
Patternmaster has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
waleee has joined #commonlisp
lisp123 has quit [Read error: Connection reset by peer]
rgherdt has quit [Read error: Connection reset by peer]
rgherdt_ has joined #commonlisp
Brucio-61 has quit [Ping timeout: 260 seconds]
igemnace has quit [Remote host closed the connection]
scymtym has quit [Ping timeout: 268 seconds]
Brucio-61 has joined #commonlisp
anddam has joined #commonlisp
anddam has quit [Client Quit]
anddam has joined #commonlisp
waleee has quit [Ping timeout: 264 seconds]
waleee has joined #commonlisp
rgherdt_ has quit [Remote host closed the connection]
dra has joined #commonlisp
dra has joined #commonlisp
dra has quit [Changing host]
shka has quit [Ping timeout: 248 seconds]
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
varjag has quit [Quit: ERC 5.4.1 (IRC client for GNU Emacs 29.0.50)]
waleee has quit [Ping timeout: 264 seconds]
akoana has quit [Quit: leaving]
genpaku has quit [Remote host closed the connection]
genpaku has joined #commonlisp
dipper has joined #commonlisp
pve has quit [Quit: leaving]
waleee has joined #commonlisp
dra has quit [Remote host closed the connection]
Bike has quit [Remote host closed the connection]
ym has quit [Ping timeout: 248 seconds]
attila_lendvai has joined #commonlisp