Version franaise
Home About Download Resources Contact us
Browse thread
How can I have a string matched my custom type?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Mehdi <mehdid@g...>
Subject: Re: [Caml-list] How can I have a string matched my custom type?
There a little problem when you try to compute

> let e = parse "1*3-2";;


I get :

>  val e : expr = Times (Value "1", Value "3")
>

I didn't understand why it forgets to "minus 2" at the end. As I'm not
familiar with Genlex, can anyone tell me why isn't working ?
Am I missing somesthing ?

I also didn't understand why there is this in "term" :

>    | _ -> f
>    | _ -> failwith "syntax error"



-- 
Mehdi Dogguy
مهدي الدڤي