Liste des Groupes | Revenir à cl forth |
On 23/03/2025 10:25 pm, Hans Bezemer wrote:On 23-03-2025 04:03, dxf wrote:On 23/03/2025 2:51 am, sjack wrote:>Ruvim <ruvim.pinka@gmail.com> wrote:>
>An artificial example:>
While wondering down roads less taken, I took a path where
bacForth CUT: and -CUT were used in lieu of CATCH THROW .
Does anyone have a reference/details for this anywhere as I can't seem to
find anything?
>
A possibly useful hit but the doc is locked away:
>
https://doi.org/10.1145/165628.165637
Found it! Try this one: https://www.complang.tuwien.ac.at/anton/euroforth/ef96/gassanenko96b.txt
>
But I'm gonna spoil it for you: BacForth has an extra "L" stack. CUT: and -CUT use it. You might wanna use this one if you REALLY want it: https://sourceforge.net/p/forth-4th/code/HEAD/tree/trunk/4th.src/lib/stack.4th
>
It's code for a light weight stack. BTW, TRACKING is missing as well. It might have to do with this one? https://sourceforge.net/p/forth-4th/code/HEAD/tree/trunk/4th.src/lib/backtrak.4th
>
: CUT: \ mark the beginning of the fragment to cut
R> RP@ >L \ copy r-stack top addr. to L-stack
BACK LDROP TRACKING \ delete this mark when backtracking
>R ;
: -CUT R> L> RP! >R ; \ delete return points upto the marked addr.
: -NOCUT \ remove the mark, but not the return points
R>
L> RP@ - >R \ keep the mark as a relative address
BACK R> RP@ + >L TRACKING \ restore it when backtracking
>R ;
Thank you (and sjack) for chasing down this one. More detail appears to be
available in the SP-Forth sources directory: \devel\~profit\lib\bac4th.f
A CP1251 to Unicode converter is here:
https://convertcyrillic.com/#/convert
Les messages affichés proviennent d'usenet.