Dr. J. J. "One Eyed CrackerJack" Harbaugh 



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of A J Martin
Sent: Wednesday, November 26, 2003 1:11 AM
To: [EMAIL PROTECTED]
Subject: [REBOL] [Values] Penultimate Coerce



>> last "abcde"
== #"e"
>> penultimate "abcde"
== #"d"

Penultimate: func [
    "Returns the next-to-last value of a series."
    Series [series! port! tuple!]] [
    pick tail Series -2
    ]

>> coerce 1 none 12
== 1

Coerce: func [
    "Forces a value to be within limits."
    Low_Limit [number! pair! char! money! date! time! tuple! series!]
"Lower limit for value."
    Value [any-type!] "The value to limit."
    High_Limit [number! pair! char! money! date! time! tuple! series!]
"Upper limit for value."
    ] [
    if not number? Value [
        Value: Low_Limit
        ]
    Value: max Low_Limit Value
    Value: min Value High_Limit
    ]

Enjoy!

Andrew J Martin
Speaking in tongues and performing miracles.
ICQ: 26227169
http://www.rebol.it/Valley/
http://valley.orcon.net.nz/
http://Valley.150m.com/
-><-

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to