2013-04-18 08:06:33 -07:00
|
|
|
type t =
|
|
|
|
| A
|
2013-04-18 08:28:19 -07:00
|
|
|
| DBG [@IFDEF DEBUG] of string
|
|
|
|
| B
|
2012-06-29 03:04:17 -07:00
|
|
|
|
2013-04-18 08:06:33 -07:00
|
|
|
[%%IFDEF DEBUG]
|
|
|
|
let debug s = prerr_endline ([%GETENV DEBUG] ^ ":" ^ s)
|
2013-04-18 08:28:19 -07:00
|
|
|
let x = DBG "xxx"
|
2013-04-18 08:06:33 -07:00
|
|
|
[%%ELSE]
|
|
|
|
let debug _ = ()
|
2013-04-18 08:28:19 -07:00
|
|
|
let x = A
|
2013-04-18 08:06:33 -07:00
|
|
|
[%%END]
|
|
|
|
|
2013-04-18 08:28:19 -07:00
|
|
|
let f = function
|
|
|
|
| A -> "A"
|
|
|
|
| DBG s when [%IFDEF DEBUG] -> "DEBUG:" ^ s
|
|
|
|
| B -> "B"
|
|
|
|
|
2013-04-18 08:06:33 -07:00
|
|
|
let () = debug "ABC"
|
2012-06-29 03:04:17 -07:00
|
|
|
|
|
|
|
let () =
|
|
|
|
Printf.printf "compiled by user %s in directory %s\n%!"
|
2013-04-18 08:06:33 -07:00
|
|
|
[%GETENV USER]
|
|
|
|
[%GETENV PWD]
|
2013-09-26 01:03:49 -07:00
|
|
|
|