Re: Local variables controversial?



Ian Osgood wrote:
>

> ASCII trick:
>
> : toLower ( [A-Z] -- [a-z] ) $20 OR ;

I'd make sure it wasn't a character not in the range A-Z :

: >lower ( char -- lcase[a-z] | char )
DUP [CHAR] A MAX
OVER [CHAR] Z MIN = \ character in A-Z ?
32 AND OR \ 32 TRUE AND = 32, 32 FALSE AND = 0
;



--
Julian V. Noble
Professor Emeritus of Physics
jvn@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
^^^^^^^^^^^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/

"For there was never yet philosopher that could endure the
toothache patiently."

-- Wm. Shakespeare, Much Ado about Nothing. Act v. Sc. 1.
.



Relevant Pages