p_l 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/> | ASDF 3.3.4
orivej has quit [Ping timeout: 246 seconds]
userone has quit [Quit: Leaving]
orivej has joined #lisp
<aeth> phoe: Thanks for your input earlier. I fixed the two issues you spotted and I'm going to think about how to approach the typecheck soon.
<aeth> I'm not sure if I'll do that right away or if I'll do some graphics stuff first. I haven't done any graphics in a while and I'm thinking of some simple (3D, but effectively behaving the same as isometric) tiles.
dominic34 has joined #lisp
knuckles has quit [Ping timeout: 272 seconds]
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
dominic34 has quit [Ping timeout: 258 seconds]
userone has joined #lisp
wxie has joined #lisp
jeosol has quit [Ping timeout: 245 seconds]
orivej has quit [Read error: Connection reset by peer]
orivej has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
bitmapper has quit [Ping timeout: 246 seconds]
knuckles has joined #lisp
MidHotaru has joined #lisp
wxie has joined #lisp
orivej_ has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
gjulio_ has quit [Ping timeout: 272 seconds]
orivej_ has quit [Ping timeout: 256 seconds]
orivej has joined #lisp
jonatack has quit [Quit: jonatack]
gjulio_ has joined #lisp
jonatack has joined #lisp
JohnTalent has quit [Ping timeout: 256 seconds]
gjulio_ has quit [Ping timeout: 264 seconds]
userone has quit [Quit: Leaving]
gjulio_ has joined #lisp
orivej has quit [Ping timeout: 258 seconds]
EvW has joined #lisp
ldb has joined #lisp
<ldb> helo
GuerrillaMonkey has joined #lisp
kleptoflora has joined #lisp
knuckles has quit [Ping timeout: 256 seconds]
Jeanne-Kamikaze has quit [Ping timeout: 246 seconds]
philadendrite has quit [Ping timeout: 264 seconds]
ldb has quit [Quit: leaving]
TwoNotes has joined #lisp
Oladon has quit [Quit: Leaving.]
akoana has left #lisp ["Leaving"]
nicktick has joined #lisp
TwoNotes has quit [Quit: Leaving]
Oladon has joined #lisp
nicktick has quit [Ping timeout: 256 seconds]
freshpassport has joined #lisp
v88m has joined #lisp
<beach> Good morning everyone!
EvW has quit [Ping timeout: 260 seconds]
jesse1010 has quit [Ping timeout: 240 seconds]
shangul has joined #lisp
MidHotaru has quit [Quit: Connection closed for inactivity]
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
justache has quit [Quit: The Lounge - https://thelounge.chat]
justache has joined #lisp
justache has quit [Quit: The Lounge - https://thelounge.chat]
dddddd has quit [Remote host closed the connection]
wxie has quit [Ping timeout: 260 seconds]
justache has joined #lisp
wxie has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
wxie has quit [Remote host closed the connection]
justache has quit [Quit: The Lounge - https://thelounge.chat]
justache has joined #lisp
gxt has joined #lisp
ebrasca has joined #lisp
OpenZen has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
Bike has quit [Quit: leaving]
GuerrillaMonkey has quit [Ping timeout: 258 seconds]
datajerk has quit [Quit: ZNC 1.7.3 - https://znc.in]
datajerk has joined #lisp
gravicappa has joined #lisp
karlosz has quit [Read error: Connection reset by peer]
karlosz has joined #lisp
iarebatman has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 264 seconds]
orivej has joined #lisp
ErichHyuuga has joined #lisp
Harag has joined #lisp
rgherdt has joined #lisp
madrik has joined #lisp
<madrik> If certain keyword arguments are accepted only by one Lisp and not another, how should I write the feature conditionals?
wxie has joined #lisp
<ErichHyuuga> hey guys
Harag has quit [Read error: Connection reset by peer]
<beach> Hello ErichHyuuga.
<ErichHyuuga> Eat my diarrhea
<ErichHyuuga> Just...
<ErichHyuuga> Just ate a burger at the sleazy joint
<ErichHyuuga> Now I gotta take a shit, get to the point
<ErichHyuuga> Sittin' on the toilet, my ass is a blast
<ErichHyuuga> Runnin' smelly diarrhea outta my ass
<ErichHyuuga> No f*ckin' paper
<ErichHyuuga> Hey baby lick my ass 'til your face turns blue
<ErichHyuuga> You're finished rimmin' me and you want some more
<ErichHyuuga> Ya say ya don't flush but your out the door
<ErichHyuuga> I'm back in the...with a cup
<ErichHyuuga> Scoop it outta the toilet 'cause you wanna slurp it up
<ErichHyuuga> Eat my diarrhea you're chuggin' it down
<ErichHyuuga> You're suckin' my ass and your lips are all brown
<ErichHyuuga> Since we've gone back to the hamburger place
<ErichHyuuga> I'm gonna stick my ass right on your face
<ErichHyuuga> I'm gonna shit in your mouth
<ErichHyuuga> I'm gonna shit in your face, your mouth
<ErichHyuuga> And I wanna shit on your mother
<ErichHyuuga> I'm gonna shit on you and your mother
<ErichHyuuga> Diarrhea
<ErichHyuuga> I gotta take a shit
<ErichHyuuga> Gotta bottle a Ex-Lax, gonna take it
<ErichHyuuga> I'm gonna take me a lumpy shit
<ErichHyuuga> Gonna throw it at you, I hope I hit you
<ErichHyuuga> I hope it splats in your face there too
<ErichHyuuga> It's comin' out my ass all drippin' wet
<ErichHyuuga> It's comin' out my ass all drippin' wet
<beach> madrik: That depends a lot.
<ErichHyuuga> I want you to suck up all of it
<ErichHyuuga> Lick my ass and eat it too
<ErichHyuuga> Cause diarrhea is good for you
bhartrihari has joined #lisp
<ErichHyuuga> Ya eat it, eat it, eat
<ErichHyuuga> Eat it, eat it, eat
<ErichHyuuga> Diarrhea
<ErichHyuuga> Eat my f*ckin' shit
<beach> madrik: It depends on whether different implementations require the argument, or whether it is optional.
carleos has quit [Ping timeout: 272 seconds]
ErichHyuuga has quit [Quit: Leaving]
mangul has joined #lisp
<madrik> beach: E.g. CCL has a :SHARING keyword argument for WITH-OPEN-FILE, which takes one of three values.
<madrik> Right now, I have this: #+ccl :sharing #+ccl :external
<beach> I don't think you can do better.
<madrik> Okay, thanks.
knuckles has joined #lisp
<beach> If they are the last ones, you might get away with something like (bla bla . #ccl (:sharing :external)).
shangul has quit [Ping timeout: 272 seconds]
<beach> Nah, that won't work.
<beach> It would have to be #+ccl (:sharing :external) #-ccl '()
<beach> You get the picture. Not an improvement.
<madrik> Yes.
bsd4me has quit [Quit: Leaving]
JohnMS_WORK has joined #lisp
shka_ has joined #lisp
gjulio_ has quit [Ping timeout: 272 seconds]
mankaev has quit [Ping timeout: 256 seconds]
orivej_ has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
wxie has quit [Ping timeout: 256 seconds]
mankaev has joined #lisp
zaquest has quit [Quit: Leaving]
zigpaw has quit [Ping timeout: 272 seconds]
zigpaw has joined #lisp
rgherdt has quit [Quit: Leaving]
rgherdt has joined #lisp
mindCrime has quit [Quit: Konversation terminated!]
vaporatorius__ has joined #lisp
vaporatorius has quit [Ping timeout: 246 seconds]
zaquest has joined #lisp
Oladon has quit [Quit: Leaving.]
rogersm has joined #lisp
gaqwas has joined #lisp
gaqwas has joined #lisp
gaqwas has quit [Changing host]
orivej has joined #lisp
orivej_ has quit [Ping timeout: 272 seconds]
liberliver has joined #lisp
gaqwas has quit [Remote host closed the connection]
freshpassport has quit [Quit: Textual IRC Client: www.textualapp.com]
edgar-rft has quit [Quit: Leaving]
vaporatorius has joined #lisp
vaporatorius has joined #lisp
madrik has quit [Remote host closed the connection]
vaporatorius__ has quit [Ping timeout: 246 seconds]
pve has joined #lisp
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #lisp
stoneglass has joined #lisp
matzy_ has joined #lisp
joels has joined #lisp
<matzy_> can you connect mito to a remote database, like one on RDS? I tried passing :host and :port to mito:connect-toplevel but I think that's where my error is coming from
<joels> Hello all
nikkal has joined #lisp
dddddd has joined #lisp
orivej_ has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
<beach> Hello joels.
<matzy_> nvm i'm stupid
vms14 has joined #lisp
Harag has joined #lisp
<vms14> how can I implement the qw function of perl in lisp?
<Harag> I am working my way through left over lambda, tyring the code of
<Harag> (defmacro/g! nif ...) I get undefined variable g!result. Is there
<Harag> something wrong with the code of defmacro/g! in then online version of
<Harag> the book or am I doing something wrong?
ljavorsk has joined #lisp
tich has joined #lisp
<vms14> I want something like (qw there are strings there)
<Harag> eish sorry about that broken post
<beach> vms14: It is much better if you tell people what you want it to do, rather than assuming people know Perl.
<vms14> and being converted to ("there" "are" "strings" "there")
<vms14> beach: I was doing that
<beach> vms14: Well, first of all, qw can't be written as a function.
<vms14> the thing is, if I make a macro, and convert symbols to strings, the print case won't let me have mixed case,not?
<beach> Because functions evaluate their arguments, and you apparently don't want that.
rogersm has quit [Read error: Connection reset by peer]
<vms14> I only see in *print-case* :downcase :capitalize and :upcase
<beach> Well, if you use default reader settings, then it is already too late by the time the symbol is being read.
<vms14> then it has to be a reader macro?
<vms14> seems the way, thanks
<beach> It is going to be hard to keep that syntax in a reader macro.
<vms14> then what I should aim at?
<beach> In my opinion, you should forget about imitating the surface syntax of a language with a surface syntax that is as different from that of Common Lisp as this one seems to be.
<beach> Or else, if Perl syntax is what you want, then don't use READ.
<beach> Write a parser for Perl instead.
<vms14> I just want a function/macro that turns symbols to strings
<beach> Oh, that one is easy.
<vms14> but, without touching the case
<beach> That one is easy too.
<jackdaniel> how about (string 'foo) ;?
<beach> vms14: symbol-name does not touch the case.
<vms14> oh, thanks
<beach> vms14: Try (symbol-name '|aBcD|) for instance.
<vms14> but they'll have to be between || ?
<phoe> yes
<phoe> it's the reader itself that upcases or downcases symbols
<phoe> so you'll need a reader macro for that
<vms14> thanks phoe
<vms14> I'll try with a reader macro then
<beach> phoe: But then vms14 can't easily write (qw ....).
<vms14> also an excuse to learn
<flip214_> vms14: It might look like #q(...)
<vms14> but the reason is to not type "" for every string
<phoe> beach: it's impossible to write that either way without a custom reader
<vms14> if I have to use || it's almost the same
<phoe> by the time macroexpansion happens all the symbols are already upcased
<beach> vms14: I think it is a really bad idea to do what you seem to want.
<phoe> vms14: if you need to use a reader macro it'll look like #{Hello world}
<phoe> which is also almost the same
<phoe> (mostly because || and "" are reader macros under the hood, too)
heisig has joined #lisp
<vms14> didn't know "" was a reader macro
ebrasca has quit [Remote host closed the connection]
Cymew has joined #lisp
<phoe> hey, so are the parentheses
<vms14> :O
<phoe> and so is the quotation mark
<beach> clhs "
<phoe> it's really turtles all the way down, until you hit the GC
<vms14> the quotation mark, yes, just syntax sugar for (quote)
<flip214_> vms14: when I came over from Perl, I tried to make CL more similar to Perl, too.
<vms14> flip214_: and what did you achieve?
<phoe> vms14: parentheses are just syntax sugar for READ-DELIMITED-LIST
<flip214_> After some more practice I found out that most of that stuff isn't necessary ... CL-PPCRE:SCAN is a bit longer than /../, but it gives more results back anyway
<flip214_> so I got around to like the verbose Lisp way -- it's more readable over the long run anyway
<vms14> I'm actually mixing perl and lisp by using sockets and perl eval XD
<vms14> in netbsd I have some troubles, like no threads in sbcl, and most of libraries won't work
<vms14> so perl will be the lisp libraries
<vms14> actually using sdl from perl, and wanting to do the logic in lisp
<flip214_> why not embrace lisp symbols, and just serialize them as strings to perl?
karlosz has quit [Quit: karlosz]
<flip214_> I did a reader macro that kept case for me; then I could write §MixedCase-Symbol or §(Mixed List)
<flip214_> I needed that for JSON serialization (right case for keys)
<vms14> just wanted to have the qw function in lisp
<phoe> can't do that without a reader macro
<vms14> yeah, I'll try
<vms14> thanks phoe
<phoe> I assume you could do stuff like #{foo bar baz QuUx} that evaluates to ("foo" "bar" "baz" "QuUx")
<vms14> that's what I want
<phoe> totally doable with a reader macro then
anatrope has joined #lisp
<beach> vms14: According to what you said, that is NOT what you want. You said you wanted to be able to write (qw ...).
<vms14> yes, but the only way seems to be a reader macro
<vms14> so qw{} it's kinda fine
kleptoflora has quit [Ping timeout: 272 seconds]
<vms14> or alike
<vms14> and even more alike to perl
<beach> vms14: It is mystery to me why that particular reader macro is acceptable, but (qw ".." "...") is not.
<vms14> cause the reason is I'm lazy to put ""
<vms14> xd
<vms14> and it's a nice excuse to learn how to make a reader macro, which always wanted to do
<beach> Good luck!
<vms14> thanks :D
JohnMS_WORK has quit [Read error: Connection reset by peer]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
nicktick has joined #lisp
JohnMS_WORK has joined #lisp
rogersm has joined #lisp
<phoe> huh
<phoe> where is the bug in this code? https://plaster.tymoon.eu/view/1943#1943
<phoe> when copypasted to a REPL, it works fine in terminal but hangs in SLIME
<phoe> vms14: also qw{} will not work
<phoe> QW will get interpreted as a symbol
bhartrihari has joined #lisp
<vms14> atm is just {}
<phoe> OK, that will work
<vms14> but i have to learn how reader macros work
<pve> phoe: are you sure the arguments to qw-reader should be like that? Wasn't it (stream character number)?
<phoe> pve: oh right
<Harag> when using flatten in a macro it returns stuff like ,G!RESULT as sb-impl:comma and should I be seening that or getting G!RESULT as a a symbol?
<phoe> Harag: see the errata for LoL
<Harag> ok thanx
Cymew has quit [Ping timeout: 272 seconds]
<phoe> pve: you fixed it! thank you
<pve> great
<vms14> xD I was looking that, you made it for me
<vms14> <3
<phoe> just an exercise to ensure that I know how to write dispatch reader macros (hint: I obviously don't fully know, as you can see above)
<phoe> feel free to read it and then try to write it yourself based on the article I posted - it's a good one
<vms14> thanks man
<phoe> pve: thanks for the assist
contrapunctus has joined #lisp
<pve> np
nicktick has quit [Ping timeout: 256 seconds]
gigetoo has quit [Ping timeout: 256 seconds]
orivej_ has quit [Ping timeout: 265 seconds]
gigetoo has joined #lisp
orivej has joined #lisp
nikkal has quit [Ping timeout: 265 seconds]
<vms14> that's my version
<vms14> it adds a function
<vms14> {function string1 string2 string3...}
<vms14> thanks phoe, I wouldn't make it if you weren't helping me
<phoe> you don't want that last line
<vms14> it gives me error then
<phoe> first of all, it's an argument count mismatch, since the function must accept two arguments
<phoe> second, it should signal an error, since a lone closing delimiter is a programmer error
<vms14> but it fails if I put {something more}
<vms14> only works if there is a space at the end
<vms14> like {something more }
<phoe> shouldn't
<vms14> if I put the last line, it works
<beach> Set the syntax of } to be that of )
<phoe> yes, but not because of the reason you are thinking
<phoe> SET-MACRO-CHARACTER will cause #\} to be a terminating macro character
<phoe> where "terminating" means that the reader will not include it as a part of tokens
<phoe> so (set-macro-character #\} (lambda (c s) (declare (ignore c s)) (error "Lone closing delimiter))) or what beach said
<phoe> ...more or less, I'm missing a closing doublequote
<vms14> then something is wrong I guess
<vms14> cause I had this error when I don't put a space at the end
<vms14> I'll restart slime and see what it does now
<vms14> maybe it was a mistake that I've done before
<phoe> you most likely got that because #\} was not a terminating macro character
<phoe> that's why it's important to set it to be a terminating macro character
<beach> phoe: Are you sure your technique is portable?
<phoe> beach: what do you mean?
<beach> As I recall, in Eclector, we actually have a valid action associated with #\).
<beach> So (again, as I recall), READ-DELIMITED-LIST doesn't actually consume the #\).
<phoe> it does
<phoe> "If it is char, then the character is consumed and the list of objects is returned."
<beach> Ah, I see. Thanks.
random-nick has joined #lisp
<phoe> if I understand the reader algorithm correctly, parsing the delimiter is actually the duty of the reading function
<phoe> that's why the delimiter alone is allowed to just error if it's encountered
<beach> Maybe so. It has been a long time since I worked on the reader.
<phoe> and R-D-L behaves just like that
<beach> phoe: You know a lot of Common Lisp now! Congratulations!
<beach> That's why I would like you to work on SICL. :)
<vms14> the sad part is now that it works, it won't serve for my original purpose xD
<phoe> vms14: what was the original purpose
<vms14> I have a function named modules that takes a list of arguments and makes perl load those modules
<vms14> the sad part is modules in perl are in This::Form
<vms14> and that makes lisp think I want to refer to a package xd
<vms14> so I need to put "" anyways
<phoe> nah
<vms14> but it was nice to make a reader macro and understand them a bit better
<phoe> modify your reader macro some more
<beach> Or use Eclector.
<phoe> ^
<beach> It lets you configure the interpretation of tokens.
<jackdaniel> or use esrap if it is only about parsing code
<beach> It is high time to stamp out implementation-specific readers anyway.
<vms14> then I have to change the read-delimited-list and read it manually?
ggole has joined #lisp
matzy_ has quit [Remote host closed the connection]
<phoe> vms14: yes
<phoe> mostly because READ will attempt to read symbols
<phoe> and that will badly break
<phoe> inside a loop with WITH-OUTPUT-TO-STRING, read-chars until you read whitespace
<phoe> collect the list of strings until you hit #\}
<phoe> at which point, return it
<phoe> it's literally a function that works on a Lisp stream and pops chars from it
Cymew has joined #lisp
cosimone has joined #lisp
contrapunctus has left #lisp [#lisp]
wxie has joined #lisp
jesse1010 has joined #lisp
freshpassport has joined #lisp
<vms14> I'll try later
<vms14> see you guys, and thanks for the help
vms14 has quit [Remote host closed the connection]
wxie has quit [Ping timeout: 246 seconds]
wxie has joined #lisp
rogersm has quit [Quit: Leaving...]
scymtym has quit [Ping timeout: 264 seconds]
cosimone has quit [Quit: Quit.]
fbmnds has joined #lisp
cosimone has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
<fbmnds> I was advised to repeat my 'post' from Saturday on a working day
<fbmnds> hence: I'd like to know whether there is interest in this community to dig into EQL5 in essence to be able to further maintain this project. From what I understood going through the code base, EQL5 is based on witty design ideas and allows for cross platform GUI development (the examples apps work nice on my Android mobile, too - iOS is also
<fbmnds> supported).
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life_ is now known as Lord_of_Life
bhartrihari has joined #lisp
<phoe> fbmnds: I'd certainly be interested if it becomes cross-implementation in result
<flip214_> minion: memo for vms14: If you have your own reader macro, you could also make #\: a constituent character within this list... then you could (READ-DELIMITED-LIST) in your own *PACKAGE* and get symbols like |This::Form|
<minion> Remembered. I'll tell vms14 when he/she/it next speaks.
<phoe> flip214_: is that portable?
wxie has quit [Ping timeout: 240 seconds]
<flip214_> phoe: I guess that within your own readtable a COPY-SYNTAX from #\x to #\: should be conforming?!
<phoe> ;; Online Lisp Meeting #4 starting in 22 minutes at https://www.twitch.tv/TwitchPlaysCommonLisp ;;
<phoe> flip214_: the issue is that #\: has a NIL character macro function on my machine
<phoe> I don't know if it's possible to portably tell Lisp to not treat a character as a package marker
<beach> Yes, the #\: is not a macro character.
<fbmnds> phoe: what would be a use case of what you are interested in?
<phoe> fbmnds: developing Qt5 applications on SBCL/CCL for Windows/Linux/macOS
<phoe> so something that is currently solved by commonqt/qtools, except they are qt4
<fbmnds> phoe: afaik, I do not think that this will work with EQL5 - a switched from SBCL to ECL because of that
<phoe> I'll stay with qtools then
ebrasca has joined #lisp
scymtym has joined #lisp
<fbmnds> phoe: I see - did not know this
<phoe> jackdaniel: technical nitpick: is EQL5 allowed to be MIT? It seems to include minor modified snippets from ECL sources, see https://gitlab.com/eql/EQL5-Android/-/blob/master/utils/EQL5-symbols.lisp#L20102 (warning: huge file)
flazh has quit [Ping timeout: 246 seconds]
<phoe> that's a more general question I guess - if a package patches some other code by including and evaluating modified snippets of its source, does the copyleft virality also apply?
<phoe> boy, things are interesting in the Lisp world
<rgherdt> phoe: I would say yes, that doesn't seem to be different than other languages
<beach> Another thing that other languages apparently have been stealing from us.
contrapunctus has joined #lisp
Bike has joined #lisp
lavaflow has quit [Ping timeout: 246 seconds]
<phoe> ;; Online Lisp Meeting #4 starting now. https://www.twitch.tv/TwitchPlaysCommonLisp
<dim> beach: Imitation is the Sincerest Form of Flattery, they say, right?
<beach> Absolutely.
whiteline has quit [Ping timeout: 264 seconds]
ljavorsk has quit [Ping timeout: 258 seconds]
flazh has joined #lisp
whiteline has joined #lisp
Aurora_v_kosmose has quit [Ping timeout: 240 seconds]
Aurora_v_kosmose has joined #lisp
rogersm has joined #lisp
v88m has quit [Ping timeout: 264 seconds]
userone has joined #lisp
<jackdaniel> phoe: it does not bother me, but if it did then I'm sure it could ve resoved by upstreaming necessary changes
cosimone has quit [Quit: Quit.]
<phoe> flip214_: a§toni§hing
<flip214_> beach: they didn't steal, we still have it
<phoe> jackdaniel: OK
<jackdaniel> technically speaking I think that your concern has merit and I'm sure PR would be cooperative if it becomes a problem
<flip214_> phoe: well, you can just use 🖈 as well
duuqnd has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
fbmnds has quit [Quit: Connection closed]
userone has quit [Quit: Leaving]
mangul has quit [Ping timeout: 240 seconds]
nikkal has joined #lisp
bhartrihari has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
bhartrihari has left #lisp ["Error from remote client"]
edgar-rft has joined #lisp
shangul has joined #lisp
<phoe> ooookay then
cosimone has joined #lisp
narimiran has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #lisp
<flip214_> to "pin" the letters to their cases ;)
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
Necktwi has quit [Quit: leaving]
Necktwi has joined #lisp
ayuce has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
EvW1 has joined #lisp
<shka_> is sbcl boxing double-floats in simple-vector?
<phoe> shka_: AFAIK yes
<phoe> since a double is 64 bits, it can't really stay unboxed if tagging bits are needed
<shka_> phoe: well, mandate requests minimum of 50 bits
<shka_> *standard mandates
<shka_> that's why i am asking
<phoe> "The IEEE 754 standard specifies a binary64 as having 1+11+52 bits"
<phoe> I assume that this is the double float we are talking about
<shka_> i wask asking about CL:DOUBLE-FLOAT which must have a least 50 bits of precision and 8 bits for exponent
<phoe> oh! you meant the CL standard, not the IEEE one :D
<shka_> yes
<phoe> I assume that SBCL implements floats as IEEE 754 doubles though, which means they take a full 64-bit word
<shka_> but i think that sbcl uses all 64 bits regardless
<shka_> ok, i suspected that this is the case
<shka_> because of notes sbcl produces
nikkal has quit [Ping timeout: 258 seconds]
<jackdaniel> and that's why single-floats may be much faster on CL, because they may be implemented as immediate objects with a type tag
JohnMS_WORK has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
freshpassport has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cosimone has quit [Quit: Quit.]
cosimone has joined #lisp
bitmapper has joined #lisp
<phoe> 32 bits of data leaves plenty of space for tagging information on 64-bit implementations, whereas with fullword data like doubles the compiler and programmer need to exercise and cooperate a lot to prevent boxing
<phoe> ...or with single floats on 32-bit implementations
fanta1 has joined #lisp
akrl`` has quit [Read error: Connection reset by peer]
efm has joined #lisp
bsd4me has joined #lisp
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
bitmapper has quit [Read error: Connection reset by peer]
Trpger has joined #lisp
bitmapper has joined #lisp
Trpger has quit [Remote host closed the connection]
wsinatra has joined #lisp
<p_l> I wonder if it would be possible (or sensible at all) to somehow pack pointers into NaNs on a CL implementation
<phoe> p_l: hmmm, you'd get 53 bits of address space that way
<phoe> 54 if you count the sign bit
<phoe> uh, I mean 52/53
joels has quit [Ping timeout: 264 seconds]
<p_l> phoe: more interested in how effective one can use them as pointers, unboxed
fanta1 has quit [Ping timeout: 244 seconds]
lavaflow has joined #lisp
fanta1 has joined #lisp
DGASAU has quit [Read error: Connection reset by peer]
DGASAU has joined #lisp
rgherdt has quit [Quit: Leaving]
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 256 seconds]
X-Scale` is now known as X-Scale
dominic34 has joined #lisp
rgherdt has joined #lisp
<ggole> NaN-boxing is probably better for languages with double-only numbers
fluxwave has quit [Read error: Connection reset by peer]
stux|RC has quit [Quit: Aloha!]
fluxwave has joined #lisp
fluxwave has quit [Read error: Connection reset by peer]
stux|RC has joined #lisp
OpenZen has joined #lisp
pve has quit [Ping timeout: 256 seconds]
fluxwave has joined #lisp
fluxwave has quit [Read error: Connection reset by peer]
jw4 has quit [Read error: Connection reset by peer]
jw4 has joined #lisp
rgherdt has quit [Quit: Leaving]
rgherdt has joined #lisp
fluxwave has joined #lisp
fluxwave has quit [Read error: Connection reset by peer]
korner has joined #lisp
sjl has joined #lisp
fluxwave has joined #lisp
pve has joined #lisp
fluxwave has quit [Read error: Connection reset by peer]
<jmercouris> is there something like collect-if in a loop macro?
<beach> when ... collect ...
<phoe> jmercouris: (loop ... when x collect y ...)
<jmercouris> ah, yes
<jmercouris> thank you
fluxwave has joined #lisp
bhartrihari has joined #lisp
toorevitimirp has joined #lisp
akrl`` has joined #lisp
rogersm has quit [Quit: Leaving...]
bhartrihari has left #lisp ["Disconnected: closed"]
pve has quit [Ping timeout: 256 seconds]
tich has quit [Remote host closed the connection]
rumbler31_ has joined #lisp
rippa has joined #lisp
<korner> so i had been bit confused, i was told to test lisp code i should use sbcl but i cannot quite find how to actually use it
<phoe> korner: `sudo apt install sbcl && sbcl`?
<phoe> that's the installation and running part that should get you all the way to the SBCL prompt
gjulio_ has joined #lisp
<korner> i have sbcl but i couldnt quite figure out how to "run" .lisp file
<phoe> sbcl --load foo.lisp
<phoe> and/or sbcl --script foo.lisp
pve has joined #lisp
<korner> thanks that works
<phoe> the former will AFAIK load it and stay alive, the latter will load the file and exit
orivej has joined #lisp
<beach> korner: You don't typically use Common Lisp the way you use (say) C. It is more common to start a REPL (Read-Eval-Print-Loop) and work from inside the system.
<korner> i never touched C before
<beach> Well, any batch language.
<beach> korner: If you plan to develop in Common Lisp the way you do in a typical batch language, you probably won't see the point.
<phoe> maybe another question
<phoe> korner: what's your use case?
<korner> not sure what batch language is but i was just curious bout lisp thats all
<korner> not work, not student, just simply curiosity cause the syntax seems pretty nice
<phoe> oh
<beach> korner: By a batch language, I mean one that takes a source file, turn it into an executable, which you then start from your shell prompt.
<korner> ah i see
<korner> yeah i tried rust and haskell, that was some black magick
<phoe> Lisp is another kind of black magic
<phoe> you program in Rust and Haskell by writing code that the compiler then turns into executables
<korner> yes
<phoe> but you program in Lisp by starting a Lisp image and then modifying it until it contains the program that you want
<korner> i noticed though that lisp syntax is lil bit simmiliar to the way i format lua so thats fun
EvW1 has quit [Ping timeout: 244 seconds]
<phoe> it's a different creative process
<korner> but i think i get the idea
<phoe> mostly because Lisp stays alive throughout the whole programming experience
<beach> korner: I think there are some YouTube videos that will give you the idea about how we work.
<korner> was quite confused what i am even supposed to learn cause there is some common lisp, racket and million other lisps, thought common lisp would be nice starting point
<korner> was told that common-lisp is useless but that sounds unlikely
<phoe> korner: #lisp is a Common Lisp place, so obviously we'll suggest Common Lisp to you
<phoe> it's a general-purpose programming language that I personally use for all personal projects I make
random-nick has quit [Quit: quit]
<phoe> I really enjoy its interactivity and really short feedback loops.
gjulio_ has quit [Ping timeout: 240 seconds]
akrl`` has quit [Read error: Connection reset by peer]
orivej has quit [Ping timeout: 256 seconds]
rumbler31_ has quit [Ping timeout: 272 seconds]
random-nick has joined #lisp
orivej has joined #lisp
pve has quit [Ping timeout: 256 seconds]
korner has quit [Quit: Lost terminal]
Cymew has quit [Ping timeout: 256 seconds]
<contrapunctus> I was wondering today...could I use CL to make a MIDI sequencer? 🤔 It seems to be the exclusive domain of C/C++
<beach> Of course you can.
<contrapunctus> And GC won't pose an issue? o.o
<beach> That would depend on the Common Lisp implementation.
<beach> It would also depend on how low-level you want things to be in your application.
<beach> Like, do you want to generate the sound yourself from oscillators and/or sample files?
<contrapunctus> The latter, at least
<beach> Also, it will depend on how "real-time" you need for it to be. If you fill the sound buffers enough, a GC won't ruin it.
<beach> But it is probably best to avoid too much allocation during the "rendering" phase.
<beach> The thing is, most current FLOSS Common Lisp implementations have a GC that is not very good for real-time.
<contrapunctus> oh ._.
<beach> I think you can avoid allocation entirely during rendering.
<beach> After all, it is just arithmetic.
<beach> Or, you can run some test code to see how long a GC typically takes.
<phoe> another possibility is linking against FFI sound generators that don't suffer from GC issues - e.g. cl-collider for SuperCollider
<phoe> that's mostly because we don't have soft-real-time GCs in free Common Lisp implementations
<phoe> otherwise one could just write one in CL
<beach> But we are working on such an implementation.
<phoe> ^
<phoe> I do want to see a soft-real-time GC in action in Common Lisp
<beach> So I say, write the thing in Common Lisp entirely. See how it works out. Maybe tweak the parameters for current Common Lisp implementations.
<beach> Then, once we have a good GC, use it.
<phoe> hah, optimizing for the optimistic future
<phoe> I can't blame you :D
<beach> My experience is that it takes some time to write significant applications, and then the context has evolved.
Jesin has quit [Ping timeout: 260 seconds]
knuckles has quit [Ping timeout: 246 seconds]
matzy_ has joined #lisp
choegusung has joined #lisp
<shangul> Finally, I translated "How to make Lisp go faster than C" to my native language.
<rgherdt> beach: which implementation do you mean? (that's working on real-time GC)
<beach> minion: Please tell rgherdt about SICL.
<minion> rgherdt: SICL: SICL is a (perhaps futile) attempt to re-implement Common Lisp from scratch, hopefully using improved programming and bootstrapping techniques. See https://github.com/robert-strandh/SICL
<beach> Oh, and we are well on the say, so I don't think it is futile. :)
<phoe> it already had multiple nice effects on the ecosystem even though it's incomplete, so definitely not futile
<beach> Fair enough.
orivej has quit [Ping timeout: 264 seconds]
<phoe> Eclector and Cleavir are the two most notable ones that I can think of
<phoe> might be even more that I haven't yet become aware of
<beach> Trucler too, but less spectacular.
<beach> Compile-time lexical environments.
* phoe reads up on trucler
<beach> It is basically a CLOS-y version of the environment stuff from CLtL2.
<rgherdt> beach: thanks, will read about it
<beach> Also much more complete.
<beach> rgherdt: There is a specification. Hold on, I'll give you a link to a PDF.
<beach> Yeah, that's it.
<rgherdt> thx
<beach> ywlcm
DGASAU has quit [Ping timeout: 264 seconds]
DGASAU has joined #lisp
bacterio has quit [Ping timeout: 240 seconds]
nydel has quit [Ping timeout: 260 seconds]
akoana has joined #lisp
DGASAU has quit [Remote host closed the connection]
ebrasca has quit [Remote host closed the connection]
DGASAU has joined #lisp
efm has quit [Ping timeout: 258 seconds]
choegusung has quit [Quit: leaving]
nikkal has joined #lisp
<matzy_> should i be overly concerned if i created a db table in mito using it's classes and i see the table in my sql editor, but the (mito:ensure-table-exists 'mytable) returns NIL?
nydel has joined #lisp
JohnTalent has joined #lisp
EvW has joined #lisp
fanta1 has quit [Quit: fanta1]
knuckles has joined #lisp
<mfiano> M-. and you'll see it returns the result of MAPC
matzy_ has quit [Remote host closed the connection]
bhartrihari has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
aindilis has quit [Read error: Connection reset by peer]
zigpaw has quit [Ping timeout: 272 seconds]
zigpaw has joined #lisp
matzy_ has joined #lisp
aindilis has joined #lisp
karlosz has joined #lisp
Necktwi has quit [Quit: leaving]
lonjil has quit [Quit: No Ping reply in 210 seconds.]
bhartrihari has joined #lisp
bsd4me has quit [Remote host closed the connection]
jbgg has quit [Remote host closed the connection]
lonjil has joined #lisp
Necktwi has joined #lisp
stoneglass has left #lisp ["ERC (IRC client for Emacs 26.3)"]
jbgg has joined #lisp
fluxwave has quit [Read error: Connection reset by peer]
fluxwave has joined #lisp
fluxwave has quit [Read error: Connection reset by peer]
fluxwave has joined #lisp
ebrasca has joined #lisp
rogersm has joined #lisp
v88m has joined #lisp
matzy_ has quit [Remote host closed the connection]
shangul has quit [Ping timeout: 256 seconds]
akrl`` has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
fluxwave has quit [Quit: leaving]
akrl`` has quit [Read error: Connection reset by peer]
akrl`` has joined #lisp
toorevitimirp has quit [Ping timeout: 240 seconds]
<alandipert> is anyone aware of a pedagogical impl. of multiple values in the spirit of http://home.pipeline.com/~hbaker1/MetaCircular.html? e.g. implemented in terms of other operators
bacterio has joined #lisp
<Bike> not that i know of. let me see if i can write one real quick
<alandipert> oh jeez, disregard, it's there at the bottom :-)
<Bike> oh, is it?
<Bike> ah, yeah.
<alandipert> yeah i gave it a go myself and looks like i arrived at something not far off from his
<alandipert> phew
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
aindilis has quit [Read error: Connection reset by peer]
<Bike> this is kind of confusing to follow.
Jesin has joined #lisp
<Bike> but yeah having a thread local global vector is basically it
heisig has quit [Quit: Leaving]
matzy_ has joined #lisp
cosimone has quit [Read error: Connection reset by peer]
cosimone has joined #lisp
shangul has joined #lisp
akrl`` has quit [Remote host closed the connection]
terpri_ has joined #lisp
akrl`` has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
terpri has quit [Ping timeout: 260 seconds]
aindilis has joined #lisp
aindilis has quit [Read error: Connection reset by peer]
stepnem_ has quit [Ping timeout: 264 seconds]
stepnem has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
nikkal has quit [Ping timeout: 256 seconds]
<matzy_> what's the point of setting an accessor that's different that the slot name?
<phoe> matzy_: you don't export slot names this way
<phoe> (defclass foo ((%bar :accessor bar))) <- I only export FOO and BAR
<phoe> this prevents people from using SLOT-VALUE and forces them to uses the accessor functions, which may implement additional logic.
<phoe> where "prevents" means "unless they want to type the unholy trio of characters, «::%»"
<matzy_> so you can make your :accessor a function?
<phoe> what do you mean, make it a function?
<phoe> :accessor defines a pair of functions, #'BAR and #'(SETF BAR)
Sauvin has quit [Read error: Connection reset by peer]
<matzy_> right, but you mentioned additional logic implemented by the accessor
brown121407 has joined #lisp
<matzy_> oh, you mean when you set the accessor you can implement additional logic
<phoe> (defmethod bar :around (object) ...)
<phoe> (defmethod bar :after (object) ...)
<phoe> (defmethod bar :before (object) ...)
efm has joined #lisp
<phoe> then also the variants of the above that specialize on OBJECT in various ways
akrl`` has quit [Ping timeout: 256 seconds]
<matzy_> ok, that helps. thanks a lot
bhartrihari has joined #lisp
<matzy_> so best practice is to always give your accessors a different name
<matzy_> or a similar but slightly different name
<phoe> the common thing is to name slots %foo and accessors foo
<phoe> where "%" means "internal"
ech has quit [Remote host closed the connection]
efm has quit [Ping timeout: 246 seconds]
<_death> I don't think it's particularly common..
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
pve has joined #lisp
mankaev has quit []
<phoe> s/the common thing/the naming scheme I personally use/
aindilis has joined #lisp
arbv has quit [Read error: Connection reset by peer]
efm has joined #lisp
<Bike> beach does it too, so that makes it basically a standard,
arbv has joined #lisp
<phoe> you mean a new standard, newer than ANSI CL?
<phoe> oh boy here comes that discussion again~
<_death> personally I dislike adorning symbols with strange characters beyond the earmuff convention
shangul has quit [Ping timeout: 264 seconds]
nikkal has joined #lisp
efm_ has joined #lisp
efm has quit [Ping timeout: 265 seconds]
<phoe> how do you solve the export-the-accessor-not-the-slot-name problem then?
<_death> btw thanks phoe and beach for today's online meeting.. I got into it a bit late and didn't bother logging in
<phoe> _death: the video is online
<phoe> both on Twitch (still) and on YouTube
<_death> phoe: in my experience it's a nonissue
<phoe> _death: that's a valid answer too
<phoe> but anyway if you'd like to talk about anything for the next meeting, feel free to let me know
akrl`` has joined #lisp
<phoe> and by "you" I mean "hey #lisp come on the slot's free let's keep the meetings rolling and such"
<_death> also, I sometimes (often?) use the convention of giving a protocol-specific prefix to the access functions
aamukastemato has joined #lisp
terpri__ has joined #lisp
mankaev has joined #lisp
mankaev has quit [Client Quit]
efm_ has quit [Quit: Konversation terminated!]
terpri_ has quit [Ping timeout: 260 seconds]
<pve> Sometimes, I dream of a library that aggregates all the common defclass usage patterns into a set of convenience macros that I could choose from, depending on my mood.
<pve> Or one that provides a define-class-construction-kit, to which you can say "Hey, gimme a define-class macro with so-and-so slot and accessor naming scheme that maybe exports the class and its accessors by default, so my fingers don't bleed everytime I want to define a class".
dominic34 has quit [Ping timeout: 264 seconds]
_paul0 has joined #lisp
v88m has quit [Read error: Connection reset by peer]
aamukastemato has quit [Quit: Leaving]
paul0 has quit [Ping timeout: 246 seconds]
Lycurgus has joined #lisp
rogersm has quit [Quit: Leaving...]
akrl`` has quit [Ping timeout: 260 seconds]
edgar-rft has quit [Quit: Leaving]
JohnTalent has quit [Quit: leaving]
nicktick has joined #lisp
akrl`` has joined #lisp
brown121407 has quit [Remote host closed the connection]
arbv has quit [Read error: Connection reset by peer]
arbv has joined #lisp
shka_ has quit [Ping timeout: 256 seconds]
hiroaki has joined #lisp
brown121407 has joined #lisp
simendsjo has joined #lisp
Inline has joined #lisp
dominic34 has joined #lisp
scymtym has quit [Ping timeout: 244 seconds]
dominic34 has quit [Client Quit]
<ym> Is a task of implementing arrays with signed (possible negative, in similar way C pointers allows it) index out of standard? Maybe someone knows an example?
<phoe> not in portable CL
<phoe> array indices are from 0 upwards
gaqwas has joined #lisp
gaqwas has joined #lisp
<phoe> why though?
orivej has joined #lisp
matzy_ has quit [Read error: Connection reset by peer]
<ym> Why? I have a sine LUT and it would be nice to have positive values for 0 to pi and negative for 0 to -pi.
<Bike> you can just have a function that accesses the lut and takes a possibly negative index as argument, and then it gets the actual index with a subtraction.
<ym> Yes, but it costs.
<phoe> use (mod n 2pi)
<ym> I do.
<Bike> barely anything. also, you could just have a table from 0 to pi and negate it, couldn't you?
<phoe> don't know if it can be done any better in portable CL then
<_death> a lookup table is suspicious in the first place
<Bike> a C array is just a bunch of objects that are contiguous in storage. a lisp array is an actual structure. so lisp arrays don't work like C arrays.
<ym> Bike, I can, but I also has a compound type that will fit very well with described LUT access method. But thanks anyway.
<ym> _death, why?
<_death> because nowadays on much hardware sine computation would be much faster than a memory access
<ym> How do you write lisp code with modern hardware?
<_death> for start, you have a SIN function
<ym> I have or LISP does?
<_death> clhs sin
<ym> So how do I make it run on modern hardware to achieve sine values faster than from LUT?
<_death> by calling it
<_death> I guess there's some miscommunication going on?
<ym> Seems like it.
<ym> Maybe I have not modern enough hardware, but for me sin always slower than aref from array.
cranes has joined #lisp
scymtym has joined #lisp
<_death> maybe something weird is going on, because modern hardware has fast instructions for computing it
<_death> (in fact, not so modern hardware had them.. like 80287?
<ym> CPU instructions for trigonometric function? Give me a hint how to google it.
<_death> I think nowadays some SSE analogue is used
nullman has quit [Ping timeout: 264 seconds]
nikkal has quit [Ping timeout: 260 seconds]
wsinatra has quit [Quit: WeeChat 2.8]
nullman has joined #lisp
<_death> looking at sbcl code it does seem weird that it has #-x86 (def-math-rtn "sin" 1) which supposedly calls the C function
<ym> Intel Haswell fsin: 47-106c latency. 71-100 uops.
cosimone has quit [Quit: Quit.]
duuqnd has quit [Remote host closed the connection]
duuqnd has joined #lisp
ayuce has quit [Remote host closed the connection]
nicktick has quit [Quit: Leaving.]
narimiran has quit [Quit: leaving]
<ym> fsin always takes hundreds cycles. Maybe if you implement your own sine on modern Intel's CPU+FPGA chips, that would be same as accessing precalculated value.
ggole has quit [Quit: Leaving]
EvW has quit [Ping timeout: 244 seconds]
bsd4me has joined #lisp
nicktick has joined #lisp
elderK has joined #lisp
<elderK> Hey all, I was wondering if anyone had any experience with ASDF package-inferred-systems. If so, how did you feel about them? Did you find they made it easier to manage larger projects? Any alternatives?
cosimone has joined #lisp
nicktick has quit [Client Quit]
EvW has joined #lisp
brown121407 has quit [Remote host closed the connection]
gxt has quit [Ping timeout: 240 seconds]
nicktick has joined #lisp
gxt has joined #lisp
knuckles has quit [Ping timeout: 272 seconds]
knuckles has joined #lisp
pfdietz has joined #lisp
gravicappa has quit [Ping timeout: 272 seconds]
cranes has quit [Quit: Lost terminal]
Oladon has joined #lisp
<pve> elderK: it's a matter of taste, if you're comfortable with juggling exports then it's fine
cosimone has quit [Ping timeout: 260 seconds]
<pve> in my current project I do one package per directory/module
sz0 has quit [Quit: Connection closed for inactivity]
<Lycurgus> if it only came in 3.1.2 ... .
<phoe> How can I define a LIST-OF type using SATISFIES that will only match lists whose all elements are of type TYPE? I want to use it like (typep x '(list-of number))
<phoe> I assume that this should expand into (satisfies somepred) - but, given a single argument to the type expander, what should SOMEPRED be?
<phoe> do I need to DEFUN inside the type expander to take care of that?
gaqwas has quit [Ping timeout: 256 seconds]
sz0 has joined #lisp
<ym> deftype has example in hyperspec. somepred would be a list you're checking.
userone has joined #lisp
<phoe> a list? what do you mean?
<phoe> SOMEPRED must be a one-argument predicate if it's a part of SATISFIES
<pve> I remember trying to do that a long time ago too, my conclusion (could be wrong) was that you needed to have some magic to ensure predicates exist for each concrete type you want to check
<phoe> also, the example isn't really what I am looking for
<elderK> pve: How do you handle the case where two modules require something from each other? Say, interfaces.
<elderK> Just define an interfaces package?
<elderK> I've been playing with Lisp for awhile now but I'm still new to using it in a practical sense :)
<phoe> elderK: the easiest is to define a protocol/interface package and have the modules use it
<ym> phoe, you first defun somepred so that it accept one argument, then you deftype with (satisfies somepred). Why don't you like the example?
<pve> elderK: hmm I try to make sure the dependencies are one-way always
<pve> if that's what you mean
<elderK> phoe: Another question is, like, constructors. How do you handle the case of initializing stuff in a new object instance? Say, some members are initialized in a complex way, based on some parameters you set when you create the instance. Do you just have a function that encapsulates that all? Do you use shared-initialize? I'm not sure what the best way is to handle that.
* Lycurgus forgot the geneology back to mk-defsystem. Also thereis a grovel extension.
<phoe> ym: I cannot define a single type named LIST-OF that accepts a type as an argument. I must define LIST-OF-NUMBER, LIST-OF-INTEGER, LIST-OF-SYMBOL, ...
<elderK> That is, creating an instance is more complex than just (make-instance 'thing ...)
<phoe> elderK: wait a second, what do you mean, more complex
<phoe> MAKE-INSTANCE is supposed to be the external interface, because you can arbitrarily complicate the process of instantiating
<phoe> by defining methods on INITIALIZE-INSTANCE, REINITIALIZE-INSTANCE, SHARED-INITIALIZE, and/or the two update functions
<phoe> in a purely CLOSsy perspective, you should never need any kind of wrapper over MAKE-INSTANCE
<elderK> phoe: Okay, so methods on those generics are roughly equivalent to constructors in other languages?
<phoe> elderK: yes, that's the idea.
<elderK> phoe: Thank you :)
<phoe> INITIALIZE-INSTANCE: for new instances. REINITIALIZE-INSTANCE: for old instances that you need to "reinitialize", whatever it means for you.
<phoe> Update methods: when the class was modified or you change the instance's class.
<elderK> How often should we be concerned with reinitialize-instance and such? I rarely see them defined.
<phoe> SHARED-INITIALIZE: for code that is supposed to execute in all of the above cases.
<phoe> elderK: do you call REINITIALIZE-INSTANCE on your instances?
<ym> phoe, maybe store list type in the end of the list?
<phoe> if you don't have a use case for it and don't call it, then you can use the default behavior
<phoe> ym: sounds dirty.
<phoe> then the list contains objects that aren't of the type I want
<phoe> we could cons them onto the beginning of that list I guess, but then suddenly we get (typep (cons type list) '(satisfies list-of-x))
<phoe> I'll go the SETF FDEFINITION way
<ym> Don't list always has nil in the end?
<phoe> consing onto the beginning is cheaper than consing at the end and doesn't require the list to be mutated
<phoe> if I have a list (1 2 3), I don't want to traverse it and set its last CDR to some type so I get (1 2 3 . MY-AWESOME-TYPE)
<phoe> since not only that destroys my list, it's also really really pointless
<ym> Maybe check the type of first element of a list in somepred and compare it's type to other elements type.
<elderK> phoe: If I have a class B and I want to create an instance of it in file A (but not use any of its methods), is it wise to have A depend on the file that defines B?
<ym> It will only tell if list is filled with similar type elements though.
<elderK> Or is it not necessary in CL? Since, make-instance just accepts a symbol for the class name?
<phoe> elderK: it accepts a symbol just fine
<elderK> I've been going on the hypothesis that the symbol naming the class is namespaced, and so I could import it.
<elderK> Say, foo:my-class vs zug:my-class.
<phoe> sure, as long as the symbol already exists
<phoe> ...at read-time, I mean
Inline has quit [Ping timeout: 246 seconds]
<elderK> phoe: If initialize-instance takes care of initializing some slots, how do you ensure that another user instantiating your class, doesn't specify initializers for those slots directly?
<Xach> don't make the initarg easy to use
<elderK> If class A has slots s0 and s1, and s1 is initialized in initialize-instance, how do I prevent the user (make-instance 'A :s1 whatever)
<Xach> use a "private" symbol as the initarg for s1, for example
<Xach> or don't have an initarg for it at all
cranes has joined #lisp
cranes has quit [Client Quit]
<Xach> or document that they Mustn't
<elderK> Thank you, Xach.
<elderK> I've been using keyword symbols for initargs. I didn't think to use an ordinary symbol :)
cranes has joined #lisp
gaqwas has joined #lisp
gaqwas has joined #lisp
gaqwas has quit [Changing host]
<Xach> elderK: it is not very common in my experience
<Xach> but, this is a situation that calls for them
<phoe> aaaaaaah
<phoe> ugly, but satisfying
cranes has quit [Client Quit]
orivej has quit [Ping timeout: 246 seconds]
cranes has joined #lisp
orivej has joined #lisp
cranes has joined #lisp
nabataeus has joined #lisp
<phoe> (typep '(1 2 3) '(phoe-toolbox:list-of cl:number)) ;=> T
Lycurgus has quit [Remote host closed the connection]
cranes has quit [Client Quit]
cranes has joined #lisp
grewal has quit [Ping timeout: 240 seconds]
grewal has joined #lisp
nabataeus has quit [Quit: ERC (IRC client for Emacs 26.3)]
<pve> phoe: neat, are you able to get compile-time warnings with that? (it's late, so I can't reason about that myself now)
<phoe> what do you mean, compile-time warnings?
<phoe> it's SATISFIES so I don't expect to get anything
<pve> like if you declaim ftype myfunction to take a list-of cl:number
<phoe> can SATISFIES go into DECLAIM FTYPE?...
* phoe checks
<pve> and then somewhere call it with list-of cl:string
<phoe> don't think so
<phoe> SATISFIES types are black boxes to Lisp compilers
<pve> ok
<pve> no parameterized type for us then :(
<phoe> sorry, can't hack the CL type system like that.
rgherdt has quit [Quit: Leaving]
<pve> yeah, I didn't think so
grewal has quit [Ping timeout: 256 seconds]
Harag has quit [Remote host closed the connection]
rgherdt has joined #lisp
Harag has joined #lisp
grewal has joined #lisp
sjl has quit [Ping timeout: 258 seconds]
Harag has quit [Remote host closed the connection]
random-nick has quit [Ping timeout: 272 seconds]
Harag has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 264 seconds]
Lord_of_Life_ is now known as Lord_of_Life
pve has quit [Quit: leaving]
catern has quit [Excess Flood]
gjulio_ has joined #lisp
catern has joined #lisp
epony has quit [Remote host closed the connection]
epony has joined #lisp
<ym> Also indention's broken.
<phoe> ...woah!
<phoe> that's actually genius!!!
<phoe> I didn't think to combine CONS and SATISFIES like that
<phoe> this is brilliant stuff
<Bike> type-of might not be the best operator for this, it can return a lot of things.
duuqnd has quit [Quit: Leaving]
<phoe> Bike: it will never return NIL though
<phoe> so if we bend the rules and use its output as a boolean, then this code will magically work
<phoe> I'll go to sleep now and will use the insight from ym to make a better version tomorrow morning
<Bike> i mean, for example, you could have a (list-of cons) and then type-of would return a (cons x y) type depending on what's in the cons
<phoe> oh right
<phoe> yes, I see now
<phoe> there's multiple type-of in there
<Bike> or one you could actually run into, if you have (list-of simple-vector), but on sbcl (type-of #(1 2 3)) => (simple-vector 3)
<phoe> I assume we can just use EVERY TYPEP on the CDR of that list though
<Bike> i guess, but that doesn't help if type-of returns something unfavorable for the first element.
<phoe> oh
<phoe> that's correct, yes
<phoe> for 1 it might return BIT
<phoe> and therefore the thing will fail for e.g. '(1 2 3 4 5)
<phoe> sigh
<phoe> well at least we tried
* phoe goes to sleep
<Bike> yeah, sorry to be no fun
gaqwas has quit [Remote host closed the connection]
rgherdt has quit [Ping timeout: 272 seconds]
efm has joined #lisp
whiteline has quit [Ping timeout: 246 seconds]
efm_ has joined #lisp
efm has quit [Ping timeout: 256 seconds]
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #lisp