Commit ff3a9aac authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2002-12-01 20:52:33 by cvscast] Empty log message

Original author: cvscast
Date: 2002-12-01 20:52:33+00:00
parent 31583d6e
......@@ -15,6 +15,7 @@ type Tel = <tel>[ PCDATA ];;
<addr>"Scotland"
];;
(* converting an address book into a telephone list *)
fun mkTelList ([ (Name Addr Tel?)* ] -> [ (Name Tel)* ])
......@@ -27,6 +28,7 @@ fun mkTelList (Addrbook -> [ (Name Tel)* ])
<_>[ ( ( (x::Name) Addr (x::Tel) ) | _ )* ] -> x
;;
fun (Int -> Addrbook) x ->
<addrbook>[
<name>"Haruo Hosoya"
......@@ -39,6 +41,7 @@ fun (Int -> Addrbook) x ->
]
;;
match <addrbook>[
<name>"Haruo Hosoya"
<addr>"Tokyo"
......@@ -50,8 +53,10 @@ match <addrbook>[
] with
<_>[ ( ( (x::Name) Addr (x::Tel) ) | _ )* ] -> x;;
(*
(*
(* the pattern extract the full sequence of subelements *)
match ex with addrbook:[;a] -> mkTelList a;;
*)
*)
......@@ -999,7 +999,9 @@ struct
if x==ab then aux_ab else
aux x fields)) pr in
`Label (l1, pr, aux_ab)
| _ -> assert false
(* TODO:!!!*)
| ((`NoField|`SomeField),_) -> aux `Success fields
in
let line accu ((res,fields),acc) =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment