Suggestion for a parse transform #11

Closed
doubleyou opened this Issue Nov 23, 2011 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

doubleyou commented Nov 23, 2011

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.

Owner

uwiger commented Nov 23, 2011

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:
#11

Contributor

doubleyou commented Nov 24, 2011

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

Thanks!

doubleyou closed this Nov 24, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment