str.cd 407 Bytes
Newer Older
1 2
type Bool = `True | `False;;

3
let fun check (String -> Bool)
4 5 6 7 8 9
  | [ _* 'Castagna' _* ] -> `True
  | _ -> `False
in
(check "Giuseppe Castagna",
 check "Alain Frisch"
);;
10 11


12
let fun extr (String -> String)  [ (('a' x::_) | _)* ] -> x
13 14 15 16
in
extr "abcaxy";;


17 18
type Text = [ (Char | <comment>[ PCDATA ])* ];;
let fun extr (Text -> String) [ (x::PCDATA | _)* ] -> x
19 20
in
extr [ 'abc' 'def' <comment>['Blabla'] 'xyz' ];;