<shka>
phoe: what are your role in this publishing process?
<beach>
shka: "author"
<Gnuxie>
Author? Lol
<shka>
huh, i thought that this was book by edi
<beach>
The first edition was, yes.
<shka>
phoe wants to write additions?
<shka>
that's really cool
<Gnuxie>
(Bleh message was sent before beach bit bridge was slow sorry )
<beach>
Apress wants phoe to write the second edition.
<shka>
i have paperback of the first addition
<beach>
"edition", not "addition". :)
<shka>
beach: i mean, edition to make additions :D
<shka>
oh, now i see
<shka>
silly me
karlosz has quit [Quit: karlosz]
<beach>
wydanie? (says Google translate).
<lotuseater>
ah right CLR was also selled by Apress like "Programming Algorithm" by vsevolod
<moon-child>
an edition to edit!
<shka>
beach: yeah, yeah
<shka>
just something went haywire in my brain for a second
<shka>
that's all
<shka>
i am back to normal
<beach>
shka: Welcome to the club.
<shka>
the "normal" club? :D
<beach>
Possibly, yes.
<shka>
i must check what was in that book
<shka>
phoe: I think that the first edition of the Recipes book did not mention lparallel at all, and thats a shame because (at least for me) this is one of the most frequently used lisp libraries
<shka>
and has been for years at this point
<shka>
IMHO it would be valuable addition to the book
bpanthi977 has quit [Ping timeout: 268 seconds]
<shka>
especially since "use lparallel" seems to be an efficient solution to questions asked on #commonlisp
<shka>
so it is not just me
<shka>
phoe: i will let you know when i will come up with something else
rgherdt has joined #commonlisp
<lotuseater>
shka: but it does
<shka>
lotuseater: oh, so i've missed it?
z147 has joined #commonlisp
<shka>
sorry about that, i was checking "concurrency" chapter
<lotuseater>
it in 11-5. "Parallelizing Algorithms without Threads and Locks"
<lotuseater>
and now there's even this Software Transactional Memory Library STMX to achieve that: https://stmx.org/
<hayley>
But there are threads and locks in lparallel (or perhaps atomics). Though they aren't exposed to the lparallel user I guess.
<lotuseater>
yes that would make sense
<lotuseater>
as I see it lparallel builds on bordeaux-threads (and what does that build on?)
<hayley>
...or maybe they are. (defun contains-one-p (sequence) (lparallel:pmap 'nil (lambda (x) (when (= x 1) (return-from contains-one-p t))) sequence) nil) would not work obviously.
<lotuseater>
hmmm
<hayley>
bordeaux-threads just uses the threading facility your Lisp implementation provides.
<lotuseater>
okay makes also sense
<lotuseater>
so eg SB-THREAD
<shka>
oh
<shka>
lotuseater: yeah, how silly of me
<lotuseater>
ah don't say that :)
<lotuseater>
or there are libs like GREEN-THREADS
<hayley>
I like transactional memory, though it is somewhat slow in software, and no one can implement it in hardware apparently. There's also the livelock thing, but you can "fix" that by grabbing a global lock eventually.
tux0r has quit [Ping timeout: 245 seconds]
<shka>
hayley: SMX needs hardware support
<lotuseater>
hayley: it's more about safety and correctness :)
<shka>
but oddly enough there was only a small window when i had suitable CPU
<shka>
because haswell microcode took it away from me
<hayley>
shka: I thought STMX had a fallback software version too. At least that is what I got after (ql:quickload :stmx) or so.
hhdave has joined #commonlisp
<shka>
and then i moved to AMD
<shka>
oh, ok
tux0r has joined #commonlisp
<hayley>
lotuseater: I don't know if livelock is an improvement over deadlock, to be fair. But you could use it to "speculate" over coarse-grained locking too.
<lotuseater>
hmm okay I have to learn more about it. I came first in touch from where it origins, Haskell
scymtym has joined #commonlisp
<hayley>
The trick to that is that, say, if you never write any variables, all the "transactions" can appear in any order. So you can just use transactional memory rather than a proper lock.
<lotuseater>
yes being functional makes it a lot easier to reason about
<hayley>
That notion also extends to transactions which write places (rather than variables - my bad) which no other transactions read. And the hardware implementation of it is something like one bit per cache line.
<Josh_2>
I just added the macroexpansion to the paste
<shka>
pretty price book, but maybe i will get one
<Josh_2>
you can find online
yitzi has joined #commonlisp
<Bike>
Josh_2: i would guess that spinneret doesn't let you throw arbitrary forms in like that, but I don't know the system well enough to say with certainty
_whitelogger has joined #commonlisp
cage has joined #commonlisp
<pl>
A good use for that JSTOR access I recently found I have
<pl>
Turns out my university is old enough it doesn't believe in alumni having left it
waleee has quit [Ping timeout: 258 seconds]
mister_m has quit [Remote host closed the connection]
mister_m has joined #commonlisp
<Josh_2>
Bike: alrighty, i'll just yeet the macros
srhm has joined #commonlisp
lad has joined #commonlisp
brownjm has joined #commonlisp
brownjm has quit [Client Quit]
plds has joined #commonlisp
plds has quit [Client Quit]
selwyn has quit [Read error: Connection reset by peer]
peterhil has joined #commonlisp
bxtn has quit [Remote host closed the connection]
selwyn has joined #commonlisp
<jcowan>
pl: "Death will not release you -- even if you die."
<jcowan>
--standing rule 0 of the Los Angeles Science Fantasy Society, which prevents you from voting if your dues are unpaid, but otherwise only removes members by a vote of the membership and the board, separately
peterhil has quit [Ping timeout: 240 seconds]
shka has quit [Quit: Konversation terminated!]
shka has joined #commonlisp
lad has quit [Remote host closed the connection]
lad has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
dsk has joined #commonlisp
<jmercouris>
how can I check how many processor cores exist?
<jmercouris>
I seem to recall there was a library for this...
Lycurgus has joined #commonlisp
Lycurgus has quit [Remote host closed the connection]
<pl>
System dependant, but yeah, there was something for that
<jmercouris>
Yes, I just can't remember what it is called...
<pl>
jcowan: I found out about it when I noticed an invitation to vote in university administration... Turned out that t wasn't just alumni charity spam that I was getting
<jmercouris>
there we go serapeum:count-cpus
lisp123__ has quit [Remote host closed the connection]
lisp123_ has joined #commonlisp
lisp123_ has quit [Ping timeout: 258 seconds]
retropikzel has quit [Quit: Leaving]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
retropikzel has joined #commonlisp
retropikzel has quit [Client Quit]
Inline has joined #commonlisp
lisp-newbie has joined #commonlisp
<lisp-newbie>
Hi, interesting question, I'm trying to execute multiple prints from a let, or let* after the variable definitions, and every time I do, the program just seems to go into an infinite loop. I tried doing (progn exp1 exp2) but still get's stuck
<lisp-newbie>
Any ideas?
<Josh_2>
What? You should be able to do (let ((a "a") (b "b")) (print a) (print b))
<moon-child>
lisp-newbie: you definitely should not need progn; let* and let have an implicit progn
<lisp-newbie>
How do I print a macro in the real?
<Bike>
you can do (macroexpand-1 '(macro form here))
<lisp-newbie>
thanks
<Bike>
e.g. (macroexpand-1 '(defroute ...))
<Bike>
i don't know the particulars of defroute here, but this code doesn't look like it should be looping
<White_Flame>
FORMAT NIL prints to a string and returns it. FORMAT T should print to your visible output
<Bike>
i figured it was returning a string to send to the client or whatever
<moon-child>
^
<White_Flame>
ok
<Bike>
it's not really "printing" so in the context of the question it is kind of confusing
<lisp-newbie>
Don't seem to find it
<Bike>
What?
<lotuseater>
moon-child: a few days ago i stumbled over old ported SHRDLU code from Maclisp to CL. it seems they liked using PROG very much. and COND for also where IF, WHEN or UNLESS would be more clear
<lisp-newbie>
Bike, yeah, just the client waits forever
<lisp-newbie>
(macroexpand-1 'caveman2:defroute) gives me NIL
<sm2n>
maybe you are supposed to flush the request or something?
<lisp-newbie>
Other things I tried give me errors
<jasom>
Is there an iso-8601 parser for lisp already written? local-time can't handle things like "2021-W31-2T10:58:20"
<Bike>
lisp-newbie: okay, so i wrote (macroexpand-1 '(defroute ...))
<White_Flame>
also, if it goes into an infinite loop, your CPU should show 100% and your fans ramp up
<Bike>
lisp-newbie: what i meant was that you give macroexpand the entire form, and it returns the expansion
<Bike>
lisp-newbie: (macroexpand-1 'defroute) is nothing
<lisp-newbie>
Oh, thanks
<lisp-newbie>
Bike Got it, thought I could see the macro itself
<lisp-newbie>
One sec
<sm2n>
you can do that too, just do M-. on the name
lisp123_ has quit [Ping timeout: 252 seconds]
IPmonger has joined #commonlisp
gaqwas has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
<lisp-newbie>
Bike, can you please explain what to do inside the macro expand? I put a quote ' before the defroute and gave me errors
<Bike>
what did you use and what error did you get?
<lisp-newbie>
and before the let
<lisp-newbie>
illegal function call
<White_Flame>
copy/paste your entire '(defroute ...) form
<jcowan>
No WHEN or UNLESS in the Pitmanual (descendant of the Moonual). IF was available, but I suspectt it was a late introduction.
<lisp-newbie>
nope, get's stuck Josh_2
<Bike>
lisp-newbie: "gets stuck"? do you get an error? is it the same error?
<Josh_2>
yeh I never claimed it would work, thats just how you use macroexpand
<jcowan>
And no TAGBODY or BLOCK either, so it was fairly common for function bodies to be PROGs.
<Bike>
jcowan: the real primitive being COND i guess?
<lisp-newbie>
oh haha
<jcowan>
yes, as in Elisp today
<lisp-newbie>
meaning it got stuck
<Bike>
please be descriptive
<lisp-newbie>
I thought I had to quote every single thing inside the macro expand
<lisp-newbie>
I have an idea one sec
<Bike>
no just
<Bike>
just literally put in what josh_2 pasted
<Bike>
copy that text and paste it into your lisp
<Bike>
do not make any alterations
amb007 has quit [Ping timeout: 272 seconds]
<lisp-newbie>
still stuck in the macroexpand
amb007 has joined #commonlisp
<Bike>
what do you mean by
<Bike>
"stuck"
<Bike>
it halts? you get an error? lisp crashes?
<lisp-newbie>
one sec, will try again copy paste what Josh_2 wrote
<lisp-newbie>
oh, no, just the browser waits forever
<Bike>
the browser...? we're talking about doing this in your lisp repl
<Josh_2>
I think he means when a request is made to caveman
<lisp-newbie>
ok, just did what Josh_2 said again, now the browser still waits for a request forever... here's what I did. maybe I'm mising something...
<lisp-newbie>
erureka!
<lisp-newbie>
in the repl it worked
<lisp-newbie>
sorry I was doing it in the controller
<Bike>
well it doesn't seem like that's going to help
<Bike>
from glancing at the manual, i don't see any reason a route that just returns a string shouldn't work
attila_lendvai_ has joined #commonlisp
<Josh_2>
Yep
amb007 has joined #commonlisp
<Bike>
you could try something really basic like (defroute "/test" () "hello i am a test")
<Bike>
or something literally from the manual
<Bike>
and if that doesn't work, you must have something misconfigured
<Bike>
like trying to acccess the wrong port or whatnot
<lisp-newbie>
It's just when I have two "forms" (if that's what two function calls is) doing something
<lisp-newbie>
Bike that works
karlosz has joined #commonlisp
<lisp-newbie>
the defroute works if I keep the expressions to one
<lisp-newbie>
but as soon as I want to do some function and also return something, it breaks
<Bike>
Okay, what about (defroute "/test" () (print "hello") "world")
<lisp-newbie>
I'll give another example, let me test it
lisp123_ has joined #commonlisp
lisp123_ has quit [Ping timeout: 240 seconds]
azimut has quit [Remote host closed the connection]
akoana has joined #commonlisp
azimut has joined #commonlisp
<lisp-newbie>
Bike I need to track down whats happening, things that were working before are now broken, but other things seem to be working normally... I need some time... tried restarting the server
tyson2 has joined #commonlisp
<lisp-newbie>
is there a way to force compile the whole project again?
<White_Flame>
best to restart the image to clear everything out
<White_Flame>
because recompiling won't necessarily change any runtime state you've accumulated
<Josh_2>
restart your image then ql your package again
<lisp-newbie>
ok, before it was working, now it's not... here's the code and the macro expands
<lisp-newbie>
White_Flame Josh_2 just did it thanks
<lisp-newbie>
well one sec
karlosz has quit [Quit: karlosz]
selwyn has quit [Read error: Connection reset by peer]
pve_ has joined #commonlisp
lisp123_ has joined #commonlisp
pve has quit [Ping timeout: 268 seconds]
<lisp-newbie>
ok, weird. I closed the repl completely and restarted it again and waited a while for quicklisp to download all the dependencies, now things are working
<lisp-newbie>
Now I don't understand what happened. The compiling many times a few lines or a file broke things?
<lisp-newbie>
On a side question, is there a way for quicklisp to not have to download every dependency every single time but to download once and continue? like node_modules type caching?
<Josh_2>
it shouldn't be downloading every dependency everytime
<Josh_2>
it will load them but it shouldn't be downloading them
<lisp-newbie>
thanks a lot for the help and sorry for this. I learned new things like macroexpand! :D
h3ck3r9696 has joined #commonlisp
lisp123_ has quit [Ping timeout: 252 seconds]
lisp-newbie has quit [Quit: This computer has gone to sleep]
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Remote host closed the connection]
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Remote host closed the connection]
waleee has joined #commonlisp
tfeb has joined #commonlisp
lisp123_ has joined #commonlisp
MichaelRaskin has quit [Read error: No route to host]
tfeb has quit [Quit: died]
MichaelRaskin has joined #commonlisp
lisp123_ has quit [Ping timeout: 272 seconds]
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
lisp123_ has joined #commonlisp
nature has joined #commonlisp
rain3 has quit [Ping timeout: 245 seconds]
<jasom>
did ESRAP stop doing backtracking suddenly? I'm seeing (or X Y) fail to parse and (or Y X) succeed...
<MichaelRaskin>
ESRAP is packrat
<MichaelRaskin>
It must not do backtracking in such a situation, by specification
<MichaelRaskin>
Never did
<jasom>
that seems at odds with the description of "or" in the grammar. Is it not always true that if X can parse a string than (or Y X) can parse it regardless of what Y is?
<MichaelRaskin>
Depends on your settings (trailing-garbage-allowed or not), but in the latter case, which I think is the default, no
<jasom>
"An ordered choice succeeds if any of the subexpressions succeeds, and consumes all the input consumed by the successful subexpression. An ordered choice produces whatever the successful subexpression produces.:
<jasom>
does that not mean what I think it means?
<MichaelRaskin>
On the top-level, by default the check is success _and_ consumption of the entire input
<jasom>
oh
<jasom>
so if Y matches a substring of the input then that will prevent it from checking if X can parse the entire input
<MichaelRaskin>
Yes
<MichaelRaskin>
It might be that packrat is just not the parsing model that you want to use right now for the current task, that happens. All general parsing models there are are somewhat suboptimal, so check what fits what…
<jasom>
This is easily worked around by a followed-by
<MichaelRaskin>
If the or is at the top level, yes
<MichaelRaskin>
But this does not compose
<jasom>
in this case it does
<jasom>
I need to parse things like the following: T12:34 T1234 T12:34:56 I can just check for the version without the : first and ad a (! #\:) to resolve the ambiguitiy between T12 and T12:34:56
<MichaelRaskin>
If something works only at the top level, this is not exactly enough to say this solution composes well (say, under concatenation)
<jasom>
in no case will it ever be followed by a colon
pillton has joined #commonlisp
<jasom>
I suppose to really make it compose I should have a (! digit) in the version that expects colons.
<jasom>
then they can be used in any order safely
h3ck3r9696 has quit [Quit: Leaving]
akoana has quit [Ping timeout: 258 seconds]
akoana has joined #commonlisp
copec has joined #commonlisp
<jasom>
Indeed this works even for those perverse enough to store basic timestamps with a colon separator (e.g. T12:T12 as a pair of timestamps)
lisp123_ has quit [Quit: Leaving...]
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Client Quit]
lisp-newbie has joined #commonlisp
z147 has quit [Ping timeout: 244 seconds]
copec has quit [Ping timeout: 250 seconds]
copec has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
<nirnam>
I did (let ((..)) (defun ...)) to keep persistant variable between function call, am I doing it right? or does it have more convensional way to keep data between fcuntion call
<phoe>
nirnam: you did a closure, and that's an OK approach
<phoe>
if this data needs to be accessible from outside, you can instead hold it in a global variable
<_death>
it also plays better with redefinitions.. basically (let ... (defun ...)) is not a good idea
<nirnam>
I don't want to pollute the global var namespace with it internal, if this was an ok approach I'm fine with it
<phoe>
_death meant that every reevaluation of the LET form is going to reset your value to the initial one
<phoe>
whereas e.g. DEFVAR is going to hold it through redefinitions
<phoe>
also it's not really polluting it, just keep the global variable symbol internal to your package and don't export it
<_death>
there's no need to worry about "pollution" here.. just use a descriptive name (with earmuffs) and be done with it
<Bike>
_death: hey thanks for mentioning the new sussman book, i impulse bought it and love it so far
<nirnam>
I still want it to keep it internal to itself, I find it easy to reason when everything about a function is gather in the same place
<Bike>
just keep in mind that reevaluating/recompiling the file the definition is in will reset the state
<_death>
Bike: cool, it's a fun book :)
amb007 has quit [Ping timeout: 245 seconds]
<akoana>
what new Sussman book are you talking about?
<Bike>
software design for flexibility
amb007 has joined #commonlisp
<akoana>
ah, thank you
Josh_2 has quit [Ping timeout: 268 seconds]
nature has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 276 seconds]
attila_lendvai_ has quit [Ping timeout: 240 seconds]
lisp-newbie has quit [Quit: This computer has gone to sleep]
lisp-newbie has joined #commonlisp
selwyn has joined #commonlisp
<lisp-newbie>
Hi, does anyone know how to make in visible in a child class a variable which is defined in the parent?
<lisp-newbie>
I have a child, which in the package it's defined, I see all the slots. There are multiple slots that whenever I access them from another package are missing. I want one slot, but not the rest. Does anyone know how to do this?
<lisp-newbie>
I'm inherting from a package so I don't want to edit the parent class
karlosz has quit [Quit: karlosz]
rgherdt has quit [Ping timeout: 240 seconds]
<Bike>
lisp-newbie: it sounds like you may be confused about how packages work. packages only name symbols. classes (and slots, and accessor functions) are not related to packages except that they may be named, and then that name is a symbol in a package
<Bike>
lisp-newbie: try fully qualifying the symbols you're referring to - like write mypackage::slot-a
<Bike>
and slots a parent defines are definitely going to be available in the child (unless maybe if you're doing exotic MOP stuff, but you aren't)
<lisp-newbie>
Bike, thank you
<lisp-newbie>
I am trying a couple of things
karlosz has joined #commonlisp
cjb has joined #commonlisp
tankrim has quit [Ping timeout: 276 seconds]
pve_ has quit [Quit: leaving]
srhm has quit [Quit: Konversation terminated!]
<jeosol>
@Bike, that's a recent book that was out this year. For some reason, I was thinking it's an old book since Sussman is one of the authors
<jeosol>
Bike: have you gone through the book, any comments
<Bike>
i'm only on the second chapter, but yes, it's new
<jeosol>
Bike: That's great then. I should look it into it.
frgo has quit [Remote host closed the connection]
<jeosol>
Especially seeing that some of my design decisions painted me into a corner, with the thread and race issue I was getting. I have a partial fix for now to get things moving
Josh_2 has joined #commonlisp
frgo has joined #commonlisp
<mfiano>
I started reading it yesterday as well
<mfiano>
Was kind of annoyed at the pages of biological analogs, but i'm past that, about to where Bike is
<jeosol>
mfiano: ok, what's feedback so far, i guess minus the annoying part
<mfiano>
Haven't read enough of the meat to really comment yet
<jeosol>
ok
karlosz has quit [Quit: karlosz]
copec has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lisp-newbie has quit [Quit: This computer has gone to sleep]