2025-05-22 01:03:22 where do s" and c" store the string in memory? 2025-05-22 01:03:30 they do not seem to increment here 2025-05-22 01:03:44 I'm incrementing here with both 2025-05-22 01:05:36 they do not store it in the pad either 2025-05-22 01:05:42 at least in gforth 2025-05-22 01:06:57 it is wrong to increment here for s" and c"? 2025-05-22 01:25:45 Environment for cleobuli_ inactive, freeing... 2025-05-22 02:26:33 vms14: typically they store it in the colon definition 2025-05-22 02:26:35 : hello s" goodbye" ; ' hello 48 dump 2025-05-22 02:26:35 7F7BF76C34A8: BC 7E 10 34 CA 55 00 00 - 00 00 00 00 00 00 00 00 .~.4.U.......... 2025-05-22 02:26:38 7F7BF76C34B8: D9 80 10 34 CA 55 00 00 - D0 34 6C F7 7B 7F 00 00 ...4.U...4l.{... 2025-05-22 02:26:41 7F7BF76C34C8: 67 6F 6F 64 62 79 65 20 - BE 82 10 34 CA 55 00 00 goodbye ...4.U.. 2025-05-22 02:28:44 (in gforth) 2025-05-22 02:38:28 yeah but outside them they seem to use what they call "a transient buffer" which is not pad and will be reused the next time s" or c" are called 2025-05-22 02:39:05 my pad is actually from 0 to 300 since memory is just an array, here starts at 300 2025-05-22 02:39:29 and colon definitions do not reside in memory, they are just a perl subroutine xd 2025-05-22 02:40:19 I should think about making a dictionary in memory, but for now I will keep having memory only for the rest of stuff and the dictionary be a hash table 2025-05-22 02:43:22 that's the interpreter now https://paste.c-net.org/RemarkBreeds 2025-05-22 02:44:13 and the words I have for now https://termbin.com/y7fp 2025-05-22 02:47:08 it launches a repl if you load that with perl 2025-05-22 02:52:25 I should create DUMP 2025-05-22 02:53:13 s" is called " in F83 2025-05-22 02:53:29 in compilation state it stores the characters in the colon definition, same as GForth 2025-05-22 02:54:43 in interpretation state it appends them to the dictionary anyway 2025-05-22 02:54:54 just not as part of a dictionary entry necessarily 2025-05-22 03:01:22 then it increments HERE like I do 2025-05-22 03:01:38 cool 2025-05-22 03:01:54 I like it that way more because they can persist 2025-05-22 03:02:25 but maybe they shouldn't and that's why the space gets reused in gforth 2025-05-22 03:02:40 well also it doesn't work 2025-05-22 03:03:30 what does not work 2025-05-22 03:03:42 it doesn't push the address and length on the stack in interpret state 2025-05-22 03:03:55 in f83? 2025-05-22 03:03:57 yeah 2025-05-22 03:04:02 oh 2025-05-22 03:04:05 so there's no way to use the string you've thus stored 2025-05-22 03:04:08 well 2025-05-22 03:05:53 maybe if you saved the value of here from before storing the string you could find the counted string from it 2025-05-22 03:07:39 like here " hello vms14" 2 + count type says "hello vms14 ok" 2025-05-22 03:08:57 I have ," for that 2025-05-22 03:10:52 " pushes the string directly on the stack or definition and the others work like in forth 2025-05-22 03:11:18 I have accept too xd 2025-05-22 03:11:48 I will try to see how much of starting forth code I can evaluate in this thing 2025-05-22 03:11:55 the F example works already 2025-05-22 03:12:26 https://paste.c-net.org/TypicalLarry 2025-05-22 03:12:32 although that was simple 2025-05-22 03:15:28 this works in F83: here " yer mom" ' type , ' unnest , constant where : whoa where >r ; whoa printing "yer mom" 2025-05-22 03:16:12 whoa is arranging to return into the code appended to the dictionary by " and the two calls to , 2025-05-22 03:16:22 whose location is at the constant where 2025-05-22 14:23:18 forthBot: LOAD "ini.fth" 2025-05-22 14:23:18 File ini.fth loaded 2025-05-22 14:23:34 forthBot: MICRO 123456789123457 FPRIME? . MICRO SWAP - . 2025-05-22 14:23:35 1 2025-05-22 14:23:35 886487 2025-05-22 14:23:50 forthBot: MICRO 123456789123457 FPRIME2? . MICRO SWAP - . 2025-05-22 14:23:50 1 2025-05-22 14:23:51 604963 2025-05-22 14:24:11 less than 1 second 2025-05-22 14:25:00 forthBot: MICRO 123456789123457 PRIME? . MICRO SWAP - . 2025-05-22 14:25:00 1 2025-05-22 14:25:01 47 2025-05-22 16:01:13 bon 2025-05-22 16:04:10 I'm learning forth by implementing words 2025-05-22 16:05:16 but I should change the dictionary and have proper headers and body for words 2025-05-22 16:16:03 vms14: with assembler ? 2025-05-22 16:16:08 of c ? 2025-05-22 16:16:17 or c 2025-05-22 16:19:37 in perl xd 2025-05-22 16:19:40 https://paste.c-net.org/SpousesBerlin 2025-05-22 16:20:18 @memory[$addr .. $addr + $times] = ($element) x $times; 2025-05-22 16:20:25 that's the implementation for FILL 2025-05-22 16:20:45 0 30 32 FILL 2025-05-22 16:25:00 Environment for cleobuline inactive, freeing... 2025-05-22 19:37:06 forthBot: LOAD "ini.fth" 2025-05-22 19:37:06 File ini.fth loaded 2025-05-22 19:37:17 forthBot: CREDIT 2025-05-22 19:37:17 Brought to you by Cleobuline updated with hashtable https://github.com/cleobuline/forth-bot-gmp-irc-threaded-multi-users/tree/main Site https://labynet.fr 2025-05-22 21:37:17 Environment for cleobuline inactive, freeing... 2025-05-22 21:55:19 I have created m" which is like s" but expects an address on the stack and puts the strirng there 2025-05-22 21:56:01 huh, interesting! 2025-05-22 21:56:19 so you can pad m" 2025-05-22 21:56:27 yes 2025-05-22 21:56:41 I should make a version with limit I guess 2025-05-22 21:56:50 but does not make sense 2025-05-22 21:57:14 at the end you are creating a literal string so you should know if it fits or not 2025-05-22 21:57:32 I assume it can be useful for data structures and alike 2025-05-22 21:57:54 I was starting to read Object-Oriented Forth: Implementation of Data Structures 2025-05-22 21:57:57 I agree 2025-05-22 21:58:23 it shows a very simple way to create records with constants and does> + ; 2025-05-22 21:58:56 I suppose that in compile mode it will be copying the characters of the string into the location it gets from the stack 2025-05-22 21:59:03 from the colon definition 2025-05-22 21:59:37 0 constant name 20 constant phone : record create 40 allot does> + ; 2025-05-22 22:00:38 record john-doe name john-doe m" John Doe" 2025-05-22 22:00:47 should work 2025-05-22 22:00:52 you could imagine a simpler way to define the record structure 2025-05-22 22:01:02 yeah it will explain it later 2025-05-22 22:01:08 (the book) 2025-05-22 22:01:22 but it lead to the m" word which is cool 2025-05-22 22:03:17 should I name it !" ? 2025-05-22 22:03:18 like : field create , does> @ + ; : record create 40 allot ; for example 2025-05-22 22:03:26 !" sounds like a good name to me 2025-05-22 22:03:27 I used m" because of memory 2025-05-22 22:03:33 but store is ! 2025-05-22 22:03:36 yeah 2025-05-22 22:03:51 should it return the address and length or not? 2025-05-22 22:04:01 does not return anything 2025-05-22 22:04:02 I feel like it should at least return the length 2025-05-22 22:04:26 or put a counted string 2025-05-22 22:04:33 counted strings were a mistake 2025-05-22 22:04:41 I was thinking on a variation for the counted string 2025-05-22 22:04:44 oh 2025-05-22 22:05:14 but without returning the string length somewhere, if you want to have Forth type out the string, you have to count the bytes yourself and say name john-doe 8 type 2025-05-22 22:05:52 In Dusk, I call it cmove" ( dstaddr -- a u ) because it does pretty much like cmove 2025-05-22 22:06:13 is a dstaddr? 2025-05-22 22:07:07 why they were a mistake 2025-05-22 22:07:33 returning a number it's sad because it requires me to store it somewhere although you are right 2025-05-22 22:07:39 but a counted string solves both problems 2025-05-22 22:07:49 name john-doe count type 2025-05-22 22:08:03 because if you have a regular string and you want to pass it to a word that wants a counted string, you have to allocate a buffer somewhere and copy the count and the string into it 2025-05-22 22:08:15 also you have a bug if a string grows past 255 bytes 2025-05-22 22:08:30 so I think it's a mistake to create words that want counted strings 2025-05-22 22:08:37 unfortunately there is one of them in the Forth standard 2025-05-22 22:08:47 find 2025-05-22 22:09:26 so the problem is wanting a counted string 2025-05-22 22:09:28 the standard punched-card way to store variable-length strings in a fixed-width field is Forth's -trailing 2025-05-22 22:09:54 you pad out the buffer with spaces and pass the buffer's address and size to -trailing 2025-05-22 22:10:53 then you can type it 2025-05-22 22:10:54 as a trivial example: : hi s" example " -trailing type ; hi example ok 2025-05-22 22:10:56 oops 2025-05-22 22:10:57 like expect does 2025-05-22 22:11:03 as a trivial example: : hi s" example " -trailing type ; hi example ok 2025-05-22 22:11:23 I was implementing expect today, filling the rest with spaces 2025-05-22 22:11:47 that's why in part I was wondering about expecting a limit for m" 2025-05-22 22:11:51 I think accept obsoletes expect 2025-05-22 22:11:53 so it fills with spaces 2025-05-22 22:12:01 I have both accept and expect 2025-05-22 22:13:58 I guess m" should return a number or expect a limit and fill with spaces 2025-05-22 22:14:20 and I also want the counted string because it makes sense for john doe's name 2025-05-22 22:15:03 name john-doe m" John" name john-doe count type 2025-05-22 22:15:22 what I did for string handling in Forth last millennium was to reimplement DJB's stralloc in Forth, on top of malloc/free 2025-05-22 22:15:29 which I think are called allocate and free 2025-05-22 22:15:29 I guess I will use only the counted version for now and name it !" 2025-05-22 22:15:39 yes 2025-05-22 22:15:47 because it's weird to not see ! when setting values 2025-05-22 22:16:05 you will regret having used counted strings 2025-05-22 22:16:08 ;) 2025-05-22 22:16:09 :/ 2025-05-22 22:16:29 well right now I have to experiment with things so it's fine 2025-05-22 22:16:40 the next month all this code will likely not exist anymore 2025-05-22 22:20:09 hello at night here ! 2025-05-22 22:20:20 hi cleobuline 2025-05-22 22:20:32 somehow that makes me sad 2025-05-22 22:20:39 L'heure locale pour Paris, Île-de-France, France métropolitaine, France est : 2025-05-22 22:20:24 (Fuseau horaire : Europe/Paris) 2025-05-22 22:20:55 c'est un fuseau! 2025-05-22 22:21:06 I think a counted string makes sense in this case because it embeds the number, but I will remember to avoid expecting them and using count always 2025-05-22 22:21:07 in Spanish it's an "huso" 2025-05-22 22:21:37 xentrac sad that I will throw everything? it means I will rewrite it changing what I have learned experimenting now 2025-05-22 22:21:39 which sounds exactly like "uso", as in "usage" 2025-05-22 22:21:53 yes, probably I am unreasonably attached to things 2025-05-22 22:22:02 thank God my wife makes me throw things out 2025-05-22 22:22:07 I cannot have attachment to a prototype 2025-05-22 22:22:25 when I learn what I'm doing and have a proper design then ok 2025-05-22 22:22:41 but now the code and the design suck and really has to change 2025-05-22 22:23:13 it is my playground where I learn, has been like that for a while 2025-05-22 22:23:40 forthBot: STRING TOTO 2025-05-22 22:24:07 forthBot: "S This is a string "S TOTO ! 2025-05-22 22:24:07 Unknown word: This 2025-05-22 22:24:07 Unknown word: is 2025-05-22 22:24:08 Unknown word: a 2025-05-22 22:24:08 Unknown word: string 2025-05-22 22:24:08 Error: STORE: Stack underflow for string value 2025-05-22 22:24:20 forthBot: S" his is a string "S TOTO ! 2025-05-22 22:24:39 forthBot: TOTO @ PRINT CR 2025-05-22 22:24:40 his is a string 2025-05-22 22:24:40 cleobuline: you really need to fix that bug where it can generate multiple lines of error messages for a single line of input 2025-05-22 22:25:37 it's not a bug it just evaluate a string 2025-05-22 22:26:07 i can't predict that the input is buggy 2025-05-22 22:26:19 forthBot: prout 2025-05-22 22:26:20 Unknown word: prout 2025-05-22 22:29:19 it is a bug 2025-05-22 22:29:24 forthBot: a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a 2025-05-22 22:29:24 Unknown word: a 2025-05-22 22:29:24 Unknown word: a 2025-05-22 22:29:24 Unknown word: a 2025-05-22 22:29:25 Unknown word: a 2025-05-22 22:29:25 Unknown word: a 2025-05-22 22:29:25 Unknown word: a 2025-05-22 22:29:26 Unknown word: a 2025-05-22 22:29:26 Unknown word: a 2025-05-22 22:29:27 Unknown word: a 2025-05-22 22:29:27 Unknown word: a 2025-05-22 22:29:27 Unknown word: a 2025-05-22 22:29:28 Unknown word: a 2025-05-22 22:29:28 Unknown word: a 2025-05-22 22:29:29 Unknown word: a 2025-05-22 22:29:29 Unknown word: a 2025-05-22 22:29:30 a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a 2025-05-22 22:29:30 Unknown word: a 2025-05-22 22:29:36 a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a 2025-05-22 22:29:39 see? 2025-05-22 22:29:41 Unknown word: a 2025-05-22 22:29:42 Unknown word: a 2025-05-22 22:29:42 Unknown word: a 2025-05-22 22:29:43 Unknown word: a 2025-05-22 22:29:43 Unknown word: a 2025-05-22 22:29:44 Unknown word: a 2025-05-22 22:29:44 Unknown word: a 2025-05-22 22:29:45 Unknown word: a 2025-05-22 22:29:45 Unknown word: a 2025-05-22 22:29:46 Unknown word: a 2025-05-22 22:29:47 Unknown word: a 2025-05-22 22:29:47 Unknown word: a 2025-05-22 22:29:47 Unknown word: a 2025-05-22 22:29:48 Unknown word: a 2025-05-22 22:29:48 Unknown word: a 2025-05-22 22:29:49 Unknown word: a 2025-05-22 22:29:49 Unknown word: a 2025-05-22 22:29:50 Unknown word: a 2025-05-22 22:30:55 Unknown word: a 2025-05-22 22:30:55 Unknown word: a 2025-05-22 22:30:55 Unknown word: a 2025-05-22 22:32:16 il will try