With this in mind I essayed the following

**Tutorial D**operator definition:

operator is_num (s CHAR ) returns BOOLEAN ;

begin ;

var i integer init(0);

var b BOOLEAN INIT(TRUE);

if s = '' then return false; end if;

while i < LENGTH(s);

begin;

if IS_EMPTY ( RELATION{ TUPLE { c SUBSTRING(s,i,i+1) } } JOIN

RELATION{

TUPLE { c '1' },

TUPLE { c '2' },

TUPLE { c '3' },

TUPLE { c '4' },

TUPLE { c '5' },

TUPLE { c '6' },

TUPLE { c '7' },

TUPLE { c '8' },

TUPLE { c '9' }

} )

then b := FALSE ;

END IF ;

i := i + 1 ;

END ;

END WHILE;

RETURN b ;

END;

END OPERATOR ;

This works fine but takes for ages--try is_num('123')! This probably doesn't matter much, but if a FOREIGN Java implementation would be another easy one-liner, then it might be worth including with the set of string operators.

Hugh