|
|
| Author |
Message |
|
| vladdu |
Posted: Fri Sep 08, 2006 12:11 pm |
|
|
|
User
Joined: 28 Feb 2005
Posts: 397
Location: Gothenburg, Sweden
|
Hi!
By reusing an older utility function by Ulf Wiger, I've written a parse transform that looks for function calls with "don't care" arguments (which are illegal Erlang!) and replaces them with a functional expression currying the original on the missing arguments.
So if you write
Code: my:ff(2, _, erl, _, ang)
it will be transformed to
Code: fun(V1, V2) -> my:ff(2, V1, erl, V2, ang) end
This idea of "currying on steroids" is borrowed from Nemerle (www.nemerle.org)
Warning: The implementation has a funny gensym() implementation, so I'd not use it "as is" in a production environment.
Enjoy!
/Vlad |
| Description: |
|
 Download |
| Filename: |
curry.erl |
| Filesize: |
4.1 KB |
| Downloaded: |
1331 Time(s) |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
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 can download files in this forum
|
|
|