2025-08-21 09:40:05 : SCAN ( addr u c - n|-1) SWAP 0 ?DO OVER I + C@ OVER = IF 2DROP I UNLOOP EXIT THEN LOOP 2DROP -1 ; 2025-08-21 09:40:46 I was convinced there wasn't a 'nice' way to write this, but after sweating it out I've got something that's almost readable 2025-08-21 09:41:44 Is Forth declarative or imperative or something else? 2025-08-21 09:46:57 It's definitely not declarative although you can use it that way 2025-08-21 09:47:22 My above code is very imperative 2025-08-21 09:50:07 :P 2025-08-21 09:51:06 Forth is definitely its own thing, I'd say a language was Forth-like if it was in same class 2025-08-21 09:51:43 Concatenative maybe 2025-08-21 09:58:07 Forth-like = implicit stack 2025-08-21 09:58:09 != 2025-08-21 09:58:10 ~= 2025-08-21 10:53:02 Just asked copilot for this and didn't get anything useful 2025-08-21 10:53:37 Anyone get a good result asking for e.g. an ANS Forth word that takes a string and character, and returns index of first position of character or -1 if not found 2025-08-21 10:53:49 On claude or something maybe 2025-08-21 10:55:45 It's really patterns and not smarts because it produced code that just wasn't even slightly close to correct 2025-08-21 10:56:01 I've given it the right answer so maybe it will remember that(?) 2025-08-21 10:58:50 LLM is bad with implicit stack 2025-08-21 11:09:39 I think the issue more might be it's bad with everything, but implicit stack stuff has a lot less training data so it seems worse 2025-08-21 11:14:31 "bad" is relative, I guess 2025-08-21 11:14:40 But yea, training data for sure. 2025-08-21 14:03:28 Oh whoops : S>D ( n - N ) DUP 0< IF -1 ELSE 0 THEN ; 2025-08-21 14:03:40 Could have just been : S>D DUP 0< ;