Thank you, that looks like it will work well. Suitably low-level for my
purposes..

One question: >buffer-execute doesn't appear to be implemented:

ag -Q ">buffer-execute" ->

*66*:\ >buffer-execute ( ... c-addr u1 xt -- ... u2 ) execute xt while the

*82*:\ pad 0 ['] foo >buffer-execute >r drop ( throw away result of FOO )

*84*:\ r@ allocate throw r> 2dup 2>r ['] foo >buffer-execute drop 2r>

These are all comments. Is this word also available? I would prefer not to
dynamically allocate for this use.


cheers,

-Sam.


On Sun, Jan 12, 2014 at 12:13 PM, Bernd Paysan <[email protected]> wrote:

> Am Sonntag, 12. Januar 2014, 11:37:36 schrieb Sam Putman:
> > Hi,
> >
> > I am curious how to redirect the output of the `evaluate` word into a
> > counted string.
> >
> > That is, I'd like something like this:
> > : innerloop
> >
> > eval-pad cols accept
> > eval-pad swap evaluate
> > recurse ;
> >
> > To break it down to its essence, I want each `evaluate` call to return a
> > counted string to the stack, rather than to output to the current cursor
> > position.
> >
> > I'm new to gforth, and couldn't find this in the manual or glossary.
> > Apologies if I've overlooked an obvious word.
>
> The current development version (e.g. the last snapshot) has words for
> that,
> 0.7.x doesn't. But you can load str-exec.fs from the development branch
> into
> 0.7.3 without problems.
>
> https://github.com/forthy42/gforth/blob/master/str-exec.fs
>
> There are other ways to achieve what you want (of course), but this is
> probably the easiest one.
>
> --
> Bernd Paysan
> "If you want it done right, you have to do it yourself"
> http://bernd-paysan.de/
>

Reply via email to