[e-lang] [Fwd: Re: [Fwd: Re: Proposal: E / Erlang integration]]

David Hopwood <>
Fri Jun 9 16:12:26 CEST 2006


Ulf Wiger wrote:
> Den 2006-06-09 06:35:37 skrev David Hopwood
> <david.nospam.hopwood -at- blueyonder.co.uk>:
> 
>>If the intent is to delay any messages until we get out of the waiting  
>>state, then the following would work (but would be inefficient, as
>>discussed in the earlier thread at  
>><http://www.erlang.org/ml-archive/erlang-questions/200507/msg00301.html>):
>>         bind waiting {
>>              match [verb, args] { E.send(pots, verb, args) }
>>          }
> 
> I don't know E, but does this mean that you resend the message to yourself?

Yes.

> So what if the unexpected message is e.g. (on_hook), but the subscriber
> simply flashed the hook? Then you might get a rapid (on_hook) - (off_hook)
> sequence. Resending (on_hook), then (off_hook) might work, and result in
> the same sequence, but what if it doesn't play out that way?

You're right, resending to self doesn't work in general. I posted in too
much haste.

Buffering the messages in an explicit FIFO queue would work (and as I said,
this can be a reusable abstraction rather than something that has to be
done per-application).

In the previous post:
> So far, I'm of the opinion that this phenomenon is restricted to transient
> states. You never (?) need selective receive in top-level states. If this
> is true, then one should be able to label states such that they either
> leave unexpected messages in the queue, discard them, or raise an
> exception. What the default should be probably depends on the domain.

I agree. I'll try and write something in E that implements this.

-- 
David Hopwood <>





More information about the erlang-questions mailing list