Algorithmic lists

Andy with Recycled Electrons aba3600@REDACTED
Wed Oct 18 03:52:40 CEST 2000


> > Erlang? I'd love to overload "+" or "-" for a specific kind of input,
> > so that a call is made to my function.  The data units I am passing in
> > are 3-element tuples right now, but I can change that.
> 
> No, there isn't. (Or rather, yes, there is, it's called "parse
> transforms", and you should really not be doing it.) My advice: implement
> a nice abstract datatype with functions "add(X, Y)", "subtract(X, Y)",
> etc., or if you really feel you want `+' and `-', you can actually call
> your functions "'+'(X, Y)" and "'-'(X, Y)" as long as you use
> single-quoting.

Thanks to everyone who suggested some good ideas here.  According to the
group, there are 3 options:
 1. Library Calls - I've got this wokring
 2. Parse Transformations - My next step, but nobody recomends it
 3. Built into Erlang - Not Possible

I have a working data type implemented in library calls, and my goal is to
implement infix function calls.  I've done what I call "token level
macros" before in Scheme. With "erl_scan" and "erl_parse" it looks
possible...just a bit complex.

Finally, does anyone have an interst in seeing a link to a Masters Thesis
written in Erlang?  It deals with robotics.

Sincerely, 

Andy Allen
Recycled Electrons
email: andy@REDACTED





More information about the erlang-questions mailing list