2021-11-11 04:25:41 Forgot to respond yesterday, POSTPONE and ['] are clear now. 2021-11-11 04:26:02 I was later looking into how DOES> is implemented. Forth Programmer's Manual has been more helpful than reading the 94 standard. 2021-11-11 04:28:11 who is the author 2021-11-11 04:33:50 Ah, I meant to say *Handbook, not Manual. 2021-11-11 08:06:06 neuro_sys_: The standards are not generally helpful for understanding how FORTH is implemented 2021-11-11 08:06:33 The Moving FORTH articles have info on DOES> 2021-11-11 08:45:16 Oh right, I missed the next articles in Moving FORTH 2021-11-11 10:58:52 https://www.cs.utexas.edu/users/EWD/transcriptions/EWD00xx/EWD28.html 2021-11-11 12:23:51 anyone aware of any good articles on exceptions in forth? something catering to the starting forth crowd (to which I belong). 2021-11-11 13:13:08 joe9: What do you want to know about exceptions? 2021-11-11 13:33:40 joe9: Is this helpful? https://ideone.com/Qezi20 2021-11-11 13:36:46 The syntax highlighting worked fine in their editor, but displays bad when it's submitted... 2021-11-11 13:39:52 what's `throw` do. 2021-11-11 13:41:46 does that rely on a separate exception stack 2021-11-11 13:41:53 it looks like it.. 2021-11-11 13:47:32 https://forth-standard.org/standard/exception 2021-11-11 13:47:34 Yes 2021-11-11 13:47:49 seems like we just keep adding stacks. 2021-11-11 13:48:13 I think the main use is a cleaner rdrop exit when you've got many places that want to roll back to one calling word 2021-11-11 13:48:24 And as a way of implementing a more generic abort 2021-11-11 13:48:45 This is one stack I don't mind adding, and I'd only expect it to be 4 or so entries deep 2021-11-11 13:48:55 that's fair. 2021-11-11 13:49:14 Well, maybe deeper than that, but it doesn't need to be very deep 2021-11-11 13:49:33 I suspect none of the stacks should be very deep. 2021-11-11 13:49:44 For example, I'm currently writing some code that does some parsing, and I am using exceptions to handle a parse failure 2021-11-11 13:52:50 So anyway, CATCH will take an xt, execute it, if THROW is called during that then the parameter stack and return stack are reset and execution resumes following CATCH. CATCH always leaves a number on parameter stack, it's 0 if no exception and the exception code otherwise 2021-11-11 13:53:00 THROW takes one number, if it's non-zero an exception is thrown 2021-11-11 13:53:18 ABORT is redefined to essentially do -1 THROW 2021-11-11 13:53:46 ABORT" similarly does -2 THROW 2021-11-11 13:54:40 That's all there is to it, and a stack is needed for the exception handling to work, the "exception stack", which will probably be a small buffer somewhere with entries capable of restoring IP/SP/RP 2021-11-11 13:55:56 that feels like half an exception system in contrast with C/C++. 2021-11-11 13:57:46 veltas, imode, thanks. 2021-11-11 13:58:40 imode: It's really just setjmp 2021-11-11 13:59:06 C++ exceptions have to worry about RAII yeah 2021-11-11 13:59:48 yeah 2021-11-11 14:00:08 I think that my exception implementation was going to put the info on the return stack, and then just have one pointer somewhere to the current CATCH data (or 0 if no CATCH) 2021-11-11 14:00:11 you can make your own system 2021-11-11 14:00:26 Because then you don't need a new stack for it, it can fit in return stack 2021-11-11 14:04:52 Standard says the exception stack may be the return stack 2021-11-11 14:05:58 curious. 2021-11-11 14:07:44 Probably that's how everyone does it, so really there is no exception stack 2021-11-11 14:08:02 Because thinking about it, there's no need. You just need a pointer to the last exception frame on the return stack 2021-11-11 14:08:04 that makes sense.. 2021-11-11 14:08:21 yeah. you're only ever using the top half when the exception system is triggered. 2021-11-11 14:08:23 That's how C does it too 2021-11-11 14:20:27 I'm going to try writing something for simple linear regression in FORTH since someone asked on Facebook 2021-11-11 14:20:33 If anyone else is interested in giving it a shot 2021-11-11 15:07:52 who wants to get forth up and running on a turing machine. 2021-11-11 16:13:10 I guess many ppl 2021-11-11 17:32:29 siraben: I finally found a TI-84+ calculator, and restored it to working order 2021-11-11 17:32:47 $6 at the local second-hand store 2021-11-11 17:33:06 pretty good price, I say 2021-11-11 17:33:08 I wanted to try out ti84-forth on it 2021-11-11 17:33:30 f-a: the only catch is it is the pink cover model, and pink is definitely not my color 2021-11-11 17:34:06 the pink case and pink cover are detachable though, if I could find spare parts from a black one 2021-11-11 17:34:50 maybe you could even paint it 2021-11-11 17:34:59 how sought after are these pink parts? 2021-11-11 17:35:10 yeah you sould even sell them for a profit 2021-11-11 17:35:10 siraben: this TI-84+ appears to be a "silver edition" model. does that make a difference for ti84-forth? 2021-11-11 17:35:46 i am thinking there might be an ti enthusiast willing to trade 2021-11-11 17:36:11 I think I'll just email the TI users list and see if anybody wants to trade 2021-11-11 17:36:56 do it! 2021-11-11 19:39:15 the numbering on the 84s is very confusing 2021-11-11 19:39:30 the wikipedia article is a good reference 2021-11-11 19:40:05 some of the 84s have a different cpu and os