[mercury-users] Mercury programmer required ;-)

Juergen Stuber juergen at mpi-sb.mpg.de
Fri Sep 25 22:44:59 AEST 1998


Peter Schachte <pets at cs.mu.OZ.AU> writes:
>
> 	rot13_char(Ch, Rot) :-
> 		(   is_alpha(Ch) ->
> 			to_upper(Ch, Up),
> 			Letter is Up - 0'A,
> 			Rot is Ch + ((Letter + 13) mod 26) - Letter
> 		;   Rot = Ch
> 		).

This would break already in ISO 8859-1 if is_alpha/1
and to_upper/2 were extended to accented letters or umlauts.

Jürgen

-- 
Jürgen Stuber <juergen at mpi-sb.mpg.de>
http://www.mpi-sb.mpg.de/~juergen/



More information about the users mailing list