Fwd: Re: Wishes: hex-output

Robert Virding <>
Wed Feb 7 12:09:54 CET 2001


Robert Virding <> writes:
>OK, that would have to be coded something like:
>
>ucase([C|Cs]) when C >= $a, C =< $z -> [C - ($a-$A)|ucase(Cs)];
>ucase([C|Cs]) when C >= $ß, C =< $ÿ, C /= $÷ ->
>    [C - ($À -$ß)|ucase(Cs)];

Whoops, that should be:

ucase([C|Cs]) when C >= $a, C =< $z -> [C - ($a-$A)|ucase(Cs)];
ucase([C|Cs]) when C >= $ß, C =< $ÿ, C /= $÷ ->
    [C - ($ß -$À)|ucase(Cs)];

Note that the compiler will optimize the ($a-$A) and ($ß -$À) 
expressions, but it can't handle the eqivalent C + $A -$a.

	Robert





More information about the erlang-questions mailing list