I like dup <byte-array>, personally, but this pattern (used sometimes with tri also) is an experiment in readability avoiding stack shuffle words. As you say, the code is identical, but often fewer tokens is preferred.
> On Mar 1, 2017, at 11:46 AM, Alexander Ilin <[email protected]> wrote: > > Hello! > > Noticed this code: > > ``` > M: windows-crypto-context random-bytes* ( n windows-crypto-context -- bytes ) > handle>> swap [ ] [ <byte-array> ] bi > [ CryptGenRandom win32-error=0/f ] keep ; > ``` > > Is the construction `[ ] [ <byte-array> ] bi` somehow idiomatic? > How is it better than `dup <byte-array>`? Is it more readable? > Or should it be replaced with the shorter version? > > ---=====--- > Александр > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Factor-talk mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/factor-talk ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
