caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Difference in Quotation Behavior for str_items Between Revised and Original Syntax
@ 2007-11-25 18:20 echinuz echinuz
  0 siblings, 0 replies; only message in thread
From: echinuz echinuz @ 2007-11-25 18:20 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 954 bytes --]

Hi,
      Consider the following two programs:

----------------------------------------------------------
$ cat junk.ml 
let _=fun x ->
    match x with
    | <:str_item< $exp:e$ >> -> ()
    | _ -> ()
;;

$ camlp4of ./junk.ml 
fun x ->
  match x with
  | Ast.StSem (_, (Ast.StExp (_, e)), (Ast.StNil _)) -> ()
  | _ -> ()
----------------------------------------------------------

and

----------------------------------------------------------
$ cat junk_r.ml 
value _=fun x ->
    match x with
    [ <:str_item< $exp:e$ >> -> ()
    | _ -> ()]
;

$ camlp4rf ./junk_r.ml 
let _ x = match x with | Ast.StExp (_, e) -> () | _ -> ()
----------------------------------------------------------

Why does the second program expand to Ast.StExp while the first expands to Ast.StSem?  I would like, and expect, the first case to expand to Ast.StExp and not Ast.StSem.

       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.

[-- Attachment #2: Type: text/html, Size: 1308 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-25 18:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-25 18:20 Difference in Quotation Behavior for str_items Between Revised and Original Syntax echinuz echinuz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).