Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] failwith, raise and type inference
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] failwith, raise and type inference
> > > -. 3.**2.
> > > 
> > > returns 9. while in math -x^2 means -(x^2) and not (-x)^2 !
> >
> > I'm not sure there *are* any 'usual' rules in maths.
> 
> Well -x^2 as meaning -(x^2) *is* a usual rule -- no mathematician will
> ever understand  it as (-x)^2.   Still my question remains  as whether
> the above is intended by the  OCaml developpers or is just a case that
> "slipped through" (and an oddity that has bitten me once).

Off the top of my head, I'd say this behavior wasn't intentional and
is probably a mistake.  I haven't checked with the Yacc grammar, though
(Yacc is somewhat cranky with the precedences, and it happens that
expressing the right precedences isn't obvious.)

- Xavier Leroy

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners