the newline _character_?

Ulf Wiger etxuwig@REDACTED
Thu Nov 21 18:07:52 CET 2002


On Thu, 21 Nov 2002, Bengt Kleberg wrote:

>moreover, is there is_whitespace() function is some module?

In xmerl, it's done like this:

%% whitespace consists of 'space', 'carriage return',
%% 'line feed' or 'tab'
-define(whitespace(H), H==?space ;
                       H==?cr ;
                       H==?lf ;
                       H==?tab).

Example:

scan_prolog(T = [H|_], S, Pos) when ?whitespace(H) ->
    ?dbg("prolog(whitespace)~n", []),
    ?strip1,
    scan_prolog(T1, S1, Pos).


Beautiful, eh?  ;-)

/Uffe

-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson Telecom AB, ATM Multiservice Networks




More information about the erlang-questions mailing list