[REBOL] Re: GPS: minimizing sum of squares algorithm
From: g:santilli:tiscalinet:it at: 11-Nov-2002 11:31
Hi Jan,
On Sunday, November 10, 2002, 9:14:54 PM, you wrote:
JS> Few things have bitten me though. I am still not used
JS> to certain "in-place" behaviour of certain functions, such
JS> as 'replace, or worst of all 'reverse, which returns empty
JS> block. This bites badly in pipelines of expressions.
I don't know why REVERSE returns the tail of the block. You can
use HEAD REVERSE in expressions, or patch it like this:
use [_reverse] [
_reverse: :reverse
reverse: func [
"Reverses a series."
value [series! tuple! pair!]
/part "Limits to a given length or position."
range [integer! series!]
] [
head either part [_reverse/part value range] [_reverse value]
]
]
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r