rvirding/lfe — pull request #59 by oubiwann (2014-03-23 07:05:57+00:00)
Title: Providing support for (mod:func ...) calls

This change will allow LFE programmers to make calls to Erlang using the same syntax they do in Erlang itself. Here's some example usage from the REPL:
### Usage
```cl
> (orddict:new)
()
> (string:tokens '"apple:seed" '":")
("apple" "seed")
```
Note that the old form continues to work (and is more efficient, since it involves fewer function calls):
```cl
> (: orddict new)
()
> (: string tokens '"apple:seed" '":")
("apple" "seed")
```
Other operations still function as expected:
```cl
> (+ 1 2 3 4 5 6)
21
> (* 2 (+ 1 2 3 4 5 6))
42
```
### Implementation Details
Two functions were added to ``lfe_macro.erl``:

* ``check_erl_call/1``
* ``convert_call/2``

I've actually written almost no Erlang code ever; I would be deeply appreciative of corrections, better idiomatic use, etc.

The function chosen to run this check was ``exp_predef_macro/3`` for the reason that this is the last place one can make a change to a call before the presence of ``:`` as an initial form is checked.

### Questions and Concerns
* I don't actually know how to run the existing test suite :-/ As such, I only did some manual checks to reassure myself that the impact due to this change was probably minimal and localized. I'd feel a lot better if I could run the test suite sueccesfully.
* I have concerns about the Erlang I wrote; aside from potentially non-idiomatic code, I have the vague feeling that ``_ -> Call`` might not ever be reached. If so, this should probably be structured differently.
* I'm not sure that the default case of ``(: mod func ...)`` is as efficient as it could be. Ideally, in the event of an unsuccessful tokenizing, one wouldn't have to reassemble the name and args. Maybe something clever like ``[Name|As]=Call`` in the function sig would help? I'll leave that for reviews/comments by the experts.
* Are there other documents or bits of code that should be updated with a notification of this change? All I thought to change was adding another bit in the user guide...