Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001908OCaml~DO NOT USE (was: OCaml general)public2003-10-31 11:032004-11-09 16:12
Assigned To 
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001908: [patch] pa_macro: support for a "NOTHING" macro; expand function expressions.
Submission from: (

(1) When defining things with macros, it is very useful to be able to have
function applications in macro body that would have different arities in
different instances of the macro. Here is an example:

DEFINE MAP (name, param1, param2) = function
   [] -> []
 | (a,b) :: tl -> f param1 param2 :: name f tl

let rec iter1 f =
   MAP(iter1, a, NOTHING)

let rec iter2 f =
   MAP(iter2, a, b)

would define functions of the following types:

iter1: ('a -> 'c) -> ('a * 'b) list -> 'c list
iter2: ('a -> 'b -> 'c) -> ('a * 'b) list -> 'c list

(2) Currently, pa_macro does not expand macro parameters in function

I wrote a patch that implements the "NOTHING" keyword (it allows both defining a
macro to = NOTHING and passing NOTHING as argument to an existing macro) - [^] . It also makes sure
that macro parameters are properly substituted for in function expressions, and
in patters.

Note that the above patch is supposed to go on top of the five other pa_macro
patches I've submitted (0001901, 0001902, 0001904, 0001905, and 0001907). The end result
(pa_macro with all the patches applied) is also available on our CVS - please
see [^]

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
administrator (administrator)
2004-06-29 22:29

Fixed 2). Not convinced with 1).
MM, 2004-06-29

- Issue History
Date Modified Username Field Change
2005-11-18 10:14 administrator New Issue
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker