Xach 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/>
Bike has joined #lisp
luna_is_here has quit [Ping timeout: 240 seconds]
Bike has quit [Client Quit]
Bike has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
kajo has joined #lisp
manjaro-user- has joined #lisp
manjaro-user- has quit [Quit: Konversation terminated!]
gioyik has quit [Ping timeout: 260 seconds]
<copec> ^ Is that guy on IRC?
<Xach> copec: i don't think so
mister_m` is now known as mister_m
<copec> I've used his inlined generic function library before, I remember that name
abhixec has quit [Ping timeout: 265 seconds]
patlv has joined #lisp
notzmv has quit [Remote host closed the connection]
patlv has quit [Ping timeout: 268 seconds]
buffergn0me has joined #lisp
__jrjsmrtn__ has joined #lisp
_jrjsmrtn has quit [Ping timeout: 258 seconds]
terpri has joined #lisp
torbo has joined #lisp
EvW has quit [Ping timeout: 248 seconds]
gioyik has joined #lisp
notzmv has joined #lisp
bitmapper has quit [Ping timeout: 260 seconds]
wiselord has joined #lisp
wsinatra has joined #lisp
malfort has quit [Ping timeout: 268 seconds]
wiselord has quit [Ping timeout: 265 seconds]
gioyik_ has joined #lisp
gioyik has quit [Ping timeout: 260 seconds]
ebzzry_ has joined #lisp
wsinatra has quit [Quit: WeeChat 2.7]
wsinatra has joined #lisp
wsinatra has quit [Quit: WeeChat 2.7]
wsinatra has joined #lisp
Lord_of_Life has joined #lisp
ahungry has joined #lisp
wsinatra has quit [Quit: WeeChat 2.7]
wsinatra has joined #lisp
smokeink has joined #lisp
Guest75462 has joined #lisp
Guest75462 has quit [Changing host]
Guest75462 has joined #lisp
Guest75462 is now known as nitrix
wsinatra has quit [Client Quit]
pfdietz has quit [Remote host closed the connection]
ahungry` has joined #lisp
orivej has joined #lisp
ahungry has quit [Ping timeout: 260 seconds]
shifty has quit [Ping timeout: 258 seconds]
enrio has joined #lisp
gioyik_ has quit [Ping timeout: 258 seconds]
clothespin__ has joined #lisp
clothespin has quit [Ping timeout: 252 seconds]
jeosol has joined #lisp
lavaflow_ is now known as lavaflow
notzmv has quit [Remote host closed the connection]
torbo has quit [Remote host closed the connection]
notzmv has joined #lisp
_whitelogger has joined #lisp
patlv has joined #lisp
jeosol has quit [Remote host closed the connection]
patlv has quit [Client Quit]
Bike has quit [Quit: Lost terminal]
<beach> Good morning everyone!
<ebrasca> Good morning beach!
gravicappa has joined #lisp
jeosol has joined #lisp
enrioog has joined #lisp
enrio has quit [Ping timeout: 268 seconds]
notzmv has quit [Ping timeout: 268 seconds]
notzmv has joined #lisp
anunnaki has joined #lisp
isBEKaml has joined #lisp
isBEKaml has left #lisp [#lisp]
epony has quit [Quit: QUIT]
_whitelogger has joined #lisp
enrioog has quit [Ping timeout: 268 seconds]
jurov has quit [Ping timeout: 260 seconds]
jurov has joined #lisp
aeth has quit [Ping timeout: 265 seconds]
ggole has joined #lisp
Intensity has quit [*.net *.split]
tokik_ has quit [Quit: leaving]
tokik has joined #lisp
Intensity has joined #lisp
epony has joined #lisp
vs1 has joined #lisp
ahungry` has quit [Ping timeout: 260 seconds]
Inline has quit [Quit: Leaving]
ahungry` has joined #lisp
isBEKaml has joined #lisp
ahungry` has quit [Ping timeout: 260 seconds]
q-u-a-n2 has quit [Remote host closed the connection]
amerlyq has joined #lisp
q-u-a-n2 has joined #lisp
vs1 has quit [Ping timeout: 265 seconds]
aeth has joined #lisp
oxum has quit [Remote host closed the connection]
shunter has joined #lisp
nirved has quit [Read error: Connection reset by peer]
buffergn0me has quit [Ping timeout: 248 seconds]
buffergn0me has joined #lisp
enrio has joined #lisp
ahungry`` has joined #lisp
epony has quit [Quit: QUIT]
ahungry`` has quit [Remote host closed the connection]
shifty has joined #lisp
epony has joined #lisp
ahungry has joined #lisp
oxum has joined #lisp
brettgilio has quit [Read error: Connection reset by peer]
brettgilio has joined #lisp
oxum_ has joined #lisp
oxum_ has quit [Remote host closed the connection]
oxum_ has joined #lisp
oxum has quit [Read error: Connection reset by peer]
vlatkoB has joined #lisp
enrio has quit [Read error: Connection reset by peer]
enrio has joined #lisp
dddddd has quit [Ping timeout: 268 seconds]
MidAutumnMoon has quit [Quit: Ping timeout (120 seconds)]
orivej has quit [Ping timeout: 258 seconds]
MidAutumnMoon has joined #lisp
ahungry has quit [Remote host closed the connection]
oxum has joined #lisp
loskutak has joined #lisp
rippa has joined #lisp
oxum_ has quit [Ping timeout: 268 seconds]
oxum__ has joined #lisp
oxum_ has joined #lisp
oxum has quit [Ping timeout: 258 seconds]
oxum_ has quit [Remote host closed the connection]
oxum__ has quit [Ping timeout: 265 seconds]
Necktwi has quit [Quit: leaving]
shangul has joined #lisp
Necktwi has joined #lisp
oxum has joined #lisp
scymtym has quit [Ping timeout: 260 seconds]
oxum has quit [Remote host closed the connection]
enrio has quit [Ping timeout: 265 seconds]
oxum has joined #lisp
jprajzne has joined #lisp
Cymew has joined #lisp
enrio has joined #lisp
oxum has quit [Remote host closed the connection]
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
oxum has joined #lisp
stux|RC has quit [Ping timeout: 258 seconds]
nirved has joined #lisp
clothespin__ has quit [Ping timeout: 265 seconds]
terpri has quit [Ping timeout: 260 seconds]
scymtym has joined #lisp
buffergn0me has quit [Quit: ERC (IRC client for Emacs 26.2)]
varjag has joined #lisp
stux|RC has joined #lisp
slyrus_ has joined #lisp
slyrus__ has quit [Ping timeout: 268 seconds]
enrio has quit [Ping timeout: 268 seconds]
oxum_ has joined #lisp
oxum__ has joined #lisp
oxum has quit [Read error: Connection reset by peer]
oxum_ has quit [Ping timeout: 258 seconds]
amerigo has joined #lisp
hhdave has joined #lisp
<boeg> hi
je4i has joined #lisp
ggole has quit [Read error: Connection reset by peer]
ggole has joined #lisp
<no-defun-allowed> Hello boeg
loskutak has quit [Ping timeout: 260 seconds]
vs has joined #lisp
<phoe> heyyy
<no-defun-allowed> Hello phoe
frgo has quit [Remote host closed the connection]
brown121408 has quit [Ping timeout: 240 seconds]
brown121408 has joined #lisp
rgherdt has joined #lisp
nirved has quit [Quit: Leaving]
rgherdt has left #lisp [#lisp]
epony has quit [Quit: reconf]
nirved has joined #lisp
epony has joined #lisp
je4i has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
brown121408 has quit [Read error: Connection reset by peer]
brown121408 has joined #lisp
frgo has joined #lisp
frgo has quit [Read error: Connection reset by peer]
frgo has joined #lisp
ft has quit [Ping timeout: 265 seconds]
loskutak has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
fanta1 has joined #lisp
brettgilio has quit [Ping timeout: 260 seconds]
space_otter has quit [Remote host closed the connection]
dale has quit [Quit: My computer has gone to sleep]
dilated_dinosaur has quit [Remote host closed the connection]
libertyp1ime has joined #lisp
raghavgururajan has joined #lisp
libertyp1ime has quit [Client Quit]
hostile has joined #lisp
pilne has quit [Quit: Some folks are wise, and some otherwise.]
earl-ducaine has quit [Ping timeout: 268 seconds]
earl-ducaine has joined #lisp
cosimone has joined #lisp
cosimone has quit [Client Quit]
cosimone has joined #lisp
nitrix has quit [Read error: Connection reset by peer]
nitrix has joined #lisp
nitrix is now known as Guest5293
je4i has joined #lisp
<flip214> I'm seeking opinions regarding https://github.com/phmarek/hunchentoot/commit/4910a6041784d2a2db4d8087a02cd09c9c31f44d - any feedback is welcome.
atgreen has joined #lisp
xkapastel has joined #lisp
vs has quit [Ping timeout: 260 seconds]
ralt has joined #lisp
hostile has quit [Quit: Leaving]
earl-ducaine_ has joined #lisp
earl-ducaine has quit [Ping timeout: 268 seconds]
frgo has quit [Remote host closed the connection]
[df] has quit [Read error: Connection reset by peer]
ft has joined #lisp
[df] has joined #lisp
loskutak has quit [Ping timeout: 245 seconds]
<beach> flip214: I recommend using genitive 's only for proper names. If you write "the suffix of the file" instead of "the file's suffix", you get the additional advantage that the important word (i.e. "suffix") comes first.
jkvl has joined #lisp
<beach> flip214: I also suggest you follow the recommendations on page 13 of the LUV slides.
<beach> In your case, it means not using CALLBACK as a Boolean, and using a WHEN/UNLESS rather than a one-legged IF.
notzmv has quit [Remote host closed the connection]
<beach> flip214: It also looks like indentation is wrong in several places. (header-out...) and (decf bytes-to-send...) for instance.
slyrus__ has joined #lisp
libertyp1ime has joined #lisp
slyrus_ has quit [Ping timeout: 258 seconds]
rippa has quit [Read error: Connection reset by peer]
libertyp1ime has quit [Client Quit]
frgo has joined #lisp
libertyprime has quit [Remote host closed the connection]
jonatack has quit [Ping timeout: 248 seconds]
frgo_ has joined #lisp
frgo has quit [Ping timeout: 265 seconds]
raghavgururajan has quit [Remote host closed the connection]
frgo_ has quit [Ping timeout: 258 seconds]
<_death> maybe choose a more specific name for the callback.. and in this case I would consider just adding it as another optional
cosimone has quit [Quit: Terminated!]
notzmv has joined #lisp
<_death> beach: the indentation is not wrong, it's just different chunks of the diff
epony has quit [Quit: QUIT]
<flip214> beach: thanks! I hoped for _technical_ feedback, TBH
<flip214> _death: thanks as well! you think just having a second &optional is cleaner? How about a third one, then, etc.?
<flip214> No idea whether that will come up, though
<flip214> beach: which LUV slides?
noobineer1 has joined #lisp
<_death> flip214: right, but you already have 1 optional and need to maintain backwards compatibility
noobineer has quit [Read error: Connection reset by peer]
shangul has quit [Remote host closed the connection]
shifty has quit [Remote host closed the connection]
shangul has joined #lisp
<_death> there are other ways to add this functionality.. e.g., instead of callback provide additional headers.. or add hooks
shifty has joined #lisp
<flip214> hmmm... for only a second argument &optional might be okay... if more comes up later, having another function with &key might be better
<flip214> and a callback means that authorization can be done as well; more flexible than just a list of headers to send
<flip214> thanks a lot!
<_death> another thing to think about is that the user can supply a pathname and a content-type, but the callback is called just with the pathname, so if it wants to dispatch based on content-type as well it needs to find it out using another way (the content-type function).. may not be a big deal, but another indicator of ad-hociness
<flip214> yeah, right. I'll pass that in as well.
<flip214> beach: how would I _not_ use CALLBACK as a boolean? I need to check whether one was passed, right?
<_death> maybe hooks would be a better approach.. it'll mean a larger change
<_death> flip214: you could have it default to a noop function
<flip214> beach: ah, I guess you mean using a callback-given-p, right? But that breaks as soon as some function or macro just relays an incoming NIL value...
<_death> (my preference is that nil be treated as a noop, though)
<flip214> _death: yeah, but I'm not sure that's faster - and it breaks for functions just relaying their parameters
<_death> right
bitmapper has joined #lisp
epony has joined #lisp
frgo has joined #lisp
frgo has quit [Ping timeout: 268 seconds]
smokeink has quit [Ping timeout: 265 seconds]
bitmapper has quit [Remote host closed the connection]
random-nick has joined #lisp
oxum has joined #lisp
oxum__ has quit [Ping timeout: 258 seconds]
<flip214> which of the 5 different CSV libraries in QL is the "best"? Any opinions?
oxum has quit [Ping timeout: 260 seconds]
bitmapper has joined #lisp
<_death> I would guess cl-csv is the most complete one
shifty has quit [Ping timeout: 268 seconds]
shifty has joined #lisp
oxum has joined #lisp
<flip214> thanks
<Xach> flip214: there is a comparison report, i think!
<flip214> Xach: thanks!
<flip214> https://cliki.net/csv should be updated, but my user is no longer valid?!
atgreen has quit [Ping timeout: 258 seconds]
<beach> flip214: callback is not a Boolean, it is a variable with a default value of NIL.
<beach> flip214: When you write (IF CALLBACK, you use it as a Boolean.
<beach> When you write (IF (NULL CALLBACK), the Boolean is (NULL CALLBACK) which tests whether CALLBACK has its default value.
<beach> In this case, since you have a one-legged IF, you can write (UNLESS (NULL CALLBACK) (FUNCALL CALLBACK PATHNAME))
<beach> Which means "unless the variable CALLBACK happens to have its default value (which is not a function), call it with PATHNAME as its argument".
<beach> Whereas (IF CALLBACK (FUNCALL CALLBACK PATHNAME)) means "if the Boolean variable CALLBACK happens to be true, then call that Boolean value ...".
<beach> _death: Ah, yes, I see what you mean about the indentation.
ebrasca has quit [Read error: Connection reset by peer]
ebrasca has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
lukego has quit [Quit: Connection closed for inactivity]
rippa has joined #lisp
<flip214> beach: ack, thanks! will fix that.
jonatack has joined #lisp
earl-ducaine_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
earl-ducaine has joined #lisp
loskutak has joined #lisp
lucasb has joined #lisp
davsebam1e has joined #lisp
clothespin has joined #lisp
Lycurgus has joined #lisp
davsebamse has quit [Ping timeout: 268 seconds]
atgreen has joined #lisp
frgo has joined #lisp
fanta1 has quit [Quit: fanta1]
pjb has quit [Read error: Connection reset by peer]
pjb has joined #lisp
loskutak has quit [Quit: WeeChat 2.6]
je4i has quit [Read error: Connection reset by peer]
je4i has joined #lisp
LiamH has joined #lisp
Bike has joined #lisp
enrio has joined #lisp
Lord_of_Life_ has joined #lisp
EvW has joined #lisp
pfdietz has joined #lisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life_ is now known as Lord_of_Life
isBEKaml has quit [Quit: leaving]
william1_ has joined #lisp
earl-ducaine has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
fookara has joined #lisp
wsinatra has joined #lisp
je4i has quit [Remote host closed the connection]
je4i has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
sjl_ has joined #lisp
<reepca> Is it acceptable to have a pathname with a nil NAME (according to the spec, anyway)? I wanna have a list of "search paths" I can use merge-pathnames with to test whether a file is under a given directory, but it only seems to have the desired effect when NAME is nil and instead the last element of DIRECTORY.
Cymew has quit [Quit: Konversation terminated!]
ralt has quit [Quit: Connection closed for inactivity]
luna_is_here has joined #lisp
<p_l> i think it's supposed to operate just like that, might need to take a look again
vs has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
<reepca> I'm somewhat uncertain because uiop:getenv-pathnames keeps spitting out pathnames with a non-nil NAME component, which would seem to be contrary to what I assume is its purpose of "handling search path environment variables".
wsinatra has quit [Quit: WeeChat 2.7]
orivej has joined #lisp
<flip214> reepca: there's a difference between PATH/ and PATH - the former is a directory, the latter the entry in the parent directory.
Lycurgus has quit [Quit: Exeunt]
AnimalClatter has joined #lisp
<scymtym> reepca: (uiop:getenv-pathnames "NAME" :ensure-directory t) seems to do that. there is also UIOP:GETENV-ABSOLUTE-DIRECTORIES if you don't mind the absolute part
pjb has quit [Ping timeout: 248 seconds]
<reepca> scymtym: ooh, thanks. I guess I didn't see that parameter since it's just lumped in with "constraints" in my minibuffer
dddddd has joined #lisp
je4i has quit [Remote host closed the connection]
kajo has quit [Ping timeout: 246 seconds]
hostile has joined #lisp
<pfdietz> ASDF package inferred systems should understand package local nicknames entries in defpackage.
jonatack has quit [Ping timeout: 260 seconds]
EvW has quit [Ping timeout: 260 seconds]
shka__ has quit [Ping timeout: 265 seconds]
jmercouris has joined #lisp
<jmercouris> I feel like I'm doing something seriously wrong because I'm going through a list of objects and doing an operation based on their type
<Bike> change it to mapc with a generic function?
<jmercouris> I would make a method for each object
<jmercouris> however it is unfortunate that what each object should do depends on the method...
<jmercouris> it's like a double combination
<Bike> i do not understand
pjb has joined #lisp
<jmercouris> OK, let me re-explain
<jmercouris> I have four methods that each go through a list of objects
<jmercouris> in each of those four methods, what each object does is different
<jmercouris> you know what, that's fine
<jmercouris> I will do that
asdf_asdf_asdf has joined #lisp
<beach> Wow!. Hold on. Objects don't do anything.
<jmercouris> Ah, yes
william1_ has quit [Ping timeout: 258 seconds]
<jmercouris> let me make it very concrete and see if there is a better approach here, give me a second to write it out
<jmercouris> I have a list of objects, buttons and links. I have two functions "open-in-new-tab" "copy-url". In "open-in-new-tab" when I get a link object I want to do action A. In "open-in-new-tab" when I get a button object I want to do action B. In "copy-url" when I have a link I want to do action C. In "copy-url" when I have a button I want do action D.
jprajzne has quit [Quit: Leaving.]
<jackdaniel> define a method specialized on both action and object
<beach> Might not be worthwhile.
<jackdaniel> having "a method for each object" doesn't make much sense. you may have a slot in each object to store its function if you really want to have a separate function for each object.
<dlowe> I'm confused, this just sounds like two generic functions with two methods each
<jmercouris> dlowe: yes
<jmercouris> IF I could specialize on a function
<jmercouris> is this possible?
asdf_asdf_asdf has quit [Remote host closed the connection]
<dlowe> you can specialize on a symbol
<dlowe> you have a list of functions too?
<jmercouris> I don't have a list of functions, no
<dlowe> you want (defun open-in-new-tab (list) (mapc 'dwim-open-in-new-tab list))?
gaqwas has quit [Quit: Leaving]
<jmercouris> OK, I will define four defgenerics, one for each function (in my original problem)
<jmercouris> that is the most logical I think
<jmercouris> time will tell of course, but that makes sense, thank you all
smazga has joined #lisp
clothespin has quit [Ping timeout: 260 seconds]
wsinatra has joined #lisp
brettgilio has joined #lisp
asdf_asdf_asdf has joined #lisp
Guest5293 has quit [Changing host]
Guest5293 has joined #lisp
Guest5293 is now known as nitrix
jmercouris has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
bitmapper has quit [Ping timeout: 260 seconds]
kajo has joined #lisp
william1_ has joined #lisp
jkvl has quit [Quit: WeeChat 2.6]
enrio has quit [Read error: Connection reset by peer]
jonatack has joined #lisp
je4i has joined #lisp
<reepca> in CASE, does the OTHERWISE symbol have to be in the COMMON-LISP package? Apparently using a keyword doesn't work there...
<reepca> oh huh, apparently there's more distinction between symbols and keywords than just "one is in the keywords package" I guess?
<pfdietz> Yes, it must be that specific symbol.
<pfdietz> Not a different symbol for which SYMBOL-NAME is STRING=.
hhdave has quit [Quit: hhdave]
<pfdietz> There are very few places in standard CL that allow one to use any symbol with the same symbol-name, rather than some specific symbol.
<pfdietz> LOOP is one.
william1_ has quit [Ping timeout: 260 seconds]
khisanth_ has quit [Ping timeout: 265 seconds]
gareppa has joined #lisp
Lycurgus has joined #lisp
je4i has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
lavaflow has quit [Ping timeout: 268 seconds]
khisanth_ has joined #lisp
jfb4 has joined #lisp
jfb4_ has quit [Ping timeout: 268 seconds]
bitmapper has joined #lisp
Lycurgus has quit [Quit: Exeunt]
sjl_ has quit [Quit: WeeChat 2.3-dev]
jfb4_ has joined #lisp
jfb4 has quit [Ping timeout: 240 seconds]
Kundry_Wag has joined #lisp
clothespin_ has joined #lisp
AnimalClatter has quit [Ping timeout: 268 seconds]
Kundry_W_ has joined #lisp
Kundry_Wag has quit [Read error: Connection reset by peer]
Kundry_W_ has quit [Remote host closed the connection]
phoe has quit [Ping timeout: 250 seconds]
Kundry_W_ has joined #lisp
phoe has joined #lisp
Kundry_W_ has quit [Remote host closed the connection]
william1_ has joined #lisp
clothespin_ has quit [Ping timeout: 268 seconds]
X-Scale has quit [Ping timeout: 268 seconds]
Kundry_Wag has joined #lisp
EvW1 has joined #lisp
madage has quit [Quit: leaving]
asdf_asdf_asdf has quit [Remote host closed the connection]
X-Scale has joined #lisp
orivej has quit [Ping timeout: 268 seconds]
je4i has joined #lisp
malfort has joined #lisp
william1_ has quit [Ping timeout: 258 seconds]
malfort has quit [Client Quit]
malfort has joined #lisp
gareppa has quit [Quit: Leaving]
je4i has quit [Ping timeout: 264 seconds]
AnimalClatter has joined #lisp
je4i has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Lycurgus has joined #lisp
asdf_asdf_asdf has joined #lisp
AnimalClatter has quit [Ping timeout: 258 seconds]
je4i has quit [Read error: No route to host]
clothespin_ has joined #lisp
je4i has joined #lisp
Kundry_Wag has joined #lisp
Irenes[m] is now known as Guest13147
jfb4_ has quit [Ping timeout: 260 seconds]
jfb4 has joined #lisp
DGASAU has quit [Read error: Connection reset by peer]
je4i` has joined #lisp
amerlyq has quit [Quit: amerlyq]
clothespin_ has quit [Ping timeout: 260 seconds]
efm has quit [Ping timeout: 260 seconds]
efm_ has joined #lisp
je4i has quit [Ping timeout: 264 seconds]
Lycurgus has quit [Quit: https://meansofproduction.biz Exit Quassel.]
Guest13147 has quit [Quit: issued !quit command]
brown121408 has quit [Ping timeout: 258 seconds]
orivej has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
brown121407 has joined #lisp
Irenes[m] has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
vlatkoB has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
vlatkoB has joined #lisp
efm_ has quit [Quit: Konversation terminated!]
EvW1 has quit [Ping timeout: 250 seconds]
vlatkoB has quit [Remote host closed the connection]
clothespin_ has joined #lisp
vlatkoB has joined #lisp
vlatkoB has quit [Client Quit]
<shangul> Sorry that I have forgotten this but how should I indicate empty list? nil? 'nil? ()? '()?
<pfdietz> No need to quote it, it evaluates to itself.
<pfdietz> NIL and () read as exactly the same thing, so whichever you prefer.
<pfdietz> (and nil and NIL, for that matter)
<pfdietz> Style varies, depending on where it's used.
<pfdietz> It would be weird to write (defun nil ...) for a nullary function.
<pfdietz> But nil is often used in code as a value.
<pfdietz> You may notice the printer may use one or other depending on context.
DGASAU has joined #lisp
guaqua has quit [Ping timeout: 245 seconds]
varjag has joined #lisp
sauvin has quit [Ping timeout: 265 seconds]
Kundry_Wag has quit [Read error: Connection reset by peer]
Kundry_W_ has joined #lisp
guaqua has joined #lisp
didi has joined #lisp
william1_ has joined #lisp
madage has joined #lisp
bitmapper has quit [Ping timeout: 268 seconds]
<didi> How do I make a struct if it has no constructor function, as in (defstruct (foo (:constructor)))?
bitmapper has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
nirved has quit [Ping timeout: 252 seconds]
fookara has quit [Remote host closed the connection]
<asdf_asdf_asdf> didi hi. I don't understand.
<didi> asdf_asdf_asdf: Suppose you define a struct as (defstruct (foo (:constructor))). Now, how do you make a struct foo?
<dlowe> defstruct creates a make-foo function
<dlowe> as well as all the foo-field functions
<didi> dlowe: Even if I tell it not to?
nirved has joined #lisp
<didi> Maybe it should be (defstruct (foo (:constructor nil))).
<pfdietz> You can force defstruct to make no constructors.
<Bike> :constructor nil tells it not to, yes
<didi> Right right.
<didi> Then, how do I make foo?
<dlowe> oh. well, I don't think you do
<didi> dlowe: oic
<pfdietz> That makes sense if you are defining a "base" struct that will only be used as a supertype of structs that include it, or if it's not a struct-struct but rather one using lists or vectors.
<pfdietz> You can define constructors for those child types.
<didi> pfdietz: I see.
<pfdietz> Think of the constructor-less one as an abstract base class.
AnimalClatter has joined #lisp
<pfdietz> While you're in that neighborhood, look up BOA constructors, admire the pun, and then look at things you can do with BOA lambda lists.
AnimalClatter has quit [Ping timeout: 258 seconds]
<asdf_asdf_asdf> Is fashion to append new data to created structure (defstruct)?
buffergn0me has joined #lisp
ggole has quit [Quit: Leaving]
<Bike> what the what?
<asdf_asdf_asdf> (defstruct ship (a "hello")) ; And now I have append (b "world") to this structure.
<asdf_asdf_asdf> I want after modification it (defstruct ship (a "hello") (b "world")).
william1_ has quit [Ping timeout: 265 seconds]
william1_ has joined #lisp
<buffergn0me> asdf_asdf_asdf: classes can do that
<asdf_asdf_asdf> (append-to-ship (b "world")) ;?
<buffergn0me> asdf_asdf_asdf: DEFCLASS will add new slots to existing objects and give them proper default values
<asdf_asdf_asdf> Thank, but on only (defstruct... is it not possible?
scymtym has quit [Ping timeout: 248 seconds]
MichaelRaskin has joined #lisp
<buffergn0me> asdf_asdf_asdf: "The consequences of redefining a defstruct structure are undefined." http://www.lispworks.com/documentation/lw70/CLHS/Body/m_defstr.htm
<buffergn0me> asdf_asdf_asdf: Structures are low overhead and very efficient, but they are missing a lot of nice features that classes have.
malfort has quit [Read error: Connection reset by peer]
<buffergn0me> asdf_asdf_asdf: Structures are in mostly equivalent to single-inheritance classes in most object-oriented languages.
malfort has joined #lisp
pilne has joined #lisp
hostile has quit [Quit: Leaving]
<asdf_asdf_asdf> How add new slot to existing objects?
malfort has left #lisp ["Leaving"]
<Xach> asdf_asdf_asdf: evaluate a new defclass form
brown121407 has quit [Read error: Connection reset by peer]
<asdf_asdf_asdf> Sorry, I don't know.
brown121408 has joined #lisp
MightyJoe has quit [Ping timeout: 245 seconds]
cyraxjoe has joined #lisp
<buffergn0me> asdf_asdf_asdf: (defclass apple () ((color :initform 'red))) then (defclass apple () ((color :initform 'red) (weight :initform 2)))
<buffergn0me> asdf_asdf_asdf: All apple objects will be updated
<asdf_asdf_asdf> Is there any other way?
<phoe> asdf_asdf_asdf: not really, unless you want to dive into system internals
william1_ has quit [Ping timeout: 258 seconds]
luna_is_here has quit [Ping timeout: 240 seconds]
william1_ has joined #lisp
<asdf_asdf_asdf> OK. Thank You for described. (defstruct..., not be define again, but (defclass can, thanks.
<_death> (defclass fine-apple (apple) ((owner :initform 'idunn))) (change-class an-apple 'fine-apple)
space_otter has joined #lisp
ebrasca has quit [Remote host closed the connection]
clothespin_ has quit [Ping timeout: 258 seconds]
orivej has quit [Ping timeout: 260 seconds]
dale_ has joined #lisp
dale_ is now known as dale
AnimalClatter has joined #lisp
clothespin has joined #lisp
je4i` has quit [Remote host closed the connection]
AnimalClatter has quit [Ping timeout: 265 seconds]
scymtym has joined #lisp
je4i has joined #lisp
buffergn0me has quit [Ping timeout: 260 seconds]
jfb4_ has joined #lisp
gravicappa has quit [Ping timeout: 268 seconds]
jfb4 has quit [Ping timeout: 265 seconds]
<pjb> shangul: nil = false ; 'nil = the symbol nil ; () = empty code list (in code) ; '() = empty data list (in code).
didi has left #lisp ["O bella ciao bella ciao bella ciao, ciao, ciao."]
jfb4 has joined #lisp
<phoe> ;; (progv () ()) = overkill
<pjb> shangul: now, it depends on the current *readtable* and *package*. "NIL" and "()" can read to very different things, and different from |CL|:|NIL| < and even "|CL|:|NIL|" could read as something very different!
jfb4_ has quit [Ping timeout: 265 seconds]
<pjb> asdf_asdf_asdf: or use the MOP (to add slots). But it's not necessarily a good idea to do that, since new slots mean new accessor functions, and adding new functions at run-time means that you didn't knew it when you compiled your program, so they are not called, so they're useless.
<pjb> asdf_asdf_asdf: unless you are also adding new code, which will call those new functions. Are you implementing an IDE?
<pjb> asdf_asdf_asdf: it is better to have one slot holding an a-list or a hash-table, and to add entries to it.
<pjb> asdf_asdf_asdf: addding a new slot to a class is very costly an operation, since ALL the instance of this class and its subclasses will have to be updated!
buffergn0me has joined #lisp
<asdf_asdf_asdf> pjb, no I not implementing an IDE. How create a new slot using hash-table, example?
william1 has joined #lisp
<pjb> asdf_asdf_asdf: you don't.
<pjb> asdf_asdf_asdf: I just explained that creating a new slot was a BAD idea.
<asdf_asdf_asdf> OK, thank. What mean "it is better to have one slot holding an a-list or a hash-table, and to add entries to it."?
Bike has quit [Quit: Bike]
brass has quit [Quit: ZNC 1.7.4 - https://znc.in]
william1 has quit [Quit: WeeChat 2.6]
brass has joined #lisp
<pjb> asdf_asdf_asdf: https://pastebin.com/w1CsDANZ
william1 has joined #lisp
william1 has quit [Client Quit]
<pjb> So instead of using slot-value, you use attribute-value.
Kundry_W_ has quit [Remote host closed the connection]
shifty has joined #lisp
Kundry_Wag has joined #lisp
bitmapper has quit []
buffergn0me has quit [Ping timeout: 260 seconds]
<asdf_asdf_asdf> Thank You.
Kundry_Wag has quit [Ping timeout: 260 seconds]
bitmapper has joined #lisp
femi has quit [Ping timeout: 250 seconds]
je4i has quit [Remote host closed the connection]
nanananaminanami has joined #lisp
femi has joined #lisp
kajo has quit [Ping timeout: 260 seconds]
nanananaminanami has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
AnimalClatter has joined #lisp
atgreen has quit [Ping timeout: 265 seconds]
wsinatra has quit [Quit: WeeChat 2.7]
AnimalClatter has quit [Ping timeout: 268 seconds]
devon has joined #lisp
orivej has joined #lisp
Bike has joined #lisp
<aeth> Depending on the problem, if you want to add a bunch of 'slots' at runtime then a hash-table definitely seems better than actually using object slots. Then you don't need to 'add slots to existing objects' since any key is going to be valid. For alternatives, alists/plists are lists, so they're only good if it's short or if you're always iterating over them with something like alexandria:doplist.
<aeth> plists are great in macros, though, because they're just syntax and you can use destructuring-bind on them
smazga has quit [Quit: leaving]
<aeth> GETHASH supports default values as an optional third argument so if your hash table doesn't have the slot, you specify the default on access or in a helper function. e.g. (gethash :color foo :red)
<_death> you can also use the mop to define your own slot storage
luna_is_here has joined #lisp
<aeth> _death: I suspect that thinking in terms of instances of DEFCLASS-defined classes is overthinking it, though. Unless it's a public API that has to take this form.
<aeth> It depends on the problem, but this really seems like a better fit for hash tables.
sahara3 has joined #lisp
<_death> sure, I doubt asdf_asdf_asdf needs this sophistication
<pfdietz> The default value is useful with some macros: (incf (gethash x table 0))
<no-defun-allowed> Speaking of hash tables, are there any implementations of hash tables that are specialised on using strings as keys?
<aeth> It solves half of the problem. Now you get a meaningful default value instead of NIL when there's no entry present, but it won't stop you or someone else from adding some value that violates your constraints (in that case a non-number) somewhere else.
vaporatorius has quit [Quit: Leaving]
<pfdietz> no-defun-allowed: just EQUAL hash tables.
<aeth> hash-tables/alists/plists (especially the latter two since they're just lists) require discipline, but with the MOP you can really enforce things if you can describe it as a DEFCLASS (and DEFSTRUCT gives you :type which depending on the implementation can guarantee quite a bit, if the implementation respects that)
<pfdietz> Or EQUALP if you want to ignore case.
dyelar has quit [Quit: Leaving.]
william1_ has quit [Ping timeout: 258 seconds]
<no-defun-allowed> Sure, but those appear to be a performance problem in some code, especially on my Pi 0 where it takes more than 10 seconds to read a space delimited file and store it into a hash table.
<pfdietz> All you'd save would be the dispatching time to recognize a key is a string.
<no-defun-allowed> Hm, true.
<aeth> pfdietz: hmm... if the key is always a string, wouldn't a modern CPU with branch prediction basically make that time go away?
<pfdietz> If you have a specific constant set of string keys, STRING-CASE can be much faster.
<_death> have you tried implementing your own hash-table?
<pfdietz> aeth: you'd think so.
luna_is_here has quit [Ping timeout: 260 seconds]
<no-defun-allowed> That file has "only" 100,000 made up values, but it is much faster than I think it should be on my desktop.
<pfdietz> Which lisp are you using?
<no-defun-allowed> Maybe it's another SBCL vs Clozure thing; Clozure on my desktop is also a bit slower.
<pfdietz> One thing to worry about with strings (and comparisons of strings) is encodings. By default SBCL will read strings as (array character (*)), which uses 4 bytes per character. If you know it's 8 bit characters, you can read as base strings.
<no-defun-allowed> The strings aren't constant, and realistically I can't assume they're all 8 bit characters.
<no-defun-allowed> Yeah, gethash on an equalp hash table in SBCL is 3.5x faster for a miss, and 46x faster for a hit with a single element.
lavaflow has joined #lisp
<no-defun-allowed> The latter drops to only 16x if I provide `:lock-free t`.
pfdietz has quit [Remote host closed the connection]
<no-defun-allowed> _death: Well, I have for Netfarm slot lookup, since I don't have to implement resizing or removal or most of the interface other than GETHASH and (SETF GETHASH), but a complete hash table seems daunting.
<sahara3> hola
clothespin has quit [Ping timeout: 265 seconds]
<no-defun-allowed> (You can insert "because the number of slots in a class is usually pretty small" somewhere in that sentence.)
asdf_asdf_asdf2 has joined #lisp
<_death> no-defun-allowed: I don't know what netfarm is... btw you can provide a size parameter to make-hash-table
asdf_asdf_asdf has quit [Ping timeout: 265 seconds]
nitrix has quit [Read error: Connection reset by peer]
nitrix has joined #lisp
AnimalClatter has joined #lisp
nitrix is now known as Guest73624
<no-defun-allowed> It's irrelevant stuff that involves the MOP and another way to get at slot values which goes through a hash table.
<no-defun-allowed> That didn't really help, I don't think it was a resizing problem.
<_death> profile it?
AnimalClatter has quit [Ping timeout: 268 seconds]
asdf_asdf_asdf2 is now known as asdf_asdf_asdf
asdf_asdf_asdf77 has joined #lisp
<no-defun-allowed> I couldn't get https://github.com/eugeneia/sam to run too well on the Pi, nor on my desktop profiling all threads.
asdf_asdf_asdf has quit [Ping timeout: 268 seconds]
raghavgururajan has joined #lisp
jmercouris has joined #lisp
LiamH has quit [Quit: Leaving.]
sahara3 has left #lisp [#lisp]
kajo has joined #lisp
davisr has joined #lisp
Tordek_ is now known as Tordek
payphone` has quit [Ping timeout: 248 seconds]
* no-defun-allowed is now very confused
<no-defun-allowed> Out of curiosity, I unplugged the charger from my laptop. Clozure halved in speed, which would make sense given the laptop would throttle more, but SBCL dropped from 20ns or so to 1ns.
<no-defun-allowed> I guess now the-cost-of-nothing's initial tests for latency and overhead and all that don't apply, and it then gives incorrect results.
asdf_asdf_asdf77 has quit [Remote host closed the connection]
asdf_asdf_asdf has joined #lisp
jmercouris has quit [Remote host closed the connection]
brettgilio has quit [Quit: Quit]
brettgilio has joined #lisp
AnimalClatter has joined #lisp
defaultxr has quit [Quit: brb]
AnimalClatter has quit [Ping timeout: 258 seconds]