[erlang-in-lisp-devel] A good name for an operator

Robert Virding rvirding at gmail.com
Mon Jun 2 22:58:17 UTC 2008


This list is probably a good place to ask for help with this:

In LFE (Lisp Flavoured Erlang) I have extended cond with a matching test.
Today you can do

(cond ((match <pat> <expr>) ...)
       ...)

You evaluate the expression and if the result matches the pattern then the
test succeeds and all the variables in the pattern are bound and can be used
in that body. This is easy to implement and suits a pattern matching style
of programming.

The question is what to call the operator? I think using 'match', while
descriptive, is way too general and can easily be expanded by a macro. I had
thought of '=?' which builds on Erlang assignment '=' and a test '?', but
maybe it is too Erlangy. Any suggestions welcome.

Just an small observation: now that I am directly working with lisp and
erlang at the same time is that have pattern matching really affects your
style or programming. I know it is obvious but it still hits you when you
see it.

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/erlang-in-lisp-devel/attachments/20080603/67981df7/attachment.html>


More information about the Erlang-in-lisp-devel mailing list