azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
donleo has quit [Ping timeout: 264 seconds]
Jach has quit [Ping timeout: 256 seconds]
rgherdt has quit [Quit: Leaving]
Jach has joined #commonlisp
waleee has quit [Ping timeout: 252 seconds]
bjorkintosh has quit [Quit: Leaving]
NotThatRPG has joined #commonlisp
<jcowan>
What is the difference between INCF/DECF and appropriate use of SETF?
<jcowan>
(Clearly LOOP cannot rebind iteration variables, it must assign them.)
<jcowan>
likewise DO
<gilberth>
What I meant was the following the following.
<gilberth>
The obvious implementation of (loop for i below 10 ...) would be (prog ((i 0)) again (if (>= i 10) (return)) ... (incf i) (go again)).
<gilberth>
But the following could work as well:
eddof13 has quit [Quit: eddof13]
<gilberth>
Like (prog ((g42 0) i) again (when (>= g42 10) (return)) (setq i g42) ... (incf g42) (go again))
<gilberth>
[Modulo the correct order.]
<gilberth>
That is LOOP could have a hidden gensym g42 which is the counter and upon "stepping" would assign I to the current counter. This way the user setting I would not affect the looping itself.
<gilberth>
The observed behavior would be (loop for i below 10 collect i do (incf i)) => (0 2 4 6 8) in the former implementation and (0 1 2 3 4 5 6 7 8 9) in the latter.
<gilberth>
IIRC DOTIMES can do either.
<aeth>
oooh
<aeth>
that's a nice trick
herjazz has joined #commonlisp
<gilberth>
Anyhow the glossary says "stepping" = "assignment of next value", while the prose speaks of "incrementing" the variable.
<gilberth>
The latter would imply the former (incf i) implementation. The former could be both as INCF assigns as well.
<gilberth>
Note, that FOR X IN Y needs such a shadow gensym.
<jcowan>
I don't see that (setf x (+ x 1)) is not an incrementation.
<gilberth>
So I could imagine some LOOP implementation for simplicity always having hidden iteration variables and opt to just install the correct next values in the "stepping" step.
<gilberth>
jcowan: Is (setq i g42) an increment?
<jcowan>
Not unless the value of g42 depends on i
Oladon has joined #commonlisp
<gilberth>
See my possible implementation using g42. There it does not.
<gilberth>
I incf g42, the gensym, and then only assign it to the user iteration variable 'I' on each iteration.
<gilberth>
And as said, something similar must happen with FOR IN anyways.
<gilberth>
So a LOOP implementation might handle each FOR .. the same internally: Some gensym, some form to step that gensym, some form to assign to the user iteration variable. That's tempting.
<gilberth>
Actually this is what I would come up with.
dra has quit [Ping timeout: 256 seconds]
<jcowan>
Why is this required for FOR-IN?
<gilberth>
Because with (loop for x in something do ..) the next value of x is not a function of the previous value of x.
<gilberth>
There must be some pointer to the the remaining tail of the list to iterate upon that could be CDRed along.
<jcowan>
oh, of course
<jcowan>
most of my CL experience pre-dates LOOP
notzmv has joined #commonlisp
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Alfr has joined #commonlisp
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
cranej has joined #commonlisp
cranej has left #commonlisp [ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1)]
cranej has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
akoana has quit [Quit: leaving]
Jach has quit [Ping timeout: 264 seconds]
Jach has joined #commonlisp
Oladon has quit [Quit: Leaving.]
ym has joined #commonlisp
herjazz has quit [Quit: leaving]
Devon has joined #commonlisp
Devon has quit [Ping timeout: 245 seconds]
edr has quit [Quit: Leaving]
<Lycurgus>
jcowan: rly? did you know McCarthy?
<jcowan>
no
<jcowan>
LOOP was introduced to CL between CLtL1 and CLtL2. My first experience of Common Lisp was on Lyric (the direct ancestor of Medley), which was and is CLtL1.
<jcowan>
it was originally borrowed from Interlisp's FOR
<Lycurgus>
yeah i was just looking at my original copy of CltL2 and the loop chapter has change bars on every page
<masinter>
it's all my fault
<masinter>
i was working on DENDRAL in Lisp/360
<masinter>
and I missed Algol's For and Record
* Lycurgus
just brought up HerculesStudio a few minutes ago, gonna setup 3270 next
<masinter>
so I did them for Lisp/360
<Lycurgus>
i have a doc on ibm lisp prolly that one
<masinter>
teitelman came by stanford and i showed him the code
<Lycurgus>
if there are binaries for it, they'll run on herc
<masinter>
there was something called Wylbur
<masinter>
I had a listing of the source code but I gave it to the Computer History Museum
<Lycurgus>
i printed out a lot of MCP 3.something software, MCP itself, the ALgol compilers and carted them around for a few years
<Lycurgus>
as systems programmer it was easy to do and have them bound
<Lycurgus>
unisys has a version of MCP that runs on Windows and they had a free version of it for a few years but had 1 year expiry and they stopped it in '20
<Lycurgus>
but ofc unlike the old days, modern unisys doesn't distribute the sources now that FOSS is dominant
hineios2 has quit [Ping timeout: 268 seconds]
hineios2 has joined #commonlisp
decweb has quit [Ping timeout: 255 seconds]
Devon has joined #commonlisp
Devon has quit [Ping timeout: 255 seconds]
<Pixel_Outlaw>
Hmmm I'm trying a thought experiment but maybe my understanding of tagbody is flawed. I eval it and don't see the expected numeric anwser. https://pastebin.com/5TmNrDqK
<Pixel_Outlaw>
I'm doing a self recursive map traversal without using containers. Just for fun.
<Pixel_Outlaw>
This will be generated via macro from a list of states.
<beach>
You could also use some abstractions to avoid code duplication.
<beach>
The only information that is different in each code block is the two labels.
<beach>
But I guess if this code is generated in the first place, it doesn't matter.
<Pixel_Outlaw>
Yep the elt stuff could be it's own funtion
<beach>
Well, even a macro like (MUMBLE <label1> <label2>) might be worthwhile.
<Pixel_Outlaw>
I plan to generate these from the "LR" business and a list of tag symbol jumps attached to each flag. I was writing the expansion manually.
<beach>
I see.
<Pixel_Outlaw>
I agree
anticrisis has joined #commonlisp
Oladon has joined #commonlisp
igemnace has quit [Read error: Connection reset by peer]
cranej has left #commonlisp [ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1)]
ym has quit [Remote host closed the connection]
dcb has quit [Quit: MSN Messenger 4.1.2]
igemnace has joined #commonlisp
cinerion_ has quit [Read error: Connection reset by peer]
Posterdati has quit [Read error: Connection reset by peer]
qhong has quit [*.net *.split]
leeb has quit [*.net *.split]
saturn2 has quit [*.net *.split]
cinerion has joined #commonlisp
qhong has joined #commonlisp
saturn2 has joined #commonlisp
Posterdati has joined #commonlisp
leeb has joined #commonlisp
herjazz has joined #commonlisp
igemnace has quit [Quit: WeeChat 4.1.2]
Oladon has quit [Quit: Leaving.]
Devon has joined #commonlisp
rtypo has joined #commonlisp
Devon has quit [Ping timeout: 260 seconds]
msavoritias has joined #commonlisp
villageidiot has joined #commonlisp
JamesF has quit [Ping timeout: 252 seconds]
Pixel_Outlaw has quit [Quit: Leaving]
azimut has quit [Ping timeout: 240 seconds]
JamesF has joined #commonlisp
pve has joined #commonlisp
anticrisis has quit [Quit: Leaving]
anticrisis has joined #commonlisp
anticrisis has quit [Read error: Connection reset by peer]
<Pixel_Outlaw>
Meh, I solved it differently it's OK now.
<gilberth>
You want a computed GOTO?
<gilberth>
FUNCALL is your computed GO. You can do things like (setq where-to (lambda () (go tag))) .... (funcall where-to).
<younder>
auto-epistemic-inference-mode => loop
<gilberth>
Or have a LOOP/CASE, as you must do with WASM or JS: (LET ((PC 0)) (LOOP DO (CASE PC (0 ..) (1 ..) ...)) Then (SETQ PC ...) is your computed GO.
<younder>
go whence you came is just a function return
mgl has joined #commonlisp
<jjnkn>
Hi, I've been experimenting with a dynamic version of FLET and observed what I suspect is a bug in SBCL.
<bike>
"A call within a file to a named function that is defined in the same file refers to that function, unless that function has been declared notinline. The consequences are unspecified if functions are redefined individually at run time or multiply defined in the same file." here it would be acompilation unit more generally, i guess?
cimento has quit [Quit: WeeChat 4.1.2]
masinter has quit [Remote host closed the connection]
waleee has quit [Ping timeout: 264 seconds]
<gilberth>
Doesn't explain why SBCL believes it is fine evaluating (function f) whenever it feels like it.
cimento has joined #commonlisp
<jjnkn>
I agree with gilberth. My interpretation of the specification is that FUNCTION is the same as SYMBOL-FUNCTION, only it also can access the lexical environment. Therefore, there is no reason why these 2 should produce different results when targeted at the global environment
msavoritias has quit [Ping timeout: 246 seconds]
<bike>
my idea here is that sbcl is relying on this aspect of the compilation semantics to decide that F is not redefined. so when you write (f) or (funcall ff) it just compiles it as a call to the global f, which it assumes will remain the same as ff.
<bike>
haven't checked in detail or anything. but non top level defun is gonna be pretty dicey.
<gilberth>
Yes, but we don't call a named function.
azimut has quit [Ping timeout: 240 seconds]
<gilberth>
We call the function that we find in the 'ff' variable. It was assigned to (function f) prior to the DEFUN.
<gilberth>
SBCL probably substituted (function f) for ff in (funcall ff) on the assumption that #'f is a constant.
<bike>
that's what i said, yeah.
<moon-child>
I don't really understand how nondeterministic semantics work
<moon-child>
the way it seems to work generally is as follows
<moon-child>
a nondeterministic small-step semantics is defined. We apply equational reasoning to an 'ideal' deterministic version of the semantics, and express the equations as rewrites. Then we apply the rewrites to the nondeterministic semantics
<moon-child>
which doesn't really make any sense?
mgl has joined #commonlisp
<moon-child>
(applying the rewrites nondeterministically, of course--which would not matter if the semantics were deterministic, but since they aren't, you get nondeterminism blowup)
azimut has joined #commonlisp
meritamen has joined #commonlisp
ym has joined #commonlisp
meritamen has quit [Ping timeout: 245 seconds]
waleee has joined #commonlisp
rtypo has quit [Read error: Connection reset by peer]
tedwing has joined #commonlisp
tedwing has quit [Client Quit]
tyson2 has joined #commonlisp
younder has quit [Remote host closed the connection]
yitzi has quit [Remote host closed the connection]
pve has quit [Quit: leaving]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
jjnkn has quit [Quit: leaving]
mgl has quit [Ping timeout: 256 seconds]
attila_lendvai has quit [Ping timeout: 255 seconds]
<prokhor>
question: i would like to load a list of files, but instead of dropping into the debugger, the env should write the error in a logfile & continue to load. I preferably would use sbcl or clisp...
NotThatRPG has joined #commonlisp
<jcowan>
If you have tail recursion, you can use functions instead of labels.