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=0.0 required=5.0 tests=AWL 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 4F93ABBC1 for ; Fri, 25 Apr 2008 15:11:28 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtQCALp1EUjAXQIniGdsb2JhbACRWgEBAQ8gmjg X-IronPort-AV: E=Sophos;i="4.25,707,1199660400"; d="scan'208";a="11922785" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 25 Apr 2008 15:11:27 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m3PDBRFK002146 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 25 Apr 2008 15:11:27 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtQCAIN1EUhQRFuwiGdsb2JhbACRWgEBAQ8gmjc X-IronPort-AV: E=Sophos;i="4.25,707,1199660400"; d="scan'208";a="25490199" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP; 25 Apr 2008 15:11:26 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1JpNi1-0002bU-Ux for caml-list@inria.fr; Fri, 25 Apr 2008 14:11:26 +0100 Date: Fri, 25 Apr 2008 14:11:25 +0100 To: caml-list@inria.fr Subject: ANNOUNCE: pa_bitmatch 0.5 Message-ID: <20080425131125.GA4100@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Miltered: at concorde with ID 4811D87F.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 ocaml:01 ocaml:01 printf:01 syntax:01 experimental:01 strings:01 strings:01 rewritten:02 breaks:02 match:02 construct:02 string:02 string:02 redhat:03 I'm pleased to announce the (experimental) version 0.5 of pa_bitmatch, the syntax extension that adds Erlang-style bit strings and bit string matching to OCaml. http://et.redhat.com/~rjones/bitmatch/ In this release: - The "bitmatch" operator has been rewritten to use patterns properly (before it was using a hack involving expressions). One consequence of this is that you can now use all the features of OCaml patterns, eg: bitmatch packet with | { ((4|6) as ip_version) : 4 } -> printf "I understand IPv4 or v6, this is version %d\n" ip_version - You can now match and construct using plain strings: bitmatch file with | { "MAGIC" : 40 : string } -> ... - Error messages are now localized all the way down to individual fields in the pattern, which makes it a lot easier to chase errors. - You need to put { ... } around all fields. Sorry, this breaks the syntax, but (a) it makes it much easier to use the extension with common editors, and (b) it's a very simple mechanical change to existing code. I'll try not to change the syntax again if I can avoid it. Rich. -- Richard Jones Red Hat