Erlang Mailing Lists

Author Message

<  Erlang bugs mailing list  ~  fun Name/Arity syntax doesn't work for imported functions

ulf.norell
Posted: Tue Jun 22, 2010 9:41 am Reply with quote
Joined: 07 Jun 2010 Posts: 1
The "fun Name/Arity" syntax doesn't take imports into account, requiring
imported
functions to be qualified with their module names.

Example:

---

-module(bug).
-compile(export_all).
-import(lists, [sort/1]).

ok(Xss) ->
lists:map(fun(Xs) -> sort(Xs) end, Xss).

ok2(Xss) ->
lists:map(fun lists:sort/1, Xss).

bad(Xss) ->
lists:map(fun sort/1, Xss).

---

1> c(bug).
./bug.erl:13: function sort/1 undefined

/ Ulf


Post received from mailinglist
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum