2024-11-30 08:51:58 Is this word portable on standard forths? : enumerate 0 do i constant loop ; 2024-11-30 08:55:26 Used like: 3 enumerate red green blue 2024-11-30 11:00:08 xentrac: thanks for the infix info - been away for a few days and not had a chance to look into it yet (also, not quite ready to deal with more ui related stuff at the moment) - currently looking at a really stupid issue - like i said a few days back, i arrived at a syntax like y=(( x fsin f* )); which basically derives a pair of xt's like 'xy-function' 'xy-loop' - if i run execute, the graph is 2024-11-30 11:00:10 drawn for the current x and y ranges 2024-11-30 11:03:52 all i want to be able to do is create a new named word which takes the 2 xt's at the top of the stack - like aliteral aliteral swap execute - but i just can't seem to find anyway to do it (i don't really need it for what i'm attempting, but i'm finding it frustrating that it's not clear to me how i do it) 2024-11-30 11:22:24 smlckz: I'm not the resident expert on standards issues, but I don't see anything unusual about your definition. It seems to work in gforth, and I'd think it would work in any reasonable Forth; you're only using fairly common features. 2024-11-30 11:29:50 ah - answering my own question perhaps - this seems to work : create-run create , , does> dup @ swap cell+ @ swap execute ; - so now i can do: y=(( x x fsin f* )); create-run ytf 2024-11-30 11:43:40 y=(( x )); xy-name y=x <- really don't know if this is stoopid, wrong or ugly :) - but with the polar coordinate stuff, i can make some really funky little animations ... will have to hit asciinema later - just need to bed a couple more things in first 2024-11-30 12:51:59 KipIngram: thanks 2024-11-30 13:45:05 smlckz: I'm no expert but it looks portable on standard Forths. F83 used something similar for several parts of its assembler 2024-11-30 13:45:51 lilo_booter: congratulations! 2024-11-30 16:18:04 xentrac: thanks :) - next issue is just a development issue - i need to include the source file a few times, and that creates new variables and resets them to defaults each time - is there a way to check for existence and avoid creating certain vars on each include? :) 2024-11-30 16:51:46 ah - [if]/[else]/[then] :) 2024-11-30 20:03:03 I don't think there's a standard Forth way, but GForth has [if] [else] [then], yeah 2024-11-30 20:11:04 lilo_booter: start your include file off with CREATE . Then you can later FIND and if the result is zero it's already there. 2024-11-30 20:11:21 I mean it's not. 2024-11-30 20:11:40 So FIND 0= IF THEN ... 2024-11-30 20:12:49 Though I don't know how INCLUDE would be have in that situation - I use blocks, so for me it would be LOAD, which is perfectly fine to do in a definition. 2024-11-30 20:13:01 yeah - problem is that if/else/then are compile only which messes that up - [if]/[else]/[then] are immediate, so that works 2024-11-30 20:13:05 As xentrac mentions, those gforth words would be more well suited for this. 2024-11-30 20:13:22 i was looking at blocks and thinking that that was an option, yeah 2024-11-30 20:13:25 Yes, at least for LOAD it is ok to compile that. 2024-11-30 20:13:47 cool - will probably review at some point 2024-11-30 20:13:59 But if you're oriented toward using source files, switching to blocks is a pretty big shift. 2024-11-30 20:14:15 seemed like it from what i saw :) 2024-11-30 20:19:06 uk snooker quarter finals are on, so my attention is somewhat divided :D - but i'm at the point where i'm just trying to include the current background/foreground colors at the point of creating the execute word 2024-11-30 20:20:36 once i've got that working, i can look at replacing the terminal rendering with an rgb raster 2024-11-30 20:37:35 KipIngram: hey, that's a great idea! 2024-11-30 21:56:07 centrac: re [if] and co: I think its part of the ans standard and often implemented as it can share some of the comment implementation 2024-11-30 21:59:15 s/centrac/xentrac/ 2024-11-30 22:22:45 huh, thanks. It *is* standrd: https://forth-standard.org/standard/tools/BracketIF 2024-11-30 22:26:11 good - that'll work for me then 2024-11-30 22:29:09 thanks Zarutian_iPad! 2024-11-30 22:29:22 quite funny - asked chat gpt and google gemini how to do this (also the previous question about forming a new word which execute a pair of xt's on the stack) - both gave smilar responses, and both matched the direction that i was looking in after attempting to read the docs 2024-11-30 22:30:58 neither suggested the create , , , thing, nor [if]/[else]/[then] 2024-11-30 22:31:52 personally, i think that might suggest a fault in the documentation 2024-11-30 22:33:16 I think it suggests that Gemini and ChatGPT don't know Forth very well 2024-11-30 22:34:40 heh - i don't think either know much about anything.. but they do tend toward hitting the right directions on most questions when answering the first quesion (it's second and third which spiral further and further from reality) 2024-11-30 22:35:43 but in this case, their first responses were as off the mark as my own 2024-11-30 22:35:57 i find that kinda curious 2024-11-30 22:42:34 there are aspects of forth which kinda *feel* as though things should work in a certain way.. but just don't - like 10 0 do i . loop <- fails with interpreting a compile only word... : blah create name .. ; <- wack wack oops etc 2024-11-30 22:44:17 the ai stuff seems to invariably trip up on these issues in the same way anyone approaching the language would 2024-11-30 22:53:43 generally speaking, i only ever ask ai to do stuff i already know how to do, but can't be arsed doing the typing - in that way, i can immediately verify if the response is sane or not ... when i don't know the answer, ai tends to be a complete load of shit :) - their responses to these questions did nothing to convince me otherwise 2024-11-30 22:57:46 this suggests good programmers will make good use of it, and bad programmers the opposite 2024-11-30 22:59:43 yup (and i would suggest that it isn't restricted to programming - i've had similar experiences with literature too)