You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1907 Reporter: administrator Status: closed (set by @gasche on 2013-07-27T05:45:04Z) Resolution: fixed Priority: normal Severity: feature Fixed in version: 3.10.0 Category: ~DO NOT USE (was: OCaml general) Monitored by: nogin
Bug description
Full_Name: Aleksety Nogin
Version: 3.07pl2
OS: Red Hat Linux
Submission from: charter-182-203.caltech.edu (131.215.182.203)
a) It would be nice if pa_macros supported "local" macros where definition is a
part of an expression, not a separate str_item.
For example:
....... some code .....
DEFINE body =
...
...
IN
IFDEF DEBUG_BUILD THEN
try body
with
.... print a lot of debug information ...
ELSE body ENDIF
While one could also write
try
...
...
with exn ->
IFDEF DEBUG_BUILD THEN
.... print a lot of debug information ...
ELSE
raise exn
ENDIF
the latter is likely to be compiled into much less efficient code in
non-DEBUG_BUILD case.
b) Currently macro parameters are not expanded inside "try .. with .."
expressions.
Original bug ID: 1907
Reporter: administrator
Status: closed (set by @gasche on 2013-07-27T05:45:04Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 3.10.0
Category: ~DO NOT USE (was: OCaml general)
Monitored by: nogin
Bug description
Full_Name: Aleksety Nogin
Version: 3.07pl2
OS: Red Hat Linux
Submission from: charter-182-203.caltech.edu (131.215.182.203)
a) It would be nice if pa_macros supported "local" macros where definition is a
part of an expression, not a separate str_item.
For example:
....... some code .....
DEFINE body =
...
...
IN
IFDEF DEBUG_BUILD THEN
try body
with
.... print a lot of debug information ...
ELSE body ENDIF
While one could also write
try
...
...
with exn ->
IFDEF DEBUG_BUILD THEN
.... print a lot of debug information ...
ELSE
raise exn
ENDIF
the latter is likely to be compiled into much less efficient code in
non-DEBUG_BUILD case.
b) Currently macro parameters are not expanded inside "try .. with .."
expressions.
I have a small patch that implements "DEFINE ... IN" and fixes (b) -
http://nogin.org/patches/ocaml-3.07-macro-localdefine.patch
Note that the above patch is supposed to go on top of the four other pa_macro
patches I've submitted (#1901, #1902, #1904, and #1905). 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=ocaml_3_07
The text was updated successfully, but these errors were encountered: