Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003414OCamlOCaml generalpublic2005-01-02 11:552014-07-26 22:36
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003414: Relative precedence of -. and **
DescriptionFull_Name: Christophe TROESTLER
Version: 3.08.2
OS: GNU/Linux
Submission from: (

It would be nice that -. and ** behave like in math. Specifically,

let x = 3. in
-. x**2.

sould return -9. (i.e. be parsed as -. (x**2.)) rather than the current 9.
(because it is seen as (-. x)**2.). The same therefore should also hold for
-.3.**2. and -3.**2. (while it is more debatable for the latter as -3. can be
seen as a constant...).

Best regards,

Attached Filespatch file icon 0001-Parse-.x-2.-unary-.-as-.-x-2.patch [^] (3,772 bytes) 2013-08-20 15:23 [Show Content]

- Relationships

-  Notes
Christophe Troestler (reporter)
2013-08-20 15:29

Tentative patch attached. Hope you are happy with it — this issue has been opened for a long time.
doligez (administrator)
2013-09-03 13:18

A general remark: we are very weary of changing the grammar because it's hard to tell how many programs this will break. In this particular case, the typechecker will not help at all in tracking the change, so programs will just start returning the wrong result without any hint of what is wrong.

I think it's pretty unlikely that we will ever dare to make this change.
Christophe Troestler (reporter)
2014-07-26 22:36

Patch updated against the current trunk. [^]

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2013-08-20 15:23 Christophe Troestler File Added: 0001-Parse-.x-2.-unary-.-as-.-x-2.patch
2013-08-20 15:29 Christophe Troestler Note Added: 0010208
2013-08-20 15:38 Christophe Troestler Note Added: 0010209
2013-08-23 16:44 Christophe Troestler Note Deleted: 0010209
2013-09-03 13:18 doligez Note Added: 0010301
2013-09-03 13:18 doligez Tag Attached: patch
2014-07-26 22:36 Christophe Troestler Note Added: 0011928

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker