2024-05-19 08:25:35 zelgomer: I know what you mean 2024-05-19 08:25:46 Should be called MOD/ really with its order 2024-05-19 10:07:24 Hey. I'm Legacy at the moment but I have many names. (Transfem, it/its pronouns.) 2024-05-19 10:07:25 I'm an absolute beginner, and I was wondering if there are any words in SwiftForth or Gforth that return the top of the stack without popping, or you need to define it yourself as `DUP .` ("DUP"; space; dot) Reason: just curiosity, I'm not trying to achieve anything. 2024-05-19 10:09:03 orylesor: .s 2024-05-19 10:09:15 That'll print the top of the stack 2024-05-19 10:10:50 Thanks, but I've tried `.s` before. I was wondering if there's a word that returns TOS (top of stack) exclusively, and nothing else. 2024-05-19 10:11:15 I don't know of a standard word that will only print the top stack item 2024-05-19 10:12:01 Appreciate it! It's always difficult to figure out when something doesn't exist. 2024-05-19 10:13:37 This is from the old Forth Standard although most implementations are unique snowflakes :P https://forth-standard.org/standard/alpha 2024-05-19 10:15:57 Thanks, have a good one! 2024-05-19 11:03:23 ACTION  2024-05-19 11:03:25 hm 2024-05-19 11:40:29 I wanted to do a Forth-like report generating DSL 2024-05-19 11:40:36 Little bit stuck since some data is record-like 2024-05-19 11:43:36 ACTION checking gforth structs 2024-05-19 11:47:22 https://paste.centos.org/view/7e644c83 2024-05-19 11:48:24 Including another S-expr representation: https://paste.centos.org/view/8cfbac40 2024-05-19 12:15:51 is it common to use '.' as a "fake" namespace terminator char? i mean, if we have words that are all of a specific argument, let's say all words about ZIP compression, is it common in Forth to have 'zip.compress', 'zip.decompress', 'zip.set-size' and so on? what you think? 2024-05-19 16:40:19 rendar: That's what I do. 2024-05-19 16:40:38 hello-operator, you use the '.' to indicate namespaces? 2024-05-19 18:38:57 orylesor: I have a "personal convention" in my system where a . prefix on a word causes it to retain the deepest argument it would otherwise consume. I use it a lot in conditional returns. But applying it to the normal word . means that .. prints the TOS without dropping it. 2024-05-19 18:39:01 Very handy for debugging. 2024-05-19 18:39:19 It's not "intelligence" in the system - I just define those words per that convention. 2024-05-19 18:44:04 ACTION writing a tiny forth in PHP 2024-05-19 18:48:09 :0 2024-05-19 18:50:54 As long as the words can eat both from the stack and the stream, it should be possible to do some cool stuff 2024-05-19 19:00:17 I can lessen the number of post-fix words, pre-fix is more natural for struct fields, for example 2024-05-19 19:08:00 Stream is a lot slower. 2024-05-19 19:08:41 Something like (which I think of as postfix) always seemed fine to me. 2024-05-19 19:09:18 This is a DSL that must be understandable for sales people 2024-05-19 19:09:55 But it's mostly descriptive 2024-05-19 19:22:53 veltas: not only just the name /mod, but the few times i've used it, it even seems like i usually want the remainder on top 2024-05-19 19:24:22 i would think usually you're using /mod because you want to decompose a number by multiples. e.g., converting to text. in that case, i actually want to pull out remainders incrementally, so i want the mod on top and the quotient (sort of an inverse accumulator) on bottom. 2024-05-19 19:24:34 maybe i just haven't seen enough other use cases 2024-05-19 19:28:02 unset HISTFILE 2024-05-19 19:28:21 that's not the right window for that 2024-05-19 19:35:11 anyway, like rendar, i'm also still trying to fine tune my style and conventions. i have been using the # prefix to indicate a constant represents somethings size, like the # operator from lua. e.g., 2 constant #cell. but now i've found cases where i used it to mean "the number of things", like "20 constant #ids" and the inconsistency is causing me to question the whole thing 2024-05-19 19:37:52 Maybe you could use something like 'magnitude' for size e.g. |cell| 2024-05-19 20:04:08 or maybe i should just call it cell like everybody else does 2024-05-19 20:05:10 there have been a lot of things that i was doing differently when i started out, and over time i've found my vocabulary slowly regressing back to forth-79/83 style word names. i probably should have just not fought it in the first place. 2024-05-19 20:09:00 I'll admit I'm not keen on too much 'punctuation' :P 2024-05-19 20:20:48 I quite like symbols. I gravitate in that direction more often than not. 2024-05-19 20:21:33 I'm very prone toward using & | ~ ^ for and, or, not, xor. And % instead of mod.