Cant' speak for all subscribers, but I don't mind the questions.

How about this?

: get-chunk ( alist id -- chunk )
    swap at* [
        first <msb0-bit-reader>
    ] [
        "Missing chunk type" throw-set-loading-error
    ] if ;

: bsread-string ( count width bitreader -- string )
    '[ _ _ bsread ] replicate ascii decode ;

: parse-sc ( -- head )
    25 7 test "SC" get-chunk bsread-string ;



On Sat, Dec 13, 2014 at 5:40 PM, Mark Green <m...@antelope.nildram.co.uk>
wrote:

> If you want me to stop posting these just tell me so. I don't want to be a
> pain.
>
> Is there a good way to tidy this up to get rid of the large number of
> swaps?
>
> Mark
>
> : get-chunk ( alist id -- chunk )
>     swap at*
>     [ "Missing chunk type" throw-set-loading-error ] unless
>     0 swap nth <msb0-bit-reader> ;
>
> : bsread-string ( count width bitreader -- string )
>     '[ _ _ bsread ] replicate ascii decode ;
>
> : parse-sc ( -- head ) test "SC" get-chunk
>   25 swap 7 swap bsread-string ;
>
>
>
> ------------------------------------------------------------------------------
> 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

Reply via email to