On 27/11/2007, <b class="gmail_sendername">David Hopwood</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> In the spirit of funs it would be very nice to say:<br>><br>> F = fun(Pattern1) -> Actions1<br>> (Pattern2) -> Actions2<br>> after Time -> Actions<br>> end,
<br>> ...<br>> receive(Fun)<br>><br>> This would make writing an erlang meta interpreter much easier<br>> and allow all kinds of mischief<br><br>The missing feature that is needed to implement this (and lots of other
<br>useful things) is the ability to reflect on a process' message queue.<br>That is, to iterate through messages in a process' queue without<br>removing them, and then to remove a given message (rather than just<br>
the first message that matches a statically determined pattern).</blockquote><div><br>This could lead to some really weird behaviour if programmers were allowed to manipulate the message queue directly. Funs would be nice, but then we would actually end up with the same problems as allowing user defined functions in guards.