Summary: E / Erlang integration

Bengt Kleberg <>
Mon Jun 12 10:28:51 CEST 2006


On 2006-06-09 23:10, Michael FIG wrote:
...deleted

> To answer more about MarkM's comments, I'm talking about Erlang-E (E semantics
> embedded in Erlang)

waht are your thoughts about handling the non-blocking receive of E?
do you want all e:when_catch() (made up name) to be non blocking?


...deleted

> "Promise = e:send(CryptoCap, Message)".  However, the when/catch construct
> of E would be clunky to use without some syntactic sugar.
> 
> With sugar:
> 
>     promise_case e:send(RaceTrack, getPolePositionCar) of
>         FarPolePositionCar ->
>             io:format("My car is in pole position~n");
>         after 3000 ->
>             io:format("Timed out~n")
>         catch E ->
>             ok;
>     end.
> 
> without sugar:
> 
>     e:pcase(e:send(RaceTrack, getPolePositionCar),
>             fun (SomeFreshName) ->
>                  case SomeFreshName of
>                     FarPolePositionCar ->
>                         io:format("My car is in pole position~n"),
>                         matched;
>                     _ ->
>                         notmatched
>                  end
>             end,
>             3000, fun () -> io:format("Timed out~n"),
>             fun (E) -> ok end).

could you explain how the 'notmatched case clause will be reached?

also, perhaps it would be simpler to understand e:pcase/5 if you wrote 
it like in edoc: @spec my_function(X::integer()) -> integer()

perhaps that would be:
@spec pcase( Promise::promise(), Receive::function(), 
Timeout_time::integer(), Timeout::function(), Error::function() ) -> atom()
	promise() = ???


bengt
-- 
    EPO guidelines 1978: "If the contribution to the known art resides
    solely in a computer program then the subject matter is not
    patentable in whatever manner it may be presented in the claims."



More information about the erlang-questions mailing list