> Copy-pasting is so barbaric :) you could have achieved the same with /.../
oh, thanks, I'll replace it with this code instead...
You can imagine I've tried some other code but I didn't have the right
syntax...
for example:
* : do doer immediate does> for2 ;
which was wrong.
Mastering all this would require to already master Forth, and be
able to read all your doc.
I must admit all the DuskOS project is very well documented!
Browsing the project and trying to understand how all this is working
can be of valuable help to learn Forth...
On Fri, Feb 24, 2023, at 12:29 PM, farfadet10@gmx.fr wrote:
>> Copy-pasting is so barbaric :) you could have achieved the same with /.../
>
> oh, thanks, I'll replace it with this code instead...
>
> You can imagine I've tried some other code but I didn't have the right
> syntax...
>
> for example:
>
> * : do doer immediate does> for2 ;
>
> which was wrong.
>
> Mastering all this would require to already master Forth, and be
> able to read all your doc.
>
> I must admit all the DuskOS project is very well documented!
>
> Browsing the project and trying to understand how all this is working
> can be of valuable help to learn Forth...
Don't beat yourself too much over this, the way iterators work is mind bending
and you indeed have to be very familiar with Forth to understand what really
happens. I was teasing you with my joke.
In your specific attempt (the does-does> thing), there are two major problems
with it. First, you operated at the wrong level. You attempted to mimic the
structure of :iterator instead of the structure of for2, but :iterator is an
iterator *builder*, not an iterator. Second, referencing an immediate during
compilation ("for2" in the example) must be done with [compile]. Otherwise,
you're just executing for2 which of course breaks everything because you don't
have a closing "next".
Mastering immediate mechanics is very hard and hurts the mind, but it also makes
you think about computing differently and is a deeply enlightening experience.
I'm glad that you find the documentation clear as it's something that is hard to
know (whether it's clear) when you write about a subject you know.
Regards,
Virgil
> Mastering immediate mechanics is very hard and hurts the mind, but it
also makes you think about computing differently and is a deeply
enlightening experience.
I'm only at the beginning of the process to learn it :)
I've found an interesting thread about this subject:
https://old.reddit.com/r/Forth/comments/55b8ta/what_makes_immediate_mode_the_key_to_everything/
it's also talking about ANSI and the resistance against this!
> I'm glad that you find the documentation clear as it's something that
is hard to know (whether it's clear) when you write about a subject you
know.
well, most parts are clean and I also suppose a good programmer (which I
am not) can understand most of the concepts easily. I found it great
you've included into usage.txt some basics about Forth. I suppose it's
the goal to make in sufficient by itself.