chitselb wrote:
Copying a block looks something like
Code:
: copy ( from to -- )
swap block pad b/buf cmove
pad swap block b/buf cmove update ;
I needed to move one of my blocks and made use of the fact that BUFFER leaves the data in the one and only buffer in place, so I only needed:
Code:
: copy ( from to -- )
swap block drop
buffer update ;
That only works, of course, on a single buffer forth where the word BUFFER doesn't just have BLOCK in it, which I've seen in some other Forths. Your code is much more portable as it will work on any Forth that supports blocks.
Thanks for the demo of using PAD, in any event. I always forget that it's there and this is the perfect example of its use.