From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id B8E657ED34 for ; Fri, 13 Jul 2012 13:10:37 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of danbensen@att.net) identity=pra; client-ip=98.139.44.145; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="danbensen@att.net"; x-sender="danbensen@att.net"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of danbensen@att.net) identity=mailfrom; client-ip=98.139.44.145; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="danbensen@att.net"; x-sender="danbensen@att.net"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@nm18.access.bullet.mail.sp2.yahoo.com) identity=helo; client-ip=98.139.44.145; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="danbensen@att.net"; x-sender="postmaster@nm18.access.bullet.mail.sp2.yahoo.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au8LACcBAFBiiyyRbmdsb2JhbABFgkq1dg0JDBwnghcJAQEEAScZAQEBATUBAQMLCwMBQlcGiBABAwYGp1+ELgEFAYUbAkgFiU8BBpEyiE6ERogwhU8tjQI X-IronPort-AV: E=Sophos;i="4.77,579,1336341600"; d="scan'208,217";a="166736512" Received: from nm18.access.bullet.mail.sp2.yahoo.com ([98.139.44.145]) by mail1-smtp-roc.national.inria.fr with SMTP; 13 Jul 2012 13:10:36 +0200 Received: from [98.139.44.101] by nm18.access.bullet.mail.sp2.yahoo.com with NNFMP; 13 Jul 2012 11:10:35 -0000 Received: from [98.139.44.67] by tm6.access.bullet.mail.sp2.yahoo.com with NNFMP; 13 Jul 2012 11:10:35 -0000 Received: from [127.0.0.1] by omp1004.access.mail.sp2.yahoo.com with NNFMP; 13 Jul 2012 11:10:35 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 761246.92439.bm@omp1004.access.mail.sp2.yahoo.com Received: (qmail 9901 invoked by uid 60001); 13 Jul 2012 11:10:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=att.net; s=s1024; t=1342177835; bh=YvxJAPDOWI5geZepjof5yOo7G1iB8N06rNCMySmw8dQ=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=4hJRTTj9yJ8Y+zBKt9MWslEhjTQb1x93JGiy04L9u2rlKvygpt5jnKggk97vF5y0oiuIZC8d+0pdgoLm5aJ9TrZLNlvfAhpyN52mhFIw0xWC9i3g7z02neOPFo6njKOP7pv/U0mI0j8MkDhKtc5hahY4/4Y29taasP8t6lSoKKc= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=att.net; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=Hi7lOwyOaGe8rILvYCJf4+vCq7s0yUiJe/kuLOitCoDaOqkJfWkfeJK3BboElRgLVVwqYPOgu+ZUxDSmbD0ky5INu2uFiVlsmZBtDBpah/sIExER1/Hg8gaZ00M1lG6C9HIq4XIshirA64aP0gusroAp/2OGvaKtAw2Hf3gOOc0=; X-YMail-OSG: oR4N0asVM1npEM0FDZuS9pQAu7ZOyK4ig6ZPg7W4aQNdPM2 FSWKYdif_6Jxa.5YkvOAL43Z58aCdy5WZU3FxDPuBSiLGu7h91I6Pz_jsebY VhSy5sWRqnHTGs0vcpwubCAhPZKqBZ9a6PVfKUurnL_ZpTu9hHCG9W.PKYka 9hem_8rsaUcIhOIjuhZUZONNnXfnBTS3KFk0ou1OSpOvSDfXXlvaFiNcWeHh GpU_.C7N3uqsT9sTG7uuG0enMUw2CjmLipLPnujyxDbCSXIfd_waBXX0iQ8X AARDQFds_fLXqCBGZt7MmtLDWv9lRKmcezXV5622ZTdzHnC5Ra21VVNDYFzB hlYrScO4xwIfudy7.sev0Ab1D6V714RlYlOw0Mv_f5ReFBIVx7FMRraVn1lx zd0Y51L_on5eksLqmAp2G4UuxZzOixiMLvn7v7cEkzVtKsQ-- Received: from [70.225.177.206] by web180015.mail.gq1.yahoo.com via HTTP; Fri, 13 Jul 2012 04:10:35 PDT X-Mailer: YahooMailRC/708 YahooMailWebService/0.8.120.356233 References: <1342169284.53181.YahooMailRC@web180016.mail.gq1.yahoo.com> Message-ID: <1342177835.91854.YahooMailRC@web180015.mail.gq1.yahoo.com> Date: Fri, 13 Jul 2012 04:10:35 -0700 (PDT) From: Dan Bensen To: Gabriel Scherer Cc: caml-list@inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="571421679-1668172854-1342177835=:91854" Subject: Re: [Caml-list] analyzing Camlp4 nodes --571421679-1668172854-1342177835=:91854 Content-Type: text/plain; charset=us-ascii > > Is there a way to compare a Camlp4 ast node to a quotation > > that ignores the locations? > If your question is: how do I text that two pieces of ASTs are equal > *modulo* the location (the term structure is the same but the > locations are allowed to be different), then you can do that by > erasing the locations. Untested code: > > let strip_locations = Ast.map_loc (fun _ -> Loc.ghost) > let equal_modulo_loc a b = (strip_locations a) = (strip_locations b) Yes, that's it. Thanks. (sorry about the double post) --571421679-1668172854-1342177835=:91854 Content-Type: text/html; charset=us-ascii
> > Is there a way to compare a Camlp4 ast node to a quotation
> > that ignores the locations?

> If your question is: how do I text that two pieces of ASTs are equal
> *modulo* the location (the term structure is the same but the
> locations are allowed to be different), then you can do that by
> erasing the locations. Untested code:
>
>   let strip_locations = Ast.map_loc (fun _ -> Loc.ghost)
>   let equal_modulo_loc a b = (strip_locations a) = (strip_locations b)

Yes, that's it.  Thanks.

(sorry about the double post)
--571421679-1668172854-1342177835=:91854--