> As it turns out, it isn't possible to do this in REBOL with
> purely functional code because there doesn't seem to be a
> way to prepend an element to a block in a non-destructive
> way. However, if we cheat a little and introduce these
> functions:
>
> prepend: func [item blk] [
> result: make block! (length? blk) + 1 insert result
> item insert next result blk return result ]
What's wrong with:
prepend: func [item blk][append reduce [item] blk]
?
-jeff
- [REBOL] Encouraging functional programming a142808
- [REBOL] Encouraging functional programming Re: jeff
- [REBOL] Encouraging functional programming Re: dankelg8
- [REBOL] Encouraging functional programming Re: joel . neely
- [REBOL] Encouraging functional programming a142808
- [REBOL] Encouraging functional programming a142808
- [REBOL] Encouraging functional programming a142808
- [REBOL] Encouraging functional programming a142808
