From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 393EFBDE6 for ; Tue, 6 Sep 2005 10:03:58 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j8683v7C028623 for ; Tue, 6 Sep 2005 10:03:58 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA02905 for ; Tue, 6 Sep 2005 10:03:57 +0200 (MET DST) Received: from mx1.mail.ru (mx1.mail.ru [194.67.23.121]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j8683ulN028620 for ; Tue, 6 Sep 2005 10:03:57 +0200 Received: from [195.245.255.11] (port=35861 helo=bely) by mx1.mail.ru with asmtp id 1ECYQt-0004ey-00 for caml-list@inria.fr; Tue, 06 Sep 2005 12:03:56 +0400 Received: from localhost (HELO BELY) [127.0.0.1] by bely (0.0.0.2) with ESMTP (Classic Hamster Vr. 2.0 Build 2.0.0.1) ; Tue, 06 Sep 2005 12:07:27 +0400 To: caml-list@inria.fr Subject: camlp4 pa_macro From: Dmitry Bely Date: Tue, 06 Sep 2005 12:07:26 +0400 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (chayote, windows-nt) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Posting-Agent: Hamster/2.0.0.1 X-Miltered: at nez-perce with ID 431D4D6D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 431D4D6C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ifdef:01 ndebug:01 expr:01 expr:01 printf:01 printf:01 ndebug:01 ...:98 constructor:01 expression:01 expression:01 define:01 define:01 dmitry:01 dmitry:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Is it possible to achieve with pa_macro something like this: IFDEF NDEBUG THEN DEFINE LOG(expr) = () ELSE DEFINE LOG(expr) = Printf.printf expr ENDIF ... LOG("x=%d,y=%d" x y); Unfortunately the code above does not work: debug version is OK, but then NDEBUG is turned on I have "This expression is not a function, it cannot be applied" on LOG() expression. If I use LOG "x=%d,y=%d" x y; then the release version surprisingly works, but the debug one gives "Parse error: currified constructor" How to overcome this? Another question: is there an up-to-date Camlp4 manual with all standard extensions (like pa_macro) properly documented? - Dmitry Bely