[REBOL] Re: can't quite get it right...
From: arolls:bigpond:au at: 7-Sep-2001 21:55
> is-upper-char: func [ch[char!]][
> either all [(ch >= #"A") (ch <= #"Z")]
> [return true]
> [return false]
> ]
The above function could be trimmed a little
bit:
uppercase?: func [
ch [char!]
][
return either all [(ch >= #"A") (ch <= #"Z")][true][false]
]
We can trim out the either and the return as well:
uppercase?: func [
ch [char!]
][
all [(ch >= #"A") (ch <= #"Z")]
]
Although this last one returns none instead of
false, it can still be used, since logically
none is equivalent to false. You can use it in
an if statement.
:)