<neuro_sys>
Amazing, I missed this important fact.
<neuro_sys>
It seems like it eliminates the need for namespacing as I previously thought.
<veltas>
I suppose it does generally make namespacing unnecessary
<neuro_sys>
Also looked into `here`, `,` and `allot`, it seems like no need to use `allocate` either. That way the memory management is simpler yet more restrictive I guess.
<veltas>
Absolutely no need to use allocate
<veltas>
Did you see my forth solutions to day 1? :P
<veltas>
A heap with all its poor determinism and fragmentation is not something you should dirty normal forth programs with
<veltas>
But it's nice to have anyway sometimes
<veltas>
Someone needs to write a modern forth tutorial neuro_sys, you are making all the same revelations I had to make a year ago
<neuro_sys>
The first line in your day1 has [undefined], I think that's a way to execute that line which contains an if word without actually defining a word?
<veltas>
neuro_sys: It's kind of like #ifndef
<neuro_sys>
Ah no, just read what [undefined] again. Yeah.
<veltas>
Me talking about forth early on and someone says "yeah... so locals and forth... er... hahaha generally a red flag." http://bespin.org/~nef/logs/forth/20.02.23
<veltas>
Now I am that guy
<veltas>
That proteusguy
<neuro_sys>
Haha
<veltas>
I could remove those conditional lines because they are just there to support standard forths
<veltas>
I am defining stuff that gforth comes with
<veltas>
basically
<veltas>
I prefer working with stdin rather than opening a named file
<veltas>
I 'get' forth state now but at the time apparently it made my 'head hurt', and that seemed to attract me to the language more for some reason...?
<neuro_sys>
I think it's good use of time to write up a tutorial that specifically addresses the things that should be unlearned first by folk like me. Even though these things are written everywhere, it takes a while to figure out the why.
<veltas>
neuro_sys: If I want to check for end I probably would have rewritten to be a do/+loop and then just put the error message at the end of the loop
<veltas>
I'm sure it's no surprise to you I would rather have shorter code than validate the input, a saner place to start would not be running EVALUATE on every line!
<veltas>
You don't need to close a file if you're just reading it, as far as I know
<veltas>
I like : load-file open read close ;
<veltas>
Instead of dup 0= you can do ?dup, but you will need to swap the if/else parts
<veltas>
And then you can remove the drop when it's 0
<neuro_sys>
Ah right forgot the ?dup
<veltas>
Similarly in the loop you do "0<> while ... repeat drop", you could have "?dup while ... repeat" equivalently
<veltas>
Quite often ?dup is useful when comparing against zero or checking a flag
<veltas>
I think so anyway I am struggling to think seriously about your code because I am in the middle of writing merge sort for my big boy version
<veltas>
I really like what you've done here neuro_sys, it's very clean as well
<veltas>
I think I would actually prefer more comments reading it, I think Chuck Moore is wrong on that one, especially stack comments
<neuro_sys>
Thanks. Yeah the two or three words in particular there would benefit a lot from stack comments.
<veltas>
I don't mind no comments mid-definition if it's a short definition
siraben has quit [Ping timeout: 240 seconds]
jimt[m] has quit [Ping timeout: 260 seconds]
<veltas>
I think it helps the most to have them for the input and output of words, to avoid having to necessarily read the whole program to figure out what's happening
<veltas>
Instead of leaving 0 at the end of the array, have you considered checking when the search address is HERE to end the inner loop?
<veltas>
Oh and there is a forth standard word for "1 cells +": cell+
<neuro_sys>
Nice, just pushed the changes
dave0 has joined #forth
<veltas>
Looking at your code has given me a good idea for my merge sort code
siraben has joined #forth
jimt[m] has joined #forth
xek_ has joined #forth
DKordic has quit [Remote host closed the connection]
<veltas>
But it's worth trying to make that smaller I think
<veltas>
neuro_sys: Is there anything you've made with these classic rewrites to put in your forth utils library?
<neuro_sys>
veltas: That library is useless at this point. I'd have to re-write them all.
<neuro_sys>
Maybe after I do day2, or possibly in day3 they may be needed, and reworked.
<veltas>
Luckily I think that forth is either especially reworkable, or it requires the skill of constant reworking regardless
<neuro_sys>
At least I can change them to use Dictionary instead of allocate, but so far I was imitating C-syntax, so they're pretty much moot at this point.
<veltas>
I didn't notice you using allocate previously
Gromboli has joined #forth
xek_ has quit [Ping timeout: 240 seconds]
Zarutian_HTC has joined #forth
gravicappa has quit [Ping timeout: 256 seconds]
gravicappa has joined #forth
jsoft has joined #forth
agspathis has joined #forth
jsoft has quit [Ping timeout: 240 seconds]
xek_ has joined #forth
agspathis has quit [Remote host closed the connection]
cp- has quit [Remote host closed the connection]
gravicappa has quit [Ping timeout: 240 seconds]
Zarutian_HTC has quit [Read error: Connection reset by peer]