caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe Filliatre <filliatr@lri.fr>
To: Mehdi <mehdid@gmail.com>
Cc: jeremy <flashvan@gmail.com>, caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] How can I have a string matched my custom type?
Date: Mon, 28 May 2007 20:07:11 +0200	[thread overview]
Message-ID: <18011.6735.85307.153103@serveur9-10.lri.fr> (raw)
In-Reply-To: <765e2be00705281054h4f77a584y1f12f15c7bd0d284@mail.gmail.com>


Mehdi writes:
 > 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")

This is a Genlex limitation. "-2" is recognized as an integer
constant. Thus you need to add extra space:

======================================================================
# parse "1*3 - 2";;
- : expr = Minus (Times (Value "1", Value "3"), Value "2")
======================================================================

 > I also didn't understand why there is this in "term" :
 > 
 > >    | _ -> f
 > >    | _ -> failwith "syntax error"

Simply because I wrote this code in a rush :-) Forget about the last
line.

-- 
Jean-Christophe


  reply	other threads:[~2007-05-28 18:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-28 15:46 jeremy
2007-05-28 16:14 ` [Caml-list] " Jean-Christophe Filliatre
2007-05-28 17:54   ` Mehdi
2007-05-28 18:07     ` Jean-Christophe Filliatre [this message]
2007-05-28 18:23       ` Mehdi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18011.6735.85307.153103@serveur9-10.lri.fr \
    --to=filliatr@lri.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=flashvan@gmail.com \
    --cc=mehdid@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).