I have just released a new version of LFE, Lisp Flavoured Erlang. New features in LFE 0.2 are:<br><br>- The really *BIG* change is that LFE is now Lisp-2 like Common Lisp,<br> i.e. functions and variables reside in different name spaces,<br>
instead being a Lisp-1 like Scheme where they reside in the same<br> name space. The reason for this change is that the ErlangVM does<br> keep variables and functions separate and while Core Erlang tries to<br> hide this fact it does not fully succeed. In fact, it is actually<br>
impossible to do this given Erlang's property of being able to have<br> many functions of the same name but with different arites.<br><br> While this is not as elegant and forces the use of funcall to call<br> functions bound to variables it works better.<br>
<br> It is not an irrevocable change but I would need really convincing<br> arguments to change it back.<br><br>- Being a Lisp-2 has introduced some new core forms to handle them:<br> flet, flet*, fletrec and funcall. Letrec has been removed.<br>
<br>- The handling of macros has been cleaned up.<br><br>- Schemes, R5RS, handling of ellipsis '...' in syntax-rules has been<br> added. This really simplifies writing some macros in a elegant way.<br><br>- The interpreter, lfe_eval, can now handle the complete language.<br>
<br>- In patterns both tuples and binaries/bitstrings use the general<br> constructor form, the constant form now only matches a literal tuple<br> or binary. For example:<br><br> (tuple 'ok a b) - is eqivalent to {ok,A,B}<br>
#('ok a b) - is eqivalent to {[quote,ok],a,b}<br> (binary (f float (size 32)) (rest binary))<br> - is eqivalent to <<F:32/float,Rest:binary>><br><br> Even though this may be longer and, in some cases, more difficult to<br>
"see" I prefer it as it is consistent.<br><br>- Patterns can now have aliases, (= pat-1 pat-2). These are checked in<br> the linter and non-matching patterns are classed as an error. In<br> future releases they should become warnings.<br>
<br>- There is now an LFE shell which evaluates expressions and prints the<br> results. It is still a bit primitive and doesn't use processes as it<br> should in the same manner as the standard Erlang shell does. But it<br>
does have one very nice feature, you can slurp in a source file and<br> run evaluate all the functions in the shell. Any macros defined in<br> the file are also available.<br><br> It is not yet possible to define functions/macros in the shell but<br>
that should use soon be possible. You should also then be able to do<br> regurgítate which would write all the definitions out to a file.<br><br>- Running a shell other than the standard erlang one is a bit<br> difficult so I have included a patched version of user_drv.erl from<br>
the standard kernel app which allows you to start specific shells,<br> both local and remote. You can either put it into the distribution<br> or leave it where you run the LFE system and it will be picked<br> up. As far as I can see it is "safe" to use.<br>
<br>- There are two versions of the interpreter, one written in Erlang,<br> the standard, and a compatible one written in LFE. Lfe_eval.lfe is<br> not written in a consistent manner and can be seen as an example of<br> the various styles of LFE programming, for example using<br>
match-lambda or lambda/case.<br><br>- As before there are a number of test files included as example code<br> in lieu of better documentation. They are also useful to see the<br> Core code generated by the LFE compiler, just add an option<br>
[dcore]. N.B. Not all the test files compile, but this is on purpose<br> to test linter.<br><br>- There is now a lisp prettyprinter in lfe_io. Unfortunately the io<br> functions in lfe_io are not always obviously named from a lisp<br>
viewpoint.<br><br>The system can be found in the "User Contributions" section at <a href="http://trapexit.org/" target="_blank">trapexit.org</a>, <a href="http://forum.trapexit.org/viewtopic.php?p=43887#43887">http://forum.trapexit.org/viewtopic.php?p=43887#43887</a><a href="http://forum.trapexit.org/viewtopic.php?p=40268#40268" target="_blank"></a>.<br>
<br><br>