caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: caml-list@inria.fr
Subject: ANNOUNCE: pa_bitmatch 0.5
Date: Fri, 25 Apr 2008 14:11:25 +0100	[thread overview]
Message-ID: <20080425131125.GA4100@annexia.org> (raw)

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


                 reply	other threads:[~2008-04-25 13:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080425131125.GA4100@annexia.org \
    --to=rich@annexia.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).