On 01/08/2006, at 3:16 PM, Jamie Wilkinson wrote:

Particular things that I'm sure I'm doing wrong is excessive use of
anonymous functions (Funs) but apparently I can't use a real function as the
argument to, say, lists:map?

As a first comment, you can actually replace those lambda expr... err, anonymous functions, with references to 'real' functions:

http://erlang.se/doc/doc-5.4.8/doc/reference_manual/ expressions.html#6.17

Relevant quote: "The following fun expressions are also allowed: fun Name/Arity,
fun Module:Name/Arity".  So, try e.g.

  fun lists:map/2

Does Erlang support currying or is this hacked through the use of Funs?

Unfortunately Erlang doesn't support currying (a.k.a. partial application). This isn't a really big drawback since you can obviously just define your own ad-hoc function to call the target function, but it is annoying.


--
% Andre Pang : trust.in.love.to.save  <http://www.algorithm.com.au/>



_______________________________________________
coders mailing list
[email protected]
http://lists.slug.org.au/listinfo/coders

Reply via email to