phoe changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
s-liao has joined #commonlisp
Cena has joined #commonlisp
Cena has quit [Client Quit]
kevingal has quit [Ping timeout: 250 seconds]
Inline__ has joined #commonlisp
Inline has quit [Ping timeout: 256 seconds]
Bike has quit [Quit: Lost terminal]
notzmv has quit [Ping timeout: 252 seconds]
random-nick has quit [Ping timeout: 240 seconds]
morganw has quit [Remote host closed the connection]
Oladon has joined #commonlisp
Devon has joined #commonlisp
nature has quit [Ping timeout: 250 seconds]
dotblank has joined #commonlisp
anticomputer_ has quit [Remote host closed the connection]
<dotblank> Is this a good place for Autolisp questions or is there a different channel for that?
<tyson2> maybe try #lisp or #lispcafe
<dotblank> Thanks!
Fare has quit [Ping timeout: 240 seconds]
anticomputer has joined #commonlisp
Fare has joined #commonlisp
Oladon has quit [Quit: Leaving.]
Devon has quit [Ping timeout: 256 seconds]
Fare has quit [Ping timeout: 256 seconds]
Devon has joined #commonlisp
notzmv has joined #commonlisp
Inline has joined #commonlisp
Inline__ has quit [Ping timeout: 240 seconds]
igemnace has quit [Quit: WeeChat 3.4]
tyson2 has quit [Read error: Connection reset by peer]
igemnace has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
White_Flame has quit [Remote host closed the connection]
White_Flame has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
s-liao has joined #commonlisp
s-liao has quit [Quit: Client closed]
s-liao has joined #commonlisp
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #commonlisp
\f is now known as buffer
buffer is now known as \f
waleee has quit [Ping timeout: 260 seconds]
<beach> Good morning everyone!
user__ has joined #commonlisp
s-liao has quit [Quit: Client closed]
semz_ has quit [Ping timeout: 256 seconds]
hashfunc107e has joined #commonlisp
Fare has joined #commonlisp
<hashfunc107e> does CL have any standard facilities for finding the line number of a particular string in a file?
<hashfunc107e> i prefer not to use any external libraries
<beach> Loop using READ-LINE and a counter.
<hashfunc107e> beach: ok, i considered that, but i was hoping for a better way. looks like that'll have to do! thanks
<user__> If it's already loaded into memory you could also just combine SEARCH and COUNT.
<user__> oh for god's sake
user__ is now known as semz
<semz> I should get a bouncer already
<beach> And, yes, they excluded FIND-NUMBER-OF-LINE-IN-FILE-THAT-MATCHES-STRING from the standard.
<hashfunc107e> beach: it's about time they pass that proposal haha
<Josh_2> Good morning
<hashfunc107e> Josh_2: gm
<hashfunc107e> now i'm thinking of how to solve the problem of finding a multi-line string in a file; returning it's corresponding line number that it starts at
<beach> Load the entire file into memory. Then search for the index of the string. Finally, count the newlines preceding that index.
<hashfunc107e> beach: that is a clever strategy
<hashfunc107e> i'm assuming my best bet is to use UIOP:READ-FILE-STRING for loading the file into memory
<White_Flame> as a separate question, I'm speeding up some file I/O. Replacing read-from-string with parse-integer is far faster, but what about for floats? is there a builtin way, or maybe a lib, that converts an entire string to a fp number?
<White_Flame> ...faster than read-from-string
<hashfunc107e> White_Flame: i'm no expert, but the first thought that comes to mind is to somehow use CFFI for that problem
<White_Flame> that would probably involve copying memory, and it's fairly expensive
<White_Flame> I did that with a C union to cast floats into arrays of bytes, before I discovered my implementation's internals, and it was like 100x slower
<White_Flame> (probably would be faster than read-from-string still, but whatever)
<White_Flame> Since this is such a constrained case, decimal numbers from csv with no scientific notation or ignorable characters, I'm writing a manual loop across the chars while I wait :)
<hashfunc107e> interesting that you're analyzing a bunch of floats haha. are you analyzing some scientific data?
<White_Flame> business data
<hashfunc107e> even more interesting. are floats the best type to use for the situation?
<White_Flame> yes
<hashfunc107e> i've never dealt with hard-floats in business software before
dotblank has quit [Quit: Client closed]
zacque has joined #commonlisp
<White_Flame> yeah, this is stupidly faster. the old version spent 50% of the total time under r-f-s, now the whole thing runs in about half the time
Fare has quit [Ping timeout: 272 seconds]
Everything has joined #commonlisp
dirtcastle has joined #commonlisp
aartaka has joined #commonlisp
jealousmonk has quit [Quit: ERC 5.4.1 (IRC client for GNU Emacs 27.1)]
<Josh_2> Very nice White_Flame
leo_song has quit [Read error: Connection reset by peer]
leo_song has joined #commonlisp
Cymew has joined #commonlisp
leo_song has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
leo_song has joined #commonlisp
Cymew has quit [Ping timeout: 256 seconds]
ec_ has quit [Remote host closed the connection]
ec_ has joined #commonlisp
<hashfunc107e> is it just me or does this sound like the total opposite of what it should be: "Predicate should return true if and only if the first argument is strictly less than the second (in some appropriate sense). If the first argument is greater than or equal to the second (in the appropriate sense), then the predicate should return false."
<_death> it's just you?
<beach> I think it's just you. What problem do you have with it.
<Josh_2> think its just you
<hashfunc107e> If the first argument is superior to the second, return false.
<hashfunc107e> ^ that is so unintuitive in my opinion
<beach> What part?
<hashfunc107e> Rather it should be:
<hashfunc107e> "If the first argument is superior to the second, return true."
<beach> That's a different function.
<beach> The description is that of a function such as <.
<hashfunc107e> beach: ok, that makes sense now
<beach> Why did it not make sense before?
<hashfunc107e> My line of thought was (and still is), "If thing is superior to thing' then it's true thing is superior."
mogan90 has joined #commonlisp
<beach> So you think (< 4 3) should return true?
<beach> ... because 4 is greater than 3?
<hashfunc107e> beach: i think we're looking at the same thing reasoning from different foundations of thought
<beach> I would like to understand your foundations of thought that made you think the description was strange.
<beach> I guess it's the teacher in me that is curious.
mogan90 has quit [Ping timeout: 240 seconds]
<flip214> I still have to move the operator between the operands to think such things through
<_death> ∀x∀y P(x,y) ⇔ x < y
<hashfunc107e> ok will do. so here's the sentence we're dealing with "Predicate should return true if and only if the first argument is strictly less than the second (in some appropriate sense). If the first argument is greater than or equal to the second (in the appropriate sense), then the predicate should return false." generally (and i can't speak for everyone on this), when i think of something as true, or greater, i think of the number
<hashfunc107e> think of something as false, or lesser, i think of the number 0. therefore, when i read, "If something is Greater, return False", is sounds unintuitive to me, since that sentence reads like, "If something is Greater, return Lesser." or "If something is 1, return 0." or "If something is true, return false."
<hashfunc107e> _death: yes, in terms of "∀x∀y P(x,y) ⇔ x < y" that makes sense to me
<beach> hashfunc107e: So in your opinion, the function < is not a predicate, because it returns false if the first argument is greater than or equal to the second?
<hashfunc107e> beach: no, i don't think that. i think a better example would have been to use > as the predicate in that sentence.
<ck_> "when i think of something as true [...] i think of the number"
<ck_> sounds like C
<beach> But, but, that would have changes what it means.
<hashfunc107e> ck_: exactly, that's where i'm coming from
<ck_> but this is not C
* ck_ confused
<beach> s/changes/changed/
<hashfunc107e> ck_: i know. but i have spent alot of time in C, and i'm trying to permanently switch to lisp
<beach> hashfunc107e: Even in C, x < y is 0 when x is greater than or equal to y.
<hashfunc107e> beach: isn't that what you implied earlier? "The description is that of a function such as <."
<beach> hashfunc107e: Yes, are you saying they should not be allowed to describe < ?
<hashfunc107e> beach: yeah, like i said, i think we're on different lines of thought right now
<beach> I am also totally confused as to how you could have opinions about what predicate someone else is describing.
<beach> "Please do not describe <. Describe > instead!"
<_death> it simply means the predicate should be a strict partial order
<hashfunc107e> i think there is some miscommunication going on here. on both our ends
<ck_> beach: well that makes sense to me! After all, > is the greater predicate
<ck_> (scnr)
<hashfunc107e> _death: yes, that makes sense to me
<_death> > is also a strict partial order, so it can also serve as the predicate
<White_Flame> maybe "return true if it should come strictly earlier in the list" would be more appropriate
<White_Flame> but I don't think the sentence as-is is incorrect or misleading in any way
<beach> White_Flame: That's also a different predicate.
<White_Flame> how so?
<beach> I don't see how < is the same as "earlier in the list".
<White_Flame> fully,l "return true if X should come strictly earlier in the list than Y"
<beach> I don't see a list at all in that phrase.
<White_Flame> sort doesn't require <
<beach> Who said something about sort?
<_death> beach: the quoted text does not describe the actual < function, but any strict partial order.. so I can see how someone might not notice "in the appropriate sense" and get confused
<White_Flame> oh sorry, thought I saw that up there
<hashfunc107e> beach: that's the documentation description we're talking about
<beach> < is a shorthand for "considered smaller".
<beach> hashfunc107e: But your problem is unrelated to where the phrase is from.
<White_Flame> the SORT page has extremely similar wording
<White_Flame> for its predicate
<hashfunc107e> beach: i think i may have miscommunicated, then. my issue is that of the sentence "Predicate should return true if and only if the first argument is strictly less than the second (in some appropriate sense). If the first argument is greater than or equal to the second (in the appropriate sense), then the predicate should return false." on the SORT documentation page
<White_Flame> yeah, hence my `maybe "return true if it should come strictly earlier in the list" would be more appropriate` actually would apply to that ;)
<beach> hashfunc107e: All it means is that you should give it some predicate P, and if YOU think that x is less than y in your favorite way, then (P x y) should return true.
<beach> hashfunc107e: And if YOU think that x is greater than or equal to y in your favorite way, then (P x y) should return false. And you should supply a predicate that works that way, for YOUR favorite way of considering x and y.
Cymew has joined #commonlisp
<beach> hashfunc107e: And if you do that, SORT promises to give you a result in ascending order, according to YOUR way of comparing the elements.
<White_Flame> "according to the order determined by the predicate function"
<hashfunc107e> White_Flame: beach: yes, makes total sense to me now. thanks ya'll
<White_Flame> doesn't actually technically specifically say that the order is smaller to larger
<hashfunc107e> _death: thanks
<beach> Pleasure.
<beach> White_Flame: That sounds like a case for WSCL.
<White_Flame> yep
mgl has joined #commonlisp
attila_lendvai has joined #commonlisp
silasfox has joined #commonlisp
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
Everything has quit [Quit: leaving]
dirtcastle has quit [Quit: Quit]
Cena has joined #commonlisp
Cena has quit [Ping timeout: 240 seconds]
Dynom has joined #commonlisp
MajorBiscuit has joined #commonlisp
aartaka has quit [Ping timeout: 272 seconds]
s-liao has joined #commonlisp
s-liao has quit [Client Quit]
aartaka has joined #commonlisp
Cymew has quit [Ping timeout: 256 seconds]
shka has joined #commonlisp
mogan90 has joined #commonlisp
notzmv has quit [Ping timeout: 240 seconds]
Cymew has joined #commonlisp
lisp123 has joined #commonlisp
dirtcastle has joined #commonlisp
linjian has quit [Quit: You have been kicked for being idle]
OlCe has quit [Read error: Connection reset by peer]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 250 seconds]
MajorBiscuit has joined #commonlisp
OlCe has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 240 seconds]
MajorBiscuit has joined #commonlisp
lisp123 has quit [Read error: Connection reset by peer]
lisp123 has joined #commonlisp
mgl has quit [Ping timeout: 256 seconds]
mgl has joined #commonlisp
Catie has quit [Ping timeout: 240 seconds]
MajorBiscuit has quit [Quit: WeeChat 3.4]
dirtcastle has quit [Ping timeout: 250 seconds]
MajorBiscuit has joined #commonlisp
d4ryus has quit [Ping timeout: 240 seconds]
ec_ has quit [Ping timeout: 240 seconds]
hashfunc107e has quit [Ping timeout: 240 seconds]
d4ryus has joined #commonlisp
notzmv has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
jimka has joined #commonlisp
jimka has quit [Client Quit]
jimka has joined #commonlisp
jimka has quit [Client Quit]
morganw has joined #commonlisp
igemnace has quit [Remote host closed the connection]
dirtcastle has joined #commonlisp
dirtcastle has quit [Client Quit]
szkl has quit [Quit: Connection closed for inactivity]
<beach> One of the referees of our ELS paper wrote "This section fails to not that other code-walking libraries and AST building libraries do exist, and do provide portable wrappers for the environment functionalities". Is this person saying that these other libraries provide their own portable versions of the CLtL2 protocol, or that they have their own protocol, or something else?
<beach> s/not/note/
<beach> I guess the remark is about the fact that we discuss only cl-environment among portability libraries.
random-nick has joined #commonlisp
<beach> I guess hu.dwim has its own protocol and implementations of it for several Common Lisp implementations.
<beach> OK, so let me ask this instead. What portable code walkers do people here know? hu.dwim.walker is one. Agnostic Lizard is another. Any others?
<random-nick> cl-ast?
<random-nick> actually it's spelled clast http://clast.sourceforge.net/
<beach> Thanks!
<beach> Perfect. It uses CLtL2 + Allegro extensions.
<beach> I can't seem to clone agnostic-lizard from GitLab.
eugercek has joined #commonlisp
<beach> "server certificate verification failed"
<beach> I don't understand what this means.
<beach> Oh, wait, I have a clue...
<beach> Nope.
<flip214> If I have a CL source form (a LAMBDA), is there a library that code-walks and runs it to annotate each individual subform with its result?
<_death> more walkers are in arnesi, iterate, screamer
<beach> _death: Thanks.
<attila_lendvai> beach, you probably need to update your https certificates
<attila_lendvai> beach, note that hu.dwim.walker was originally arnesi. it's straight our an arnesi repo clone, strippend down and renamed in the form of darcs commits.
<attila_lendvai> arnesi used to be this one monolithic package for all of segv's semi-generic CL hackings
<beach> attila_lendvai: I wish I knew what it meant that I need to update my https certificates.
<beach> attila_lendvai: Thanks for the information on hu.dwim.walker/arnesi.
<attila_lendvai> beach, IOW, probably some ssl-certificates package on your OS needs to be updated.
<beach> I followed the instructions I got from git clone, but I still can't download via https.
<attila_lendvai> at the time hu.dwim.walker was new, it was the most capable walker that i knew about. but clast, and a-l sounds new to me.
<random-nick> cl-cont also has an adhoc walker I think
<beach> For this paper, I am just interested in the protocol(s) they use for accessing the environment.
<beach> Not so much in the code walkers themselves.
<beach> I noticed hu.dwim has its own.
mogan90 has quit [Ping timeout: 256 seconds]
zacque has quit [Quit: Goodbye :D]
eugercek has quit [Remote host closed the connection]
Dynom has quit [Quit: WeeChat 3.4]
<beach> Am I reading the ITERATE code right that it can't walk MACROLET forms?
<_death> yes
<beach> Thanks.
<_death> example (iter (for i below 5) (collect (macrolet ((m () 'i)) (m))))
<beach> I see, yes.
Cena has joined #commonlisp
Bike has joined #commonlisp
s-liao has joined #commonlisp
tyson2 has joined #commonlisp
<attila_lendvai> among other things, iterate also doesn't update the lexenv with the variables it introduces. i wrote a few words about it: https://github.com/hu-dwim/hu.dwim.reiterate#why
<attila_lendvai> also added a readme for hu.dwim.walker
sabra_ has joined #commonlisp
eugercek has joined #commonlisp
sabra has quit [Ping timeout: 272 seconds]
azimut has quit [Ping timeout: 240 seconds]
azimut has joined #commonlisp
lisp123 has quit [*.net *.split]
shka has quit [*.net *.split]
aartaka has quit [*.net *.split]
Common-Lisp has quit [*.net *.split]
scymtym has quit [*.net *.split]
okflo has quit [*.net *.split]
russe` has quit [*.net *.split]
opcode has quit [*.net *.split]
easye has quit [*.net *.split]
Jach has quit [*.net *.split]
x88x88x has quit [*.net *.split]
derelict has quit [*.net *.split]
snits has quit [*.net *.split]
thomaslewis has quit [*.net *.split]
Nilby has quit [*.net *.split]
antoszka has quit [*.net *.split]
alanz has quit [*.net *.split]
borodust has quit [*.net *.split]
Andrew has quit [*.net *.split]
dilated_dinosaur has quit [*.net *.split]
saturn2 has quit [*.net *.split]
dstein64 has quit [*.net *.split]
[smlckz] has quit [*.net *.split]
luis has quit [*.net *.split]
phadthai has quit [*.net *.split]
EsoAlgo has quit [*.net *.split]
Fade has quit [*.net *.split]
lisp123 has joined #commonlisp
aartaka has joined #commonlisp
Common-Lisp has joined #commonlisp
shka has joined #commonlisp
russe` has joined #commonlisp
okflo has joined #commonlisp
scymtym has joined #commonlisp
opcode has joined #commonlisp
Jach has joined #commonlisp
easye has joined #commonlisp
derelict has joined #commonlisp
borodust has joined #commonlisp
EsoAlgo has joined #commonlisp
antoszka has joined #commonlisp
alanz has joined #commonlisp
snits has joined #commonlisp
Nilby has joined #commonlisp
thomaslewis has joined #commonlisp
x88x88x has joined #commonlisp
luis has joined #commonlisp
[smlckz] has joined #commonlisp
Fade has joined #commonlisp
phadthai has joined #commonlisp
dstein64 has joined #commonlisp
saturn2 has joined #commonlisp
Andrew has joined #commonlisp
dilated_dinosaur has joined #commonlisp
vcarvalho has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
azimut has joined #commonlisp
<vcarvalho> Hey there, does anyone have some experience with 3b/classimp? I was trying to import a gltf (.glb) asset with embedded textures and was having some trouble.
<pjb> flip214: cl-stepper could be modified to do that. Note that in case of loops, a form can have multiple results.
<pjb> flip214: in a way, cl-stepper does it, only the the annotation is done on the *standard-output* ;-)
<flip214> pjb: thanks
sabra_ has quit [Ping timeout: 250 seconds]
sabra_ has joined #commonlisp
<beach> attila_lendvai: Thanks. Yes, I saw that about ITERATE.
MajorBiscuit has quit [Ping timeout: 256 seconds]
MajorBiscuit has joined #commonlisp
sabra has joined #commonlisp
sabra_ has quit [Ping timeout: 256 seconds]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
s-liao has quit [Quit: Client closed]
s-liao has joined #commonlisp
silasfox has quit [Ping timeout: 256 seconds]
silasfox has joined #commonlisp
s-liao has quit [Client Quit]
Fare has joined #commonlisp
attila_lendvai has quit [Ping timeout: 256 seconds]
sabra has quit [Remote host closed the connection]
cosimone has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
cpape`` has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
mogan90 has joined #commonlisp
cage has joined #commonlisp
Cymew has quit [Ping timeout: 256 seconds]
notzmv has quit [Ping timeout: 245 seconds]
Fare has quit [Ping timeout: 272 seconds]
sander has quit [Ping timeout: 240 seconds]
sander has joined #commonlisp
jeosol has joined #commonlisp
waleee has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 240 seconds]
<qhong> is there a way to do some kind of partial evaluation in SBCL?
<qhong> say I have a recursive function that analyze one argument, I want all recursive call to be fully expanded if this argument is a constant
MajorBiscuit has joined #commonlisp
<mfiano> See #sbcl
<qhong> I just happen to only care about sbcl but a portable solution is also fine
<mfiano> There is none.
<_death> you can use a compiler macro
<qhong> _death: do I basically have to write the same definition twice using that approach?
<qhong> one for defun, one for define-compiler-macro…
<mfiano> Yes, with instructions on how to expand or decline to expand.
<_death> if the expansion needs to look the same, sure
<mfiano> Also what constitutes a constant.
<mfiano> You will need EVAL if you want to treat defconstant values as constants, since the compiler macro will see a symbol in this case.
<Fade> beach: weblocks uses cl-cont
<beach> OK, thanks!
ec_ has joined #commonlisp
<_death> qhong: there are of course libraries.. for example Partial in https://engineering.purdue.edu/~qobi/software/
<mfiano> I am once again saddened by the state of available graph theory libraries, and none are very great jumping off points. I am always forced to write ad-hoc implementations of the algorithms I need. Debating whether to do that again, for the small number of algorithms I need, or to add another crappy library to the pile.
attila_lendvai has joined #commonlisp
mogan90 has quit [Ping timeout: 240 seconds]
<mfiano> My usual goto, https://github.com/eschulte/graph would have been okay, had it been 1) portable (relies on a few implementations' custom hash table test support), 2) supported more than numeric/symbolic nodes (presumably due to #1).
mgl has quit [Ping timeout: 256 seconds]
<qhong> _death: Nice, thanks. I wonder if it’s a “shallow” implementation or it’s a full meta circular evaluator though, the latter is less than ideal.
<pjb> You don't need eval, just symbol-value: (defconstant +foo+ 42) (symbol-value '+foo+) #| --> 42 |#
notzmv has joined #commonlisp
ioa has joined #commonlisp
v88m has quit [Ping timeout: 256 seconds]
MajorBiscuit has quit [Ping timeout: 240 seconds]
v88m has joined #commonlisp
Catie has joined #commonlisp
morganw has quit [Remote host closed the connection]
vcarvalho has quit [Quit: Client closed]
euandreh has joined #commonlisp
Psybur has joined #commonlisp
<Psybur> What do I have to install to get ql-dist:install-dist ?
<Xach> Psybur: quicklisp
v88m has quit [Read error: Connection reset by peer]
<Xach> you can get quicklisp by downloading https://beta.quicklisp.org/quicklisp.lisp then loading it with cl:load. then follow the directions.
jealousmonk has joined #commonlisp
<Psybur> hmm i thought i had sbcl loading quicklisp by default. been a while since I busted it out
<Xach> if you have quicklisp loaded, you should have a function ql-dist:install-dist.
v88m has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
silasfox has quit [Quit: WeeChat 3.4]
<Psybur> Went through https://astraybi.wordpress.com/2015/08/02/how-to-install-slimesbclquicklisp-into-emacs/ and got quicklisp loading automatically with slime and sbcl
silasfox has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
Cena has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eugercek has quit [Remote host closed the connection]
eugercek has joined #commonlisp
eugercek has quit [Remote host closed the connection]
Dynom has joined #commonlisp
igemnace has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
Cena has joined #commonlisp
Oladon has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 240 seconds]
kpoeck has joined #commonlisp
Lord_of_Life_ is now known as Lord_of_Life
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
azimut has quit [Ping timeout: 240 seconds]
azimut has joined #commonlisp
Devon has quit [Remote host closed the connection]
silasfox has quit [Ping timeout: 240 seconds]
silasfox has joined #commonlisp
mogan90 has joined #commonlisp
Oladon has quit [Quit: Leaving.]
Guest74 has joined #commonlisp
kpoeck has quit [Quit: Client closed]
tyson2 has joined #commonlisp
eugercek has joined #commonlisp
kpoeck has joined #commonlisp
mgl has joined #commonlisp
rogersm has joined #commonlisp
attila_lendvai has quit [Ping timeout: 252 seconds]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<dbotton> _death This is a link to a tutorial I have been working on for the database stuff in CLOG I mentioned the other day - https://docs.google.com/document/d/185Sh9rMhSCEwt14chbn4_gi0CV6xwWs8Z59rUvEWCN8/edit?usp=sharing
rogersm has quit [Quit: Leaving...]
amb007 has quit [Read error: Connection reset by peer]
mgl has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
Dynom has quit [Quit: WeeChat 3.4]
kpoeck has quit [Quit: Client closed]
cosimone has quit [Ping timeout: 250 seconds]
wyrd has quit [Ping timeout: 240 seconds]
hashfunc107e has joined #commonlisp
wyrd has joined #commonlisp
qhong has quit [Read error: Connection reset by peer]
qhong has joined #commonlisp
Cena has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aartaka has quit [Ping timeout: 240 seconds]
gamaliel has joined #commonlisp
<gamaliel> Hi, just want to say thank you for all the help I've received in this channel. I'm a CL newbie still wrapping my head around some concepts, but I'm slowly improving. It's not as easy to find tutorials or guidelines as for other languages, but my experience in this chat has been top-notch.
<hashfunc107e> gamaliel: +100
<dbotton> 👍
<hashfunc107e> is there a way to keep the "#:" in the string "IN-PACKAGE #:TEST" when using format like so: ... (format nil "~A" '(IN-PACKAGE #:TEST)) ...
<hashfunc107e> instead, the output of ... (format nil "~A" '(IN-PACKAGE #:DOP)) ... is "(IN-PACKAGE TEST)"
Cena has joined #commonlisp
greyrat_ has quit [Ping timeout: 240 seconds]
greyrat has joined #commonlisp
<hashfunc107e> in other words:
<mfiano> Well, you are printing the string ~a[esthetically]
<hashfunc107e> (format nil "~A" '(IN-PACKAGE #:TEST)) => "(IN-PACKAGE TEST)"
<hashfunc107e> i would like:
<hashfunc107e> (format nil "~A" '(IN-PACKAGE #:TEST)) => "(IN-PACKAGE #:TEST)"
<mfiano> You cannot do that with ~a
<hashfunc107e> mfiano: how do i do it?
<mfiano> ~s is one way.
<hashfunc107e> thanks
<hashfunc107e> that's what i was looking for
mogan90 has quit [Ping timeout: 260 seconds]
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 250 seconds]
aartaka has joined #commonlisp
<gamaliel> Could anyone recommend me a good resource on how to use streams? Thanks.
random-nick has quit [Ping timeout: 240 seconds]
zacque has joined #commonlisp
igemnace has quit [Remote host closed the connection]
minion has quit [Read error: Connection reset by peer]
specbot has quit [Remote host closed the connection]
specbot has joined #commonlisp
minion has joined #commonlisp
<Guest74> what do you want to do with streams? make your own?
<gamaliel> Kind of. For example, suppose I have a program that outputs in tcl. Could I use a stream to capture said tcl and feed it to ltk widgets? And if so, how?
<Guest74> sorry, I don't know ltk.
<Guest74> have you tried looking at their documentation?
pranavats has left #commonlisp [Error from remote client]
<|3b|> streams are the main IO abstraction in CL, so if you are doing IO to/from lisp you are probably doing so using streams (or using some sort of extension like direct FFI to OS APIs, or shared memory, or whatever). that may or may not apply to that specific case, but sounds reasonably likely you could do that with streams
<|3b|> (assuming ltk lets you go past its abstractions to send raw tcl)
<|3b|> is your "program that outputs tcl" some lisp code running in your CL image, or an external executable that you run from lisp?
<gamaliel> An external executable, gnuplot. I looked up the code for the vgplot library, but it doesn't seem to return anything other than an empty string when run. However, I already have a nice layout built with ltk, to which I'd like to pass the gnuplot plot to. But without understanding streams and passing I/O between gnuplot and ltk, I'm stumped.
<gamaliel> The ltk documentation offers the mention of a two-way stream used to connect to ltk, but I've got no idea on how to get the executable's output to pass to a running "wish" session from ltk.
<Guest74> gnuplot doesn't output tcl though, as far as i know.
pranavats has joined #commonlisp
<|3b|> the extension you would use to run the external executable probably has an option to use streams for communication with that process (as ltk appears to be doing with wish), but if you just run it once and just want to get the output after it finishes, there is probably also an option to just do that and get back the output as a string
<|3b|> which would be simpler than doing so yourself
<|3b|> but before looking into the details of that, probably should try to figure out if ltk either doesn't care if you mess with its internal streams, or if it provides some way to send raw tcl through the API
<gamaliel> Gnuplot uses "set terminal tkcanvas" to output in tcl.
<hashfunc107e> what is the idiomatic way to grab all CARs in an assoc list? e.g., ... '((1 . 2) (3 . 4) (5 . 6)) => '(1 3 5)
<|3b|> hashfunc107e: (mapcar 'car alist)? it wouldn't be a literal (quoted) list though
<gamaliel> |3b|: I think it's through the API, but I'm still new to this "stream" thing. If I wanted to output a string, I need to push to ltk's input stream, am I correct?
<hashfunc107e> |3b|: yup, that works like a charm
<hashfunc107e> thanks
<|3b|> IO in CL is "streams". files, terminal, etc, so READ,WRITE,FORMAT,etc all operate on streams
<|3b|> but if something is expecting to maintain state with a process on the other side of a stream, sending random garbage through that stream without telling it might cause that state to get out of sync, so i'd be suspicious of "just write to the internal stream"
<gamaliel> |3b|: I'm just confused. I think it wouldn't be difficult if I could visualize it. In R I've used connections, but they are mostly transparent to the users, and the equivalent of pipes is just as confusing to me.
<gamaliel> I wish I knew how to "grab" the output from gnuplot and feed it to the "input" in the tkcanvas I created.
<Guest74> well, that's exactly what vgplot does.
Cena has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gamaliel> Guest74: Does it? I always get an additional window, but the tkcanvas doesn't seem to grab the commands.
<Guest74> it has its own separate connection.
<|3b|> well, if nothing else, presumably it is doing what you want to do so shows how to do so :)
<gamaliel> Guest74: So, an input stream from the tkcanvas I created? May look into that. Thank you.
<|3b|> but for the first part, "grab the output from gnuplot" is probably trivial. tell the function you call to run gnuplot to give you the stdout of the subprocess as a string
<Guest74> i don't understand that.  but as 3b reiterated, vgplot communicates with gnuplot, get's the output and sends it, just like you want so it will teach you how to do it.
<|3b|> if you want to keep gnuplot open and get responses to individual commands instead of waiting for the subprocess to finish, then it is a bit harder
<|3b|> in that case, you tell the function you call to run gnuplot to give you streams attached to the stdin and stdout of the subprocess. you can then read and write to those streams as you would any file
<gamaliel> |3b|: That is mostly what I want. It's meant to be an interactive plot, in which a person changes some parameters and when they press replot, the canvas updates.
<|3b|> (possibly with some complications to avoid blocking, or run in another thread if you told the function to block, etc)
<|3b|> but there seem to be at least 3 or 4 libs for talking to gnuplot from CL, so probably easiest to let one of them deal with that stuff for you
<|3b|> and since at least one of them also talks to ltk, probably start there :)
aartaka has quit [Ping timeout: 260 seconds]
aartaka has joined #commonlisp
<gamaliel> I should probably read the code from cgn. After all, a full-fledged library for just a single canvas sounds like overkill to me. Plus, this is just a learning project for myself only.
<Guest74> if you're lucky, it would simply be a matter of rebinding the ltk stream that vgplot uses to the one that you use.
<Guest74> though I'm still not understanding if you're writing a user interface to vgplot or to gnuplot.
<gamaliel> To gnuplot, I just was using vgplot as a reference to understand how it all worked. It's for learning purposes.
<gamaliel> They seem to push things to (plot-stream act-plot) which is simply pushing to the gnuplot stream created from ltk:do-execute.
hashfunc107e has quit [Ping timeout: 240 seconds]
orestarod has joined #commonlisp
<gamaliel> But, I want the gnuplot output to show up in a tk-canvas I defined using ltk instead of a new window.
<|3b|> ok, looks like ltk:do-execute is a way to run a subprocess that doesn't have an option for waiting for it to finish, and returns a stream for stdin/stdout
<|3b|> so that covers that option for talking to gnuplot
<gamaliel> Yep. It's supposedly a two-way stream, but I don't know how those work. If I input it a command, does it update the output according the input I just passed?
<|3b|> looking at vgplot code, not sure it does things the way you want it to, it might parse output and then draw it manually instead of sending tk code from gnuplot?
<Guest74> as I understand it now, gnuplot does the window, not vgplot.
<gamaliel> |3b|: that is correct.
<|3b|> if you have a stream S from do-execute, then (format S "whatever~%") would write the line whatever (with a newline) into STDIN of the subprocess started by do-execute
<gamaliel> Guest74: correct.
<|3b|> (READ-LINE S) would (try to) return a string containing one line of whatever the subprocess had written to STDOUT
<|3b|> (it might wait indefinitely if subprocess hasn't written anything, etc)
<Guest74> I would just swallow the window, though I don't know how ltk does that or if they can.
<gamaliel> |3b|: Oh, so it could (presumably) get the (presumed) tk output from gnuplot if I fed it with some gnuplot commands?
<|3b|> similarly READ-CHAR to wait for 1 character, READ-CHAR-NO-HANG to return immediately if there is nothing
<|3b|> right, you would send command to gnuplot by writing to the stream, and get the output by reading from that stream
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
<gamaliel> |3b|: Ok, perfect.
<gamaliel> The remaining issue is "does the tkcanvas I created with ltk offer some sort of stream I can write to or is it some other way?"
<|3b|> right
<gamaliel> I just downloaded the code from cgn to check their implementation and see if it does what I want. Thank you very much, |3b| and Guest74.
gamaliel2 has joined #commonlisp