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/>
shka has quit [Ping timeout: 268 seconds]
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
<masinter> and they haven't scanned it yet
<ixelp> Compilers for MVS
<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
<ixelp> (let* ((counter 0) (path "LLR") (list-length (length path))) - Pastebin.com
<Pixel_Outlaw> Ah maybe I've an infinate loop :P
<beach> Almost certainly.
<beach> In DDD you always (GO DDD)
<beach> Same with EEE and GGG
bjorkintosh has quit [Ping timeout: 260 seconds]
<Pixel_Outlaw> Thanks as usual beach
<beach> Sure.
<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]
villageidiot has quit [Quit: Client closed]
Devon has joined #commonlisp
Devon has quit [Ping timeout: 246 seconds]
bilegeek has quit [Quit: Leaving]
shka has joined #commonlisp
zxcvz has joined #commonlisp
Devon has joined #commonlisp
igemnace has joined #commonlisp
rgherdt has joined #commonlisp
rgherdt has quit [Client Quit]
zxcvz has quit [Quit: zxcvz]
rgherdt has joined #commonlisp
bollu has quit [Quit: The Lounge - https://thelounge.chat]
bollu has joined #commonlisp
donleo has joined #commonlisp
danza has joined #commonlisp
traidare has joined #commonlisp
rogersm has quit [Quit: Leaving...]
attila_lendvai has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 252 seconds]
Lord_of_Life_ is now known as Lord_of_Life
Gleefre has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
igemnace has quit [Remote host closed the connection]
Gleefre has quit [Remote host closed the connection]
igemnace has joined #commonlisp
danza has quit [Ping timeout: 260 seconds]
Gleefre has joined #commonlisp
random-nick has joined #commonlisp
Posterdati has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
Posterdati has joined #commonlisp
tyson2 has joined #commonlisp
waleee has joined #commonlisp
meritamen has joined #commonlisp
mgl has joined #commonlisp
easye has quit [Ping timeout: 256 seconds]
easye has joined #commonlisp
tibfulv has quit [Remote host closed the connection]
mgl has quit [Ping timeout: 264 seconds]
CarbonWriter has joined #commonlisp
cranej has joined #commonlisp
cranej has left #commonlisp [ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1)]
tyson2 has quit [Read error: Connection reset by peer]
herjazz has quit [Quit: leaving]
decweb has joined #commonlisp
azimut has joined #commonlisp
meritamen has quit [Remote host closed the connection]
traidare has quit [Read error: Connection reset by peer]
attila_lendvai has quit [Quit: Leaving]
traidare2 has joined #commonlisp
attila_lendvai has joined #commonlisp
CarbonWriter has quit [Quit: Cherrio & Goodbye]
azimut_ has joined #commonlisp
azimut has quit [Remote host closed the connection]
cimento has quit [Quit: WeeChat 4.1.2]
cimento has joined #commonlisp
attila_lendvai has quit [Quit: Leaving]
attila_lendvai has joined #commonlisp
jonatack has quit [Ping timeout: 256 seconds]
waleee has quit [Ping timeout: 260 seconds]
bendersteed has joined #commonlisp
bendersteed has quit [Quit: bendersteed]
kaskal- has quit [Quit: ZNC - https://znc.in]
jonatack has joined #commonlisp
kaskal has joined #commonlisp
rendar has quit [Quit: Leaving]
notzmv has quit [Ping timeout: 260 seconds]
dcb has joined #commonlisp
jmdaemon has quit [Ping timeout: 256 seconds]
cage has joined #commonlisp
cimento has quit [Quit: WeeChat 4.1.2]
meritamen has joined #commonlisp
cosimone has joined #commonlisp
JamesF has quit [Ping timeout: 260 seconds]
JamesF has joined #commonlisp
azimut_ has quit [Ping timeout: 240 seconds]
JamesF has quit [Ping timeout: 256 seconds]
JamesF has joined #commonlisp
cosimone has quit [Read error: Connection reset by peer]
Jach has quit [Ping timeout: 264 seconds]
Jach has joined #commonlisp
meritamen has quit [Ping timeout: 264 seconds]
cimento has joined #commonlisp
bjorkintosh has joined #commonlisp
JamesF has quit [Ping timeout: 256 seconds]
JamesF has joined #commonlisp
ronald has quit [Ping timeout: 256 seconds]
JamesF has quit [Ping timeout: 255 seconds]
JamesF has joined #commonlisp
meritamen has joined #commonlisp
meritamen has quit [Remote host closed the connection]
meritamen has joined #commonlisp
eddof13 has joined #commonlisp
meritamen has quit [Ping timeout: 264 seconds]
eddof13 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
eddof13 has joined #commonlisp
Jach has quit [Ping timeout: 246 seconds]
Jach has joined #commonlisp
eddof13 has quit [Client Quit]
Jach has quit [Ping timeout: 255 seconds]
meritamen has joined #commonlisp
meritamen has quit [Ping timeout: 240 seconds]
notzmv has joined #commonlisp
Jach has joined #commonlisp
rendar has joined #commonlisp
azimut has joined #commonlisp
waleee has joined #commonlisp
Pixel_Outlaw has joined #commonlisp
tyson2 has joined #commonlisp
jjnkn has joined #commonlisp
<Pixel_Outlaw> Hmmm I wish TAGBODY had a go back type thing that returns to the previous jump's label.
<Pixel_Outlaw> ah, I'm writing this via macro I can probably just gensym up a temporary var/callstack
<Pixel_Outlaw> push the current label on the gensym'd stack pop back.
<beach> You can't.
<beach> Labels must be literals. They are not evaluated.
cage has quit [Quit: rcirc on GNU Emacs 29.1]
<Pixel_Outlaw> Ah that's right. (GO-WHENCE-YE-CAME) :p
<Pixel_Outlaw> Is needed.
<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.
yitzi has joined #commonlisp
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #commonlisp
meritamen has joined #commonlisp
<jjnkn> Hm, if I use #.(function f), then SBCL produces expected results.
Gleefre has quit [Remote host closed the connection]
meritamen has quit [Ping timeout: 245 seconds]
tedwing has joined #commonlisp
tedwing has quit [Client Quit]
<moon-child> I expect it's being inlined. Afaik this is allowed
Gleefre has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
<jjnkn> moon-child: Indeed, with (declaim (notinline f)) added to the first paste it works as expected
Oladon has joined #commonlisp
<jjnkn> But doesn't this optimisation break the specification? How could this be allowed?
mgl has quit [Ping timeout: 264 seconds]
<Gleefre> jjnkn: I too think that it is a bug; but it is kind of complicated.
<Gleefre> See a discussion here for example: https://bugs.launchpad.net/sbcl/+bug/1653370
<bike> jjnkn: are you using compile-file?
<jjnkn> No, I used sbcl --script
<bike> hm... well, it might still apply with sbcl's default compiling.
<bike> clhs 3.2.2.3
<ixelp> CLHS: Section 3.2.2.3
<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.
ym has quit [Remote host closed the connection]
anticrisis has joined #commonlisp
<ixelp> CLHS: Section The Conditions Dictionary
<aeth> probably one of the handlers
<ixelp> Beyond Exception Handling: Conditions and Restarts
tyson2 has quit [Remote host closed the connection]
meritamen has joined #commonlisp
meritamen has quit [Ping timeout: 252 seconds]
younder has joined #commonlisp
tyson2 has joined #commonlisp
meritamen has joined #commonlisp
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
meritamen has quit [Ping timeout: 256 seconds]
NotThatRPG has joined #commonlisp
younder has quit [Remote host closed the connection]
traidare2 has quit [Ping timeout: 268 seconds]
younder has joined #commonlisp
bubblegum has joined #commonlisp
borodust has quit [Remote host closed the connection]
bubblegum has quit [Ping timeout: 276 seconds]
younder has quit [Remote host closed the connection]
meritamen has joined #commonlisp
bubblegum has joined #commonlisp
rgherdt has quit [Quit: Leaving]
meritamen has quit [Ping timeout: 264 seconds]
bubblegum has quit [Ping timeout: 260 seconds]
JamesF has quit [Ping timeout: 256 seconds]
JamesF has joined #commonlisp
meritamen has joined #commonlisp
meritamen has quit [Ping timeout: 256 seconds]
mgl has joined #commonlisp
borodust has joined #commonlisp
igemnace has quit [Quit: WeeChat 4.1.2]
NotThatRPG has quit [Ping timeout: 264 seconds]
green_ has joined #commonlisp
shka has quit [Ping timeout: 276 seconds]
green__ has quit [Ping timeout: 264 seconds]
bilegeek has joined #commonlisp