* ANNOUNCE: pa_bitmatch 0.5
@ 2008-04-25 13:11 Richard Jones
0 siblings, 0 replies; only message in thread
From: Richard Jones @ 2008-04-25 13:11 UTC (permalink / raw)
To: caml-list
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-04-25 13:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-25 13:11 ANNOUNCE: pa_bitmatch 0.5 Richard Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox