2008/6/1 Dan Bensen <<a href="mailto:dsb@prairienet.org">dsb@prairienet.org</a>>:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Matt Bone wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
are our pattern matching requirements so minimal that a) it does not matter and b) we could even roll our own<br>
ala some of the Norvig examples?<br>
</blockquote>
<br></div>
According to one of the tutorials[*], Erlang patterns support variable<br>
repetition. I think Fare mentioned using existing Erlang test code,<br>
so that might be an issue.<br>
</blockquote><div><br>Excuse my ignorance here but what exactly are you planning to use the pattern matching for? If it is for use in the code to which you compile Erlang then I would seriously think through how you are compiling Erlang.<br>
<br>Yes, Erlang supports variable repetition (with implicit checking of values) and also non-lexical scoping so using and already bound variable in a pattern also means an implicit comparison of values.<br><br>I would not directly compile the Erlang code to lisp but would use the first few passes of the Erlang compiler. This would ensure compatibility with existing Erlang for many features (records, list/binary comprehensions) and be much easier as the internal languages are much simpler.<br>
<br>I would suggest using Core Erlang or even kernel Erlang. Core is a very simple functional language which has lexical scoping and simplified pattern matching. Kernel erlang has been fully lambda lifted and is completely "flat" and pattern matching has been compiled and optimised to basic tests.<br>
<br></div>In a follow up to this mail I will send a copy of a presentation of LFE (Lisp Flavoured Erlang) I gave which I think would be interesting in 2 respects:<br><br>- the LFE core forms are *very* close to Core Erlang (almost 1-to-1)<br>
- there is a *short* description of the compiler at the end, only 3 slides but it at least presents the passes and some of the internal languages.<br><br>It's 87 kB Powerpoint document so I apologise for sending big message. Unfortunately I can't convert it to PDF, if anyone can help with this I would appreciate it.<br>
<br>Robert<br><br></div>