[eeps] Re: Match specs and receive

Richard A. O'Keefe ok@REDACTED
Fri Jul 11 06:40:55 CEST 2008


Fredrik Linder <
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 000017.png
Type: image/png
Size: 254 bytes
Desc: not available
URL: <http://erlang.org/pipermail/eeps/attachments/20080711/6812800c/attachment.png>
-------------- next part --------------
 >
asked about the possibility of
	receive MatchSpec(X) -> ...
and
	function(MatchSpec(X) = V) -> ...

Since
(1) A MatchSpec is just a data structure
(2) The mapping between (ets/mnesia) MatchSpecs and
     the corresponding Erlang code is fairly straightforward
(3) All components of the Erlang compiler are available at
     run time
I think you can see where I'm leading up to...
these can be put together to get something that compiles
a MatchSpec to a recogniser 'fun' (or a receiver 'run').

This may well be _better_ than putting it in the syntax,
because it lets you use compiled (with HiPE, even native-
compiled) code rather than interpreting MatchSpecs.


--
"I don't want to discuss evidence." -- Richard Dawkins, in an
interview with Rupert Sheldrake.  (Fortean times 232, p55.)








More information about the eeps mailing list