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=3.0 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 A634CBBAF for ; Sun, 22 Mar 2009 17:24:13 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtACADsDxknRVdq0kGdsb2JhbACVLz8BAQEBCQkMBxEDrRqBB40eAQMBA4N7Bg X-IronPort-AV: E=Sophos;i="4.38,403,1233529200"; d="scan'208";a="24754072" Received: from mail-bw0-f180.google.com ([209.85.218.180]) by mail3-smtp-sop.national.inria.fr with ESMTP; 22 Mar 2009 17:24:13 +0100 Received: by bwz28 with SMTP id 28so1736218bwz.27 for ; Sun, 22 Mar 2009 09:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=H6TgzU4K8MUfEnQvRyaCT8tH+ywZIGAe0ipLVVCXPWU=; b=qC0gtAFGDpZZj6Fixw6kc/IYfWqYtG6mwg5L9O6jqI1LN6+a/zQUoV0daevSdqOqRB ewU3cJV6gcS4X5dSQTCemkTik8ft0/FGPgG86jwseuKeQrhLMORwQaiYPdLk6NEav7os LCjEpjhXX8DwSNsrdT5HbzDGxsxWtpImNpuJg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=r+LrWNdB289YJO8dLB5PtE0vgo/ljxBcfhGls54VYApolcwBrzlMAPy/iCOZ84KqQ7 Q3rPLr3uqfk+gQdZr6fTT4SJFMRlVreWosidBSvDxzTP4FVvdaE7R5XD/H5c7c2F1hKd jtkHTOyH0rb+uQJscJjFxt7LZQ3A6ghsL6szc= MIME-Version: 1.0 Received: by 10.204.65.17 with SMTP id g17mr2142159bki.193.1237739052691; Sun, 22 Mar 2009 09:24:12 -0700 (PDT) Date: Sun, 22 Mar 2009 17:24:12 +0100 Message-ID: <6b546c750903220924p1d845975qc4436f46ec1d1361@mail.gmail.com> Subject: printing the AST of a caml function From: Zorg 421 To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; lexing:01 printast:01 stdout:01 cmx:01 ocamlopt:01 lib:01 ocaml:01 cmx:01 linenum:01 lexer:01 syntaxerr:01 clflags:01 parser:01 printast:01 lexing:01 Hello, I want to play/understand the caml AST, so I try using this code snippet: --- let factstring = "let rec fact n = if n < 1 then 0 else n * fact (n-1)" in let tree = Parse.implementation (Lexing.from_string factstring) in Printast.implementation (Format.formatter_of_out_channel stdout) tree --- and this build script (~15 minutes spent in ordering correctly the .cmx :-/ ) --- #!/bin/sh ocamlopt -I /opt/godi/lib/ocaml/compiler-lib/ misc.cmx linenum.cmx warnings.cmx location.cmx lexer.cmx syntaxerr.cmx config.cmx clflags.cmx parser.cmx parse.cmx printast.cmx lexing.cmx format.cmx factast.ml -o factast --- But the linker is confused by the Lexing module of stdlib: Files /opt/godi/lib/ocaml/std-lib/lexing.cmx and /opt/godi/lib/ocaml/std-lib/stdlib.cmxa both define a module named Lexing How can I prevent the linker to look in /opt/godi/lib/ocaml/std-lib/ or /opt/godi/lib/ocaml/std-lib/stdlib.cmxa ? regards.