Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005352OCamlCamlp4public2011-08-31 21:232012-08-22 08:01
ReporterDmitry Grebeniuk 
Assigned Todim 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionno change required 
PlatformOSOS Version
Product Version3.12.1 
Target VersionFixed in Version 
Summary0005352: camlp4rf: can't use __LOCATION__
Descriptioncamlp4rf does not allow to use __LOCATION__ in macros.

$ ocamlc.opt -version
3.12.1+rc1
$ ls
lo.ml _tags
$ cat lo.ml
DEFINE W = __LOCATION__;
value () = ignore W;
$ cat _tags
<*> : camlp4rf, warn_A
$ ocamlbuild lo.byte
+ /somepath/ocamlc.opt -c -w A -pp camlp4rf -o lo.cmo lo.ml
File "lo.ml", line 2, characters 18-19:
Error: Unbound module Loc
Command exited with code 2.
Compilation unsuccessful after building 2 targets (0 cached) in 00:00:00.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0006436)
dim (developer)
2011-12-21 11:58

camlp4rf allows __LOCATION__ in macros. Here is the output of "camlp4rf Io.ml":

  let () = ignore (Loc.of_tuple ("Io.ml", 1, 0, 11, 1, 0, 23, false))

The problem here is just that the Loc module is not defined. You have to write:

  open Camlp4.PreCast;

before using __LOCATION__.
(0007961)
hongboz (developer)
2012-08-22 04:02

why should use __LOCATION__ brings dependency on the whole camlp4?
(0007962)
dim (developer)
2012-08-22 08:01

It doesn't. You can write you own Loc module.

- Issue History
Date Modified Username Field Change
2011-08-31 21:23 Dmitry Grebeniuk New Issue
2011-08-31 21:23 Dmitry Grebeniuk Status new => assigned
2011-08-31 21:23 Dmitry Grebeniuk Assigned To => ertai
2011-10-26 08:32 ertai Assigned To ertai => xclerc
2011-12-21 11:58 dim Note Added: 0006436
2011-12-21 12:00 dim Assigned To xclerc => dim
2011-12-21 12:00 dim Status assigned => resolved
2011-12-21 12:00 dim Resolution open => no change required
2012-08-22 04:02 hongboz Note Added: 0007961
2012-08-22 08:01 dim Note Added: 0007962


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker