2024-08-23 23:23:33 : later r> r> swap >r >r ; 2024-08-23 23:24:26 like most forth things, i can't decide whether this is clever or terrible 2024-08-23 23:42:48 usually those are the same 2024-08-23 23:43:07 it seems fairly clear though 2024-08-23 23:43:37 it would probably be faster on an interpreted Forth as : later 2r> swap 2>r ; 2024-08-23 23:45:01 it seems highly likely to cause debugging difficulties when you can't figure out why its caller's caller is returning into the middle of a callee 2024-08-23 23:45:50 but it seems like a nice way to do Golang-style `defer` cleanup on return 2024-08-23 23:46:22 or I guess Python-style resource managers 2024-08-23 23:46:43 I'd probably call it something like `finally` or `eventually` if I dared to use it 2024-08-23 23:47:43 I was going to object that if its caller's caller is in the middle of a loop, it will probably crash Forth, but calling `defer` in a loop is problematic in Golang too 2024-08-23 23:52:50 zelgomer doesn't like the 2-words 2024-08-23 23:53:00 I think it's clever 2024-08-23 23:53:56 yeah true. i actually don't like do-loop in forth and never implemented it, though. i'm using it for my meta-] so that you can activate the target compiler from a host word. otherwise, ] nests and doesn't return until the corresponding [, which isn't how you normally expect ] to work 2024-08-23 23:54:28 i still need to write myself some better looping words 2024-08-23 23:55:04 I see, that isn't at all the use I was thinking of 2024-08-23 23:55:28 currently i only have DFOR which is a shorthand for BEGIN ?DUP WHILE 1- 2024-08-23 23:56:02 I figured out how to write better looping words today, looking at Henry Baker's COMFY-65, the LISP 1.5 manual, McCarthy's original LISP paper, and Dijkstra's guarded command language 2024-08-23 23:56:26 but now I've fallen into a pile of Pascal papers and can't get out 2024-08-23 23:56:48 C > Pascal 2024-08-23 23:56:51 fite me 2024-08-23 23:57:35 well, specifically what I was trying to figure out is when people started using {} in grammars to indicate repeated elements, and Wirth's 01970 paper on Pascal is the earliest I've found so far 2024-08-23 23:58:19 C didn't use {} in its grammar and doesn't today, even 2024-08-23 23:58:29 I thought it might be COBOL in 01960 or ALGOL in 01960 but neither of them use it. The Algol-60 report doesn't even use [] for optional items 2024-08-23 23:58:40 Neither does C 2024-08-23 23:59:00 that's true! and I think that's partly due to the influence of yacc 2024-08-23 23:59:19 Must be, I never knew what BNF etc was until it came up in a compiler course 2024-08-23 23:59:34 I didn't actually implement repeating items in the bootstrapping part of https://github.com/kragen/peg-bootstrap/blob/master/peg.md either