easye has quit [Remote host closed the connection]
easye has joined #commonlisp
easye has quit [Remote host closed the connection]
bilegeek has quit [Quit: Leaving]
easye has joined #commonlisp
aartaka has quit [Ping timeout: 264 seconds]
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
Lord_of_Life_ is now known as Lord_of_Life
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 252 seconds]
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
pdietz has quit [Quit: Ping timeout (120 seconds)]
ogamita has quit [Read error: Connection reset by peer]
ogamita` has joined #commonlisp
thonkpod_ has quit [Ping timeout: 252 seconds]
thonkpod_ has joined #commonlisp
rgherdt has joined #commonlisp
euandreh has joined #commonlisp
euandreh has quit [Remote host closed the connection]
euandreh1 has joined #commonlisp
euandreh1 has quit [Remote host closed the connection]
random-nick has joined #commonlisp
tyson2 has joined #commonlisp
aartaka has joined #commonlisp
szkl has joined #commonlisp
jmdaemon has quit [Ping timeout: 260 seconds]
Ellenor is now known as Reinhilde
jeffrey has joined #commonlisp
akonai has quit [Ping timeout: 246 seconds]
<pve>
scymtym: Hi, I modified my map-tree-leaves to check for circular structures. It seems to work fine. Would you mind taking a look and see if I'm the right track here? Sorry to bug you about this :)
<scymtym>
pve: the overall shape looks fine. i can't verify the details right now
<pve>
scymtym: Thanks, that's all I need. You don't need to check details.
<phoe>
pve: L41-L42 is unnecessary
<phoe>
(cond (x) ...) returns X if it's truthy
<phoe>
also you don't use the secondary retval from GETHASH, which might matter in the edge case of NIL
nij- has joined #commonlisp
<pve>
pjb: I modified the readtable I showed the other day to consider |...| "escaped" with respect to exporting, i.e. it is up to the user to export if necessary. I feel it's a pretty reasonable approach. As for implicitly exporting defstruct functions like "COPY-Foo", I think that should also be left to the user, to keep things straightforward.
<phoe>
so I'd actually rewrite L38 like (mvb (value foundp) (gethash ...) (if foundp value (let ...)))
<mesaoptimizer>
how useful is roswell if you are just beginning with CL and just getting used to it?
<pve>
phoe: TIL that thing about cond, thanks
<phoe>
pve: there's the same sort of duplication in L54-L59, you do double hash table retrievals which is unnecessary
gxt_ has quit [Ping timeout: 255 seconds]
ec_ has quit [Remote host closed the connection]
gxt_ has joined #commonlisp
ec_ has joined #commonlisp
beach` has joined #commonlisp
<pve>
phoe: the seen-table should only contain conses, so I'm not sure a NIL could sneak in there, but I'll check it out
beach has quit [Killed (NickServ (GHOST command used by beach`!~user@2a01:cb19:150:3400:c4e1:2ec7:13ca:c744))]
beach` is now known as beach
<pve>
also how could I get rid of double gethashes i L54?
<pve>
anyway, the test file with some output is here, in case anyone is interested:
<_death>
if you have symbol designations "Name" and "name" in that file, will they refer to different symbols? and if you have another file that tries to designate the exported symbol in these two ways, will the results be different? does it also depend on whether it itself uses capitalized-export?
<pve>
_death: currently "Name" is interned and kept, but replaced with "NAME" in the tree. Also "name" will be inverted to "NAME" as per readtable-case :invert.
aeroplane has quit [Ping timeout: 268 seconds]
<pve>
users of the file will not need to know anything about this funny business, just refer to "NAME" normally (by typing "name" in the buffer)
<pve>
users will not need to use capitalized-export
<pve>
also slime's jump to definition works
<_death>
I suspected that this was the current behavior (I skimmed the code the other day), and this is why I ask these questions.. they are not about current behavior, but about desired behavior
<pve>
also you only need to capitalize once, I guess preferably in the definition
<pve>
_death: what is the desired behaviour :)
<_death>
that is for you to determine
<pve>
sure
<pve>
I think it's pretty close to what I set out to do
<_death>
if one capitalized-export user (in package bar) refers to foo:Name (another capitalized-export user), that will result in an error or exporting the symbol from bar, depending on whether it was accessible from bar?
notzmv has quit [Ping timeout: 265 seconds]
<_death>
the fact that foo was a capitalized-export user is incidental, as |FOO|:|NAME| is the symbol under discussion.. I guess the point is that the context of reference matters when deciding when to capitalize or not.. to export an accessible symbol you capitalize, and otherwise use you must not
<_death>
this is different from, say, Go, where both references have the same case
<pve>
_death: in my mind, capitalizing "Name" would have been equivalent to typing (export 'name) at the bottom of the file.
<pve>
but I see your point, these details should be considered
<_death>
anyway.. some minor things that jumped to me as I viewed the latest snippet are the first conjunct being unnecessary in string-capitalized-p (which should be renamed ;) and that same conjunct making sense in escaped-object-p
<pve>
oh, you're right, thanks
anticomputer has joined #commonlisp
<pve>
actually it should just check the first char, but I got confused about "1Foo" and such :)
<phoe>
that is apple branding rather than lisp code
gxt_ has quit [Ping timeout: 255 seconds]
<pve>
I guess I could just let the user deal with the weird cases
gxt_ has joined #commonlisp
<pve>
_death: Oh I think I see what you're saying. In the case of foo:Name it's going to intern "NAME" into *package* and try to export that.
<pve>
hmm
euandreh has joined #commonlisp
<pve>
that's not right
nij- has left #commonlisp [#commonlisp]
aartaka has quit [Ping timeout: 252 seconds]
q3cpma has joined #commonlisp
aartaka has joined #commonlisp
<q3cpma>
Hello, does anyone know how I would go about creating a lambda body dynamically? Basically (let ((body '(...))) (lambda (arg) body))
szkl has quit [Quit: Connection closed for inactivity]
<Shinmera>
(compile NIL `(lambda (arg) ,body))
<q3cpma>
I see, is that the only way? (not that I have anything against it, just curious)
<phoe>
a lambda form is just Lisp data
<phoe>
you can also (coerce `(lambda ...) 'function)
<q3cpma>
Yeah, there's the lambda symbol and macro, which did confuse me a bit
<phoe>
or, worst of all (eval `(lambda ...)) - but you almost never want this
<q3cpma>
Does it compile each time if I use eval?
<beach>
Depends on the implementation.
<q3cpma>
Guess so
<q3cpma>
(by the way, it's for today's Advent of Code, I wanted to build the "Operation" expression into a lambda)
<Bike>
if eval compiles at all, it will probably compile each time you call eval
<q3cpma>
Bike: I feared so, unless it did some kind of string hashing to cache expressions
<phoe>
there's no string hashing involved
<phoe>
none of the implementations I'm aware of do anything like that
<q3cpma>
Of course, I was speaking hypothetically
<_death>
you can often avoid general compilation/evaluation if the body is constrained, say it's just a function call (apply (car form) (cdr form))
<q3cpma>
Huh, didn't even think about this way
<q3cpma>
Was too much focused on bending CL to my first idea
aartaka has quit [Ping timeout: 246 seconds]
<_death>
(well, this one also assumes the arguments are already evaluated)
<q3cpma>
Since there are symbols involved (basically, the input is a string like "arg * 3")
<q3cpma>
I'll keep the lambda
<q3cpma>
Ah, too late =)
aartaka has joined #commonlisp
<_death>
a simple interpreter might work better if the body is evaluated once and delegates work to already compiled stuff
<q3cpma>
Might be, but I find the lambda simpler in my case
<_death>
sure.. I stopped doing AoC last year so I don't know what they're up to
sedzcat has joined #commonlisp
cage has joined #commonlisp
thuna` has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
q3cpma has quit [Quit: nyaa~]
seletz has quit [Ping timeout: 268 seconds]
additive has joined #commonlisp
aartaka has quit [Ping timeout: 248 seconds]
makomo has quit [Quit: WeeChat 3.6]
robin has quit [Quit: Leaving]
Devon has joined #commonlisp
puchacz has joined #commonlisp
sedzcat has quit [Quit: sedzcat]
sedzcat1 has joined #commonlisp
sedzcat1 is now known as sedzcat
Lycurgus has joined #commonlisp
x134110U has joined #commonlisp
x134110U has quit [Client Quit]
dipper has quit [Remote host closed the connection]
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
varjag has joined #commonlisp
<morganw>
phoe: I hope you don't mind me asking, is your book on the condition system usually/always print on demand?
<phoe>
morganw: I have no idea
<phoe>
and I'm honest, I have no idea how the deal works on the apress side
<morganw>
so you wouldn't have a preferred place to buy it from?
<phoe>
straight from apress, I guess
<morganw>
OK, thanks!
<phoe>
no problem
<phoe>
hope the book serves you well :D
robin has joined #commonlisp
igemnace has joined #commonlisp
igemnace has quit [Remote host closed the connection]
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #commonlisp
peterhil has quit [Remote host closed the connection]
peterhil has joined #commonlisp
peterhil has quit [Read error: Connection reset by peer]
<Bike>
can someone help me with this basic pathname issue? if I have #p"foo/bar/" and #p"foo/", what do i use to get #p"bar/"?
<Bike>
i thought it would be enough-namestring, but i guess not
peterhil has joined #commonlisp
<Bike>
pathname-utils:relative-pathname might be it.
<Shinmera>
But I won't turn down another pathname-utils user :)
anticomputer has quit [Ping timeout: 255 seconds]
<Bike>
that's why it worked when i did absolute pathnames, i guess. how strange
nij- has joined #commonlisp
anticomputer has joined #commonlisp
lisp123 has joined #commonlisp
<scymtym>
the specification entry has an invariant that wouldn't hold for relative pathnames
<nij->
(loop for i from 1 to 1e5 do (long-compute i))
<nij->
I find myself in this situation often: I need to run a long loop, each of whose step is also kind of long. But then some error happens in the middle of the loop, so I have to run the loop again... Say an unhandled condition happens at STEP. Is it possible to use the powerful condition system to invoke a restart for me to choose to undo whatever STEP does in Lisp (e.g. un-setf variables)?
<phoe>
what is STEP?
<phoe>
you mean CL:STEP the stepping macro, or something else?
<nij->
Oh mean when i is STEP.
<Bike>
you can write restarts that revert the state to whatever it was before your operation, assuming your operation is amenable to that
<Bike>
cl:step doesn't do anything magical
<Bike>
(in that respect)
<phoe>
(loop for i from 1 to 100000 do (tagbody :again (restart-case (compute) (continue () :report "Try again." (go :again)))))
<phoe>
then, if you hit the debugger
<nij->
I don't mean cl:step. Treat STEP as K in my OP.. sorry.
<phoe>
you can interactively fix your problem in the REPL
<phoe>
and invoke the restart
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<nij->
phoe thanks.
<nij->
If #'compute has done some side-effects within Lisp, is it possible to go back a few frames as if that fail attempt has never happened?
<Bike>
your restart can also setf things or whatever else to reset the state
<nij->
Say (compute i) has setf *x* to i.
<nij->
Yeah.. but then I need to write it down explicitly.
<Bike>
lisp does not keep track of side effects for you
<nij->
It would be great if the frames are preserved.
<nij->
Oh.. ok.
<Bike>
(doing so would be enormously expensive)
<nij->
Got it.
<scymtym>
i would call the above restart RETRY since CONTINUE is generally intended for cases in which there is "a single ``obvious'' way to continue"
<Bike>
of course, if you actually mean stack frames, you could certainly return from a function and then call it again with new parameters
<Bike>
then if you RETRY from the error it'll exit callee and call it again with the original parameters (provided you have only mutated the variables and not the objects)
<phoe>
CONTINUE would be if the tagbody tag was after the computation, therefore skipping the computation rather than looping
<nij->
Neat! Thank you :)
ec_ has quit [Remote host closed the connection]
ec_ has joined #commonlisp
additive has quit [Quit: WeeChat 3.7.1]
nij- has quit [Ping timeout: 252 seconds]
lisp123 has quit [Ping timeout: 252 seconds]
tyson2 has joined #commonlisp
attila_lendvai has joined #commonlisp
jmdaemon has joined #commonlisp
shka has quit [Ping timeout: 268 seconds]
tyson2 has quit [Remote host closed the connection]
notzmv has joined #commonlisp
jeffrey has quit [Ping timeout: 260 seconds]
morganw has joined #commonlisp
thuna` has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
puchacz has quit [Quit: Client closed]
<gendl>
hi is anyone doing Advent of Code?
<Josh_2>
Not me
morganw has quit [Remote host closed the connection]
varjag has quit [Quit: ERC 5.4.1 (IRC client for GNU Emacs 29.0.50)]