Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001908OCamlOCaml generalpublic2003-10-31 11:032004-11-09 16:12
Reporteradministrator 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001908: [patch] pa_macro: support for a "NOTHING" macro; expand function expressions.
DescriptionFull_Name:
Version:
OS:
Submission from: charter-182-203.caltech.edu (131.215.182.203)


(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
epressions.

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) -
http://nogin.org/patches/ocaml-3.07-macro-nothing.patch [^] . 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 http://cvs.metaprl.org:12000/cvsweb/metaprl/util/Attic/pa_macro.ml?only_with_tag%3Docaml_3_07 [^]

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0003339)
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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker