2024-02-29 12:29:46 forth has a separate stack for loops, right? 2024-02-29 13:02:47 rendar: Depends on the forth, standard also allows for it to be same as data/parameter stack 2024-02-29 13:03:13 Or maybe return stack as well, can't remember. But some forths definitely use a separate stack to better catch syntax errors 2024-02-29 13:03:22 i see 2024-02-29 13:04:01 but in a nested loop, how you can get the correct `I` ? will it represent always the current loop counter? 2024-02-29 13:04:11 The variables are often stored on return stack 2024-02-29 13:04:30 I is always current loop counter unless you've played with the return stack 2024-02-29 13:05:07 In many forths they are in dedicated registers 2024-02-29 13:05:28 I thought you were asking about the compilation stack 2024-02-29 13:05:58 For a long time I was used instead of R@ to get the top return stack item 2024-02-29 13:06:14 And I' would get the loop limit (which was the next item in return stack) 2024-02-29 13:08:20 It really does depend on the Forth, I tend to use `r@`, which is non-standard, but I also tend to only use `for...next` loops. 2024-02-29 13:08:40 The layout is up to implementor, a good choice for I and I' is two callee-saved registers 2024-02-29 13:09:05 And I avoid `do...loop`. It's a shame because that hampers porting code to my Forths (which usually lack the `do` words) 2024-02-29 13:09:52 With callee-saved regs you save I/I' to return stack at start of loop, and set the regs to given loop limits, and then you can call words/functions in the loop without needing to save those regs 2024-02-29 14:08:26 rendar: there's J for the index of one outer loop, and sometimes K for the next one up 2024-02-29 15:24:49 I have I J and K for indexed loops; the loop indexes are tracked separately from the stacks 2024-02-29 15:27:27 i see 2024-02-29 15:27:42 what about K+1 K+2 K+n... ? 2024-02-29 15:55:06 I've never needed that 2024-02-29 16:04:13 crc: Are they saved/restored anywhere or will using one clobber its usage further up call stack? 2024-02-29 16:08:22 the loop code allows up to 12 levels of nesting; each level can see its index I, the parent loop index J, and the grandparent K 2024-02-29 16:19:02 rendar: You could add a word to your system that let you index arbitrarily into the return stack, but the issue there is that attempting to provide "deeper K+" items would only work if you knew exactly how far down in the stack tht hings were. And how many calls you've made, whether you've used >r / r> etc. all affect that. 2024-02-29 16:19:48 Even with I, the simplest one, it only works in the word that actually contains the DO loop - you can't use it in "called" words, because the return stack pointer has moved. 2024-02-29 16:19:57 right... 2024-02-29 16:20:09 So you can't factor out any code that contains I, J, etc. 2024-02-29 16:21:35 I can factor out things using the indexes in mine :) 2024-02-29 16:22:49 KipIngram, keep in mind that my Forth hasn't a call stack (yet), it inlines everything 2024-02-29 16:23:25 Ok. So you might just have an "index stack." And you could treat that fairly arbitrarily, I think. 2024-02-29 16:23:41 You could use a separate stack in a regular system too, but it would complicate your memory management. 2024-02-29 16:23:53 yeah, i see 2024-02-29 16:29:23 Well, we've got an interesting situation that's come up over here. Back during the early pandemic, the Democrat House of Represented established a "proxy voting rule," so members out due to Covid could have someone else cast their vote for them. Immediately Congressmen of both parties started using for things other than Covid. In late 2021, just before the new Republican majority came in, they used this to 2024-02-29 16:29:25 pass a huge spending act. Our major spending bill for the upcoming term. The problem, was that they didn't have at least 50% of the members physically present, and now a federal judge has ruled the whole law unconstititional because it was passed unconstitutionally. 2024-02-29 16:29:30 So, this promises to be... interesting. 2024-02-29 16:29:49 I predict a wave of states challenging various bits of it (it was one of those 4000 page monster laws). 2024-02-29 16:30:24 Reading the Constitution carefully, it does look like that was a no-no. No quorum, no business. 2024-02-29 16:31:19 I'm no fan of the camp that mounted the challenge, but I do think it looks like they've got a point here. 2024-02-29 16:33:14 fail to see the relevance to forth 2024-02-29 16:33:33 democrats are the party of evil. nothing new here. 2024-02-29 18:00:25 Trump is good? 2024-02-29 18:16:42 "Cucumbers suck" -- "Onions are good?" 2024-02-29 20:36:50 No relation at all to Forth. But if you look back through the logs of this channel historically, you'll find many such things. Some from me, but certainly not all. We're a fairly laid back channel. Or have been in the past, at least. 2024-02-29 20:39:53 Re: this situation, I don't really see "good or evil" in it - it was just a procedural error, but one that turns out to be kind of important and may now cause all sorts of ruckus. I didn't see that anyone claimed votes were cast against the wishes of the people that weren't there. 2024-02-29 20:41:08 What poor behavior I do see is that people exploited that rule for more than pandemic-related reasons, and as far as I can tell that happened on both sides of the aisle. 2024-02-29 21:45:40 csb 2024-02-29 23:18:23 ACTION consults urbandictionary for csb 2024-02-29 23:18:26 ACTION ponders