From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_WHOIS,HTML_MESSAGE autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 3B569BC6B for ; Sun, 25 Nov 2007 19:20:43 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGNLSUfRSbJYn2dsb2JhbACCPjWMTAEBAQEHBAYJCBg X-IronPort-AV: E=Sophos;i="4.21,464,1188770400"; d="scan'208";a="6157623" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 25 Nov 2007 19:20:43 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id lAPIKgpw003361 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sun, 25 Nov 2007 19:20:42 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGNLSUfRSbJYn2dsb2JhbACCPjWMTAEBAQEHBAYJCBg X-IronPort-AV: E=Sophos;i="4.21,464,1188770400"; d="scan'208";a="6157622" Received: from web60120.mail.yahoo.com ([209.73.178.88]) by mail3-smtp-sop.national.inria.fr with SMTP; 25 Nov 2007 19:20:41 +0100 Received: (qmail 84500 invoked by uid 60001); 25 Nov 2007 18:20:40 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=qzgaOThLIglPlrdqQMxqqbIIq0N5RxgvSZy1wyXh/0coUkz1Zjf4uDz9FPEoo1uvbt11sd8RXun1N/R6iLMnOIi5ddqSomOkxVHx1OWHdy/7PI5jpcDWRlfPIBJd/oUXL1MfBKtpy29PogmzcFylrQhS2nkkZVNg0utSZSoP+9s=; X-YMail-OSG: s7v9AQcVM1kWumiMUZRZEPKU7SBIBeRRTt2sX0c7n7Yk6lXurTnT31JUsBHbd8QM3CgX6Hf1nB1.6REJwJKXHSN_aKK2OHkWz7u6Jv0QbvxtxXXO3Ohp Received: from [71.240.7.189] by web60120.mail.yahoo.com via HTTP; Sun, 25 Nov 2007 10:20:40 PST Date: Sun, 25 Nov 2007 10:20:40 -0800 (PST) From: echinuz echinuz Subject: Difference in Quotation Behavior for str_items Between Revised and Original Syntax To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1294506411-1196014840=:83934" Content-Transfer-Encoding: 8bit Message-ID: <591732.83934.qm@web60120.mail.yahoo.com> X-Miltered: at discorde with ID 4749BCFA.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 camlp:01 camlp:01 ast:02 ast:02 exp:02 exp:02 match:02 match:02 revised:02 let:03 let:03 expands:07 expands:07 quotation:08 --0-1294506411-1196014840=:83934 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. --0-1294506411-1196014840=:83934 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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. --0-1294506411-1196014840=:83934--