ANN: 'roll' and '-roll' implementation
David McNab <[email protected]> Wed, 01 Dec 2004 01:09:57 +1300
| Newsgroups | gmane.comp.lang.forth.picforth |
|---|---|
| Message-ID | <[email protected]> |
Hi PicForthers, I've implemented the ANS CORE EXT standard word 'roll' - which I'm sure many have wanted (especially since PicForth has no 'rot' or '-rot'. Also, I've implemented its non-standard converse, '-roll' (inspired by FICL Forth, http://ficl.sf.net). Details and module source file on wiki: http://wiki.enst.fr/bin/view/Picforth/Roll IMHO, 'roll' is a very important word for Forth in general, since it opens up the whole data stack for full read/write random access, picking up where 'pick' leaves off. It's relatively expensive for execution time - 24+8n instruction cycles (including interrupt suspend/restore, where n is the passed argument). Samuel - please feel free to absorb this into the main PicForth tree (with or without your optimisations), or leave it on the wiki, or just ignore, as you wish. If you do absorb it into the main tree, you might like to introduce an 'autoload' mechanism in the style of what you've already done with libstore.fs, libfetch.fs etc. All is up to you, since PicForth is your turf. -- Cheers David