[REBOL] Re: Ranges in action
From: joel:neely:fedex at: 29-Oct-2002 6:21
Hi, Jan,
Jan Skibinski wrote:
> Hi All,
> I am attaching a bunch of short examples related
> to the range function (..)...
>
Let me suggest a trip down memory lane... (I can hardly believe
that it was over two years ago! ;-)
http://www.escribe.com/internet/rebol/m2952.html
(I admit that some might view my version of MAP that suppresses
NONE values to be a trick to get two uses from one function!)
Continued discussion on the list (esp. suggestions from Allen and
Andrew) identified some "opportunities" for improvement, so
http://www.escribe.com/internet/rebol/m2959.html
and
http://www.escribe.com/internet/rebol/m2962.html
presented improved versions of the demos.
Interestingly enough, this subject seems to come up about once a
year! The first round of email I have record of was early Oct
of 2000, then again in mid-Oct 2001. It must be Halliotaween!
> max-block [1 6 3 7 3]
> ; Picking max numerical values
>
> min-block [1 6 3 7 3]
> ; or minimum numerical values
>
REBOL has
>> maximum-of [1 6 3 7 3] == [7 3]
>> minimum-of [1 6 3 7 3] == [1 6 3 7 3]
which (as you can see) returns a reference to the series positioned
at the highest/lowest value, so you'll probably see the phrases
first maximum-of ...
and
first minimum-of ...
in some significant portion of their uses.
-jn-
--
; Joel Neely joeldotneelyatfedexdotcom
REBOL [] do [ do func [s] [ foreach [a b] s [prin b] ] sort/skip
do function [s] [t] [ t: "" foreach [a b] s [repend t [b a]] t ] {
| e s m!zauafBpcvekexEohthjJakwLrngohOqrlryRnsctdtiub} 2 ]