1. What else are mailing lists for? :)
2. John's suggestion is good (to just rework the program), but in the
future / other situations, it may also make sense to look into the right
dataflow combinator (
http://docs.factorcode.org/content/article-dataflow-combinators.html). For
instance, instead of `25 swap 7 swap`, you can say `[ 25 7 ] dip`. There's
a combinator for reaching 3 deep, too:
http://docs.factorcode.org/content/word-3dip%2Ckernel.html
3. To your particular problem of applying `bsread-string` to multiple pairs
of values, there are apply combinators that might help:
http://docs.factorcode.org/content/word-2bi__at__%2Ckernel.html
http://docs.factorcode.org/content/word-2tri__at__%2Ckernel.html
http://docs.factorcode.org/content/word-mnapply%2Cgeneralizations.html
For example, `4 7 8 7 [ bitreader bsread-string ] 2bi@` could be
accomplished with `bitreader` atop the stack by saying `[ 4 7 8 7 ] dip [
bsread-string ] curry 2bi@`.
On Sun, Dec 14, 2014 at 8:54 AM, Mark Green <m...@antelope.nildram.co.uk>
wrote:
>
> That's very helpful, but the thing is that what I really want to do is to
> pull a series of fields from the bitreader and store them in a tuple via
> boa. Something like bitreader [ 4 7 bsread-string ] [ 8 7 bsread-string ]
> tri boa . The problem is that to do that I need a version of bsread-string
> that takes the bitreader argument as the deepest rather than the
> shallowest, and I don't see any way of doing that (other than using locals)
> because it's hard to reach down 3 steps on the stack. Is there any way of
> doing this?
>
> Mark
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk