uwiger / gproc

Extended process registry for Erlang
Apache License 2.0
1.07k stars 232 forks source link

Suggestion for a parse transform #11

Closed doubleyou closed 12 years ago

doubleyou commented 12 years ago

The idea is to allow writing statements like this:

<<"Process1">> ! Message

Erlang compiler does allow such stuff, but of course a badarg expection will be raised.

I've written a sample parse transform that transforms such constructions into

gproc:lookup_local_name(<<"Process1">>) ! Message

https://github.com/doubleyou/ptrans/tree/gproc

Of course, this need to be improved (like handling global process registry as well), but at least it gives a basic idea. I'm also not sure where to place it, maybe it's better as a part of gproc itself rather than a separate module.

uwiger commented 12 years ago

Hi Dmitry,

Not a bad idea, although I'd suggest gproc:send/2 instead.

I'll take a closer look later.

BR, Ulf

Den onsdagen den 23:e november 2011 skrev Dmitry Demeshchuk< reply@reply.github.com

: The idea is to allow writing statements like this:

<<"Process1">> ! Message

Erlang compiler does allow such stuff, but of course a badarg expection will be raised.

I've written a sample parse transform that transforms such constructions into

gproc:lookup_local_name(<<"Process1">>) ! Message

https://github.com/doubleyou/ptrans/tree/gproc

Of course, this need to be improved (like handling global process registry as well), but at least it gives a basic idea. I'm also not sure where to place it, maybe it's better as a part of gproc itself rather than a separate module.


Reply to this email directly or view it on GitHub: https://github.com/uwiger/gproc/issues/11

doubleyou commented 12 years ago

Sending you a pull request instead, would be easier to examine and discuss.

Thanks!