jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
X-Scale has joined #commonlisp
char has joined #commonlisp
yitzi has quit [Remote host closed the connection]
phantomics_ has quit [Read error: Connection reset by peer]
phantomics has joined #commonlisp
phantomics_ has joined #commonlisp
phantomics has quit [Read error: Connection reset by peer]
random-nick has quit [Ping timeout: 246 seconds]
phantomics_ has quit [Ping timeout: 246 seconds]
phantomics has joined #commonlisp
phantomics has quit [Read error: Connection reset by peer]
phantomics has joined #commonlisp
spdegabrielle has quit [Quit: Connection closed for inactivity]
rtypo has quit [Ping timeout: 252 seconds]
droideqa has joined #commonlisp
spdegabrielle has joined #commonlisp
amb007 has joined #commonlisp
phantomics has quit [Remote host closed the connection]
phantomics has joined #commonlisp
amb007 has quit [Ping timeout: 265 seconds]
char has quit [Ping timeout: 265 seconds]
arcturus2 has joined #commonlisp
<arcturus2> nick Hartian
arcturus2 has quit [Client Quit]
JuanDaugherty has joined #commonlisp
kevingal has quit [Ping timeout: 260 seconds]
<paulapatience> What is the proper way to implement PRINT-OBJECT such that it honors *PRINT-READABLY*?
<paulapatience> Should it be (format stream "#.~S" form) or is plain prin1 ok?
<bike> the idea is that (read-from-string (write-to-string foo)) gets you something similar to foo
<bike> if you print a (make-instance ...) form, the read-from-string will just return that form
<bike> which obviously isn't anything like the original object
<bike> so yeah, you need the #.
<paulapatience> Would it be unusual to print the form without preceding #. if *PRINT-READABLY* is NIL, and with #. if non-NIL? I'd find the #. noisy if it were always there.
<bike> if print readably is nil i would just not print a form at all
<bike> do print-unreadable-object and put whatever slot info you want, freed from the constraint of having to make a similar object
<bike> e.g. you could write #<POINT 3.7 9.2 8.1>
<bike> or #<POINT (3.7, 9.2, 8.1)>. or whatever
troojg has joined #commonlisp
<paulapatience> Ok, I'll do that. Thanks.
<paulapatience> I guess one thing I like about printing as a form is that it gives the line wrapping for free. I have to figure out what format directives to use for that.
<bike> the funky pretty printer ones, but "free" gets complicated.
jonatack has joined #commonlisp
JuanDaugherty has quit [Quit: JuanDaugherty]
troojg has quit [Remote host closed the connection]
troojg has joined #commonlisp
meaty has quit [Quit: touch grass]
<paulapatience> Ok, ~@< ... ~:@> is the one I want
<paulapatience> I used to use it everywhere but got annoyed at some indentation sometimes. I guess in print-object it is pretty useful.
meaty has joined #commonlisp
troojg has quit [Ping timeout: 260 seconds]
<paulapatience> bike: What is the standard way to deal with symbols and lists when trying to print-readably?
<paulapatience> In my paste above, if we provide a symbol instead of a number to the point, write-to-string prints the symbol without a preceding quote character
<paulapatience> So read-from-string complains about the variable being undefined
<paulapatience> And lists cause problems too
<paulapatience> Do lists and symbols have to be dealt with correctly recursively?
foreignmonk has joined #commonlisp
foreignmonk has joined #commonlisp
foreignmonk has quit [Changing host]
Akbar-Birbal has joined #commonlisp
spdegabrielle has quit [Quit: Connection closed for inactivity]
<bike> paulapatience: that's not a printing problem, it's a problem with the fact your form. you have `(:x ,x) but you need `(:x ',x).
<bike> a problem with your form*
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 265 seconds]
<paulapatience> Ohhhhhhh
<paulapatience> I have been thinking on and off about that issue for months
<paulapatience> Thank you!!
<paulapatience> The readability suffers a bit when using it unconditionally, e.g., '"bla" or '#(...), supposing I wanted to print it readably all the time.
<paulapatience> The only types that would actually need the quote are non-keyword, non-constant symbols, and lists, right?
<bike> Yes
<bike> (needs-quote-p x) = (or (consp x) (symbolp x)), or (or (consp x) (and (symbolp x) (not (constantp x)))) if you really want. pretty simple
<paulapatience> Right, because keywords are constant
<paulapatience> Yep, I'm going to do that
<paulapatience> Thanks for all the help
<bike> you are welcome
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 248 seconds]
Lord_of_Life_ is now known as Lord_of_Life
Ruby2 has quit [Quit: ZNC - https://znc.in]
Ruby has joined #commonlisp
decweb has quit [Ping timeout: 248 seconds]
foreignmonk has quit [Read error: Connection reset by peer]
johnjaye has quit [Read error: Connection reset by peer]
Pixel_Outlaw has quit [Quit: Leaving]
wacki has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 265 seconds]
prokhor_ has joined #commonlisp
prokhor has quit [Ping timeout: 245 seconds]
char has joined #commonlisp
alcor has joined #commonlisp
meaty has quit [Quit: touch grass]
meaty has joined #commonlisp
benjaminl has quit [Read error: Connection reset by peer]
benjaminl has joined #commonlisp
quidnunc has quit [Ping timeout: 248 seconds]
amb007 has joined #commonlisp
synchromesh has quit [Quit: WeeChat 4.0.5]
skeemer has joined #commonlisp
wbooze has joined #commonlisp
wbooze has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 252 seconds]
synchromesh has joined #commonlisp
amb007 has joined #commonlisp
attila_lendvai has joined #commonlisp
char has quit [Read error: Connection reset by peer]
skeemer has quit [Ping timeout: 260 seconds]
jadzi has joined #commonlisp
alcor has quit [Ping timeout: 265 seconds]
alternateved has joined #commonlisp
X-Scale has quit [Ping timeout: 256 seconds]
attila_lendvai has quit [Ping timeout: 252 seconds]
alcor has joined #commonlisp
donleo has joined #commonlisp
treflip has joined #commonlisp
King_julian has joined #commonlisp
ingeniot has joined #commonlisp
pve has joined #commonlisp
X-Scale has joined #commonlisp
treflip` has joined #commonlisp
treflip has quit [Ping timeout: 248 seconds]
rtypo has joined #commonlisp
varjag has joined #commonlisp
X-Scale has quit [Ping timeout: 256 seconds]
euandreh has quit [Quit: euandreh]
shka has joined #commonlisp
treflip` has quit [Ping timeout: 252 seconds]
treflip` has joined #commonlisp
King_julian has quit [Ping timeout: 265 seconds]
treflip` has quit [Ping timeout: 260 seconds]
random-nick has joined #commonlisp
King_julian has joined #commonlisp
jadzi has quit [Ping timeout: 276 seconds]
Th30n` has quit [Ping timeout: 252 seconds]
cage has joined #commonlisp
cage has quit [Excess Flood]
cage has joined #commonlisp
ingeniot has quit [Ping timeout: 256 seconds]
ingeniot has joined #commonlisp
chomwitt has joined #commonlisp
foreignmonk has joined #commonlisp
foreignmonk has quit [Changing host]
foreignmonk has joined #commonlisp
dino_tutter has quit [Remote host closed the connection]
dino_tutter has joined #commonlisp
alexander1 has joined #commonlisp
edgar-rft_ has joined #commonlisp
edgar-rft has quit [Ping timeout: 264 seconds]
decweb has joined #commonlisp
chomwitt has quit [Ping timeout: 246 seconds]
cmack has joined #commonlisp
King_julian has quit [Ping timeout: 246 seconds]
jonatack has quit [Ping timeout: 252 seconds]
King_julian has joined #commonlisp
King_julian has quit [Ping timeout: 276 seconds]
King_julian has joined #commonlisp
King_julian has quit [Ping timeout: 248 seconds]
King_julian has joined #commonlisp
reb has quit [Remote host closed the connection]
donleo has quit [Ping timeout: 248 seconds]
josrr has joined #commonlisp
jadzi has joined #commonlisp
<shka> hi all
<shka> what is the best way to get lsit of all symbols from a lisp source file?
<jackdaniel> I'd hack a reader to do that
<beach> I would say, use Eclector and program it to collect symbols.
<jackdaniel> but surely eclector gives you that w/o hacking
<beach> It does.
<jackdaniel> you just need to study its api
<jackdaniel> (small matter of learning)
<beach> Just stick a method on the relevant generic function.
<beach> Let me find it for you...
<beach> INTERPRET-SYMBOL
<beach> I guess define an :AROUND method, call (CALL-NEXT-METHOD) and the value should be the symbol.
jonatack has joined #commonlisp
molson__ has joined #commonlisp
<shka> beach: awesome, let my try it
<shka> i never needed portable common lisp reader before ^_^"
molson_ has quit [Ping timeout: 246 seconds]
<shka> beach: simply calling read -> alexandria:flatten -> remove-if-not #'symbolp appears to work
<shka> well, it polutes output with Eclector symbols, but that's ok
<shka> thanks!
<beach> Sure.
<bike> that won't get symbols from e.g. inside literal vectors, which may or may not matter to you
King_julian has quit [Ping timeout: 246 seconds]
<beach> Good point.
foreignmonk has quit [Read error: Connection reset by peer]
HER is now known as hernan
skeemer has joined #commonlisp
hernan is now known as HER
<shka> bike: ah! right!
treflip has joined #commonlisp
zxcvz has joined #commonlisp
treflip has quit [Read error: Connection reset by peer]
zxcvz has quit [Remote host closed the connection]
treflip has joined #commonlisp
lucasta has joined #commonlisp
ingeniot has quit [Quit: Client closed]
chomwitt has joined #commonlisp
alexander1 has quit [Ping timeout: 265 seconds]
jonatack has quit [Ping timeout: 252 seconds]
synchromesh has quit [Read error: Connection reset by peer]
NotThatRPG has joined #commonlisp
synchromesh has joined #commonlisp
donleo has joined #commonlisp
synchrom1 has joined #commonlisp
synchromesh has quit [Ping timeout: 272 seconds]
ingeniot has joined #commonlisp
drewjose has quit [Ping timeout: 255 seconds]
drewjose has joined #commonlisp
robin is now known as ROBIN
ROBIN is now known as robin
mm007emko has quit [Ping timeout: 264 seconds]
mm007emko has joined #commonlisp
varjag has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.3)]
treflip has quit [Remote host closed the connection]
mwnaylor has joined #commonlisp
<younder> How do I get a thread to be called periodically with period P?
<beach> What does it mean for a thread to be "called"?
jadzi has quit [Ping timeout: 252 seconds]
<younder> My best guess I ask the Linux kernel to give a signal. That connects to a callback that calls a poll function.
<NotThatRPG> younder: Do you need a thread for this? I worked on a project that did something like this and that program was single-threaded: it had a signal handler and that signal handler just set a protected variable and exited. The main loop would periodically check that variable and act accordingly.
<NotThatRPG> This was in SBCL which, at least at the time, had a lot of stuff in it that was not thread-safe.
<NotThatRPG> (ISTR some problems with READ-LINE... but the memories have faded)
<younder> Well the idea is just to read some files and get temperature data from the Motherboard, put in Markov chains. The Clim thread then periodically reads the chains and updates the temperature graphs.
spdegabrielle has joined #commonlisp
<fourier> can't you use sbcl's timers for that?
<younder> sb-ext:make-timer looks promising
<nil> younder: why not just sleep in the thread?
X-Scale has joined #commonlisp
<scymtym> mcclim can generate an event after a specified amount of time has elapsed
lucasta has quit [Quit: Leaving]
mwnaylor has quit [Remote host closed the connection]
mwnaylor has joined #commonlisp
mwnaylor has quit [Remote host closed the connection]
<jackdaniel> and there's in the owen an interface that enables a "pulse" at regular intervals
foreignmonk has joined #commonlisp
Pixel_Outlaw has joined #commonlisp
foreignmonk has quit [Changing host]
foreignmonk has joined #commonlisp
X-Scale has quit [Quit: Client closed]
<Shinmera> beach: your VisionFive 2 arrived. I'll set it up in the coming days.
ingeniot has quit [Quit: Client closed]
X-Scale has joined #commonlisp
alcor has quit [Remote host closed the connection]
alcor has joined #commonlisp
attila_lendvai has joined #commonlisp
lagash has joined #commonlisp
jonatack has joined #commonlisp
Akbar-Birbal has left #commonlisp [#commonlisp]
ym has joined #commonlisp
foreignmunk has joined #commonlisp
molson_ has joined #commonlisp
paulapatience_ has joined #commonlisp
HerlockSholmes_ has joined #commonlisp
payphone_ has joined #commonlisp
\f_ has joined #commonlisp
gosha__ has joined #commonlisp
nytpu_ has joined #commonlisp
slondr_ has joined #commonlisp
jmbr_ has joined #commonlisp
sirufer_ has joined #commonlisp
whereiseveryone_ has joined #commonlisp
kvik_ has joined #commonlisp
sm2n_ has joined #commonlisp
x4d6165_ has joined #commonlisp
ajoberstar_ has joined #commonlisp
rahmanlar_ has joined #commonlisp
griffinmb__ has joined #commonlisp
jdz_ has joined #commonlisp
cracauer_ has joined #commonlisp
fristed` has joined #commonlisp
jdz has quit [*.net *.split]
foreignmonk has quit [*.net *.split]
molson__ has quit [*.net *.split]
cmack has quit [*.net *.split]
phadthai has quit [*.net *.split]
rahmanlar has quit [*.net *.split]
\f has quit [*.net *.split]
dustinm`_ has quit [*.net *.split]
payphone has quit [*.net *.split]
kvik has quit [*.net *.split]
x4d6165 has quit [*.net *.split]
nytpu has quit [*.net *.split]
sm2n has quit [*.net *.split]
slondr has quit [*.net *.split]
HerlockSholmes has quit [*.net *.split]
jmbr has quit [*.net *.split]
gosha_ has quit [*.net *.split]
ajoberstar has quit [*.net *.split]
whereiseveryone has quit [*.net *.split]
sirufer has quit [*.net *.split]
paulapatience has quit [*.net *.split]
kagevf has quit [*.net *.split]
cross has quit [*.net *.split]
cracauer has quit [*.net *.split]
griffinmb_ has quit [*.net *.split]
smlckz has quit [*.net *.split]
fristed has quit [*.net *.split]
lucerne has quit [*.net *.split]
selpoke has quit [*.net *.split]
x4d6165_ is now known as x4d6165
nytpu_ is now known as nytpu
HerlockSholmes_ is now known as HerlockSholmes
paulapatience_ is now known as paulapatience
cracauer_ is now known as cracauer
rahmanlar_ is now known as rahmanlar
\f_ is now known as \f
sirufer_ is now known as sirufer
fristed` is now known as fristed
slondr_ is now known as slondr
payphone_ is now known as payphone
ajoberstar_ is now known as ajoberstar
whereiseveryone_ is now known as whereiseveryone
gosha__ is now known as gosha_
jmbr_ is now known as jmbr
sm2n_ is now known as sm2n
kvik_ is now known as kvik
dustinm`_ has joined #commonlisp
phadthai has joined #commonlisp
cmack has joined #commonlisp
kagevf has joined #commonlisp
smlckz has joined #commonlisp
cross has joined #commonlisp
lucerne has joined #commonlisp
selpoke has joined #commonlisp
cross has quit [Max SendQ exceeded]
mwnaylor has joined #commonlisp
cross has joined #commonlisp
kevingal has joined #commonlisp
johnjaye has joined #commonlisp
foreignmunk has quit [Quit: Leaving]
gioyik has joined #commonlisp
mgl has joined #commonlisp
mm007emko has quit [Ping timeout: 265 seconds]
bigbookofbug has quit [Quit: Lost terminal]
bigbookofbug has joined #commonlisp
mgl has quit [Ping timeout: 245 seconds]
josrr has quit [Remote host closed the connection]
mwnaylor has quit [Remote host closed the connection]
mwnaylor has joined #commonlisp
meaty has quit [Read error: Connection reset by peer]
meaty has joined #commonlisp
yitzi has joined #commonlisp
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 260 seconds]
ym has quit [Ping timeout: 265 seconds]
yitzi has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
X-Scale has quit [Quit: Client closed]
mm007emko has joined #commonlisp
molson has joined #commonlisp
molson_ has quit [Ping timeout: 246 seconds]
cage has quit [Quit: rcirc on GNU Emacs 29.4]
X-Scale has joined #commonlisp
jadzi has joined #commonlisp
dra has joined #commonlisp
dra has quit [Changing host]
dra has joined #commonlisp
johnjaye has quit [Ping timeout: 272 seconds]
johnjaye has joined #commonlisp
amb007 has quit [Ping timeout: 260 seconds]
droideqa has quit [Quit: Connection closed for inactivity]
jadzi has quit [Ping timeout: 272 seconds]
djuber` has joined #commonlisp
amb007 has joined #commonlisp
edgar-rft_ is now known as edgar-rft
amb007 has quit [Ping timeout: 248 seconds]
pve has quit [Quit: leaving]
attila_lendvai_ has quit [Ping timeout: 260 seconds]
dim has quit [Ping timeout: 248 seconds]
skeemer has quit [Ping timeout: 260 seconds]
dim has joined #commonlisp
wacki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
prokhor_ has quit [Remote host closed the connection]
dra has quit [Quit: Leaving]
<paulapatience> Is there a word that means "stream or pathname"? Something like input-output designator. Would it be outlandish to use stream for that?
<bike> stream designator?
alternateved has quit [Remote host closed the connection]
<bike> well, no, a pathname doesn't work for that
<paulapatience> I was thinking of that, but in the glossary, stream designator specifically excludes pathames
<paulapatience> Yeah
amb007 has joined #commonlisp
<bike> there's a pathname designator, which is either a pathname, a namestring, or a file stream
<bike> but i'm not sure what you're using this for
<bike> a pathname can be pretty much anything, it doesn't have to correspond to an actual file. you can't use it for I/O
<paulapatience> I'm naming a generic function which will convert a pair of input and output parameters into the form necessary for a command-line program to be run by uiop:run-program.
<paulapatience> The input and output parameters may be pathnames or even streams not associated to files
<paulapatience> I was thinking of something like (defgeneric streams (client input output)), which would return some object that is later converted into a form used by uiop:run-program
<paulapatience> The distinction between them is that an input stream would be plugged into the program's stdin, but an input pathname could be passed as command-line argument
amb007 has quit [Ping timeout: 248 seconds]
gioyik has quit [Quit: WeeChat 4.4.2]
alcor has quit [Ping timeout: 246 seconds]
symdrome has joined #commonlisp
symdrome has quit [Remote host closed the connection]
donleo has quit [Ping timeout: 248 seconds]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
troojg has joined #commonlisp
<paulapatience> Heh, ALGOL 68 called input/output "transput"
<Pixel_Outlaw> I was reading about ALGOL 68 earlier today. Apparently they even had first class functions. Then the world got nuked backwards for a long time with half hearted procedural languages.
<aeth> Pixel_Outlaw: with closures?
<aeth> higher order, first class functions, with closures?
shka has quit [Ping timeout: 248 seconds]
<Pixel_Outlaw> Dunno about that. It's hard to approach CL's level of functional power.
<aeth> my guess why these took so long to catch on is because you almost _need_ GC for it to work
<Pixel_Outlaw> Java is still eating paste when it comes to first class functions. :}
* Pixel_Outlaw digresses
<aeth> yes, why languages that could've done it in the 90s didn't is a separate question
<bike> algol 68 has downward funargs but not upwards, as far as i understand. so you can have closures but only with dynamic extent.
<bike> but they're otherwise first class. closures are the basis of knuth's man-or-boy test for algol 60.
<bike> limiting it to dynamic extent is also how you get away with doing this without a GC. i mean, you can do it in C, with gcc extensions