Closed leostera closed 3 years ago
May be related to https://github.com/AbstractMachinesLab/caramel/issues/10 fixed in https://github.com/AbstractMachinesLab/caramel/commit/1b4e6b80083920a748b9e4ebda88cb48271bd740 ? At least it may be a good starting point to dive in
This may or may not be related, fun references of regular functions (not operators) cannot be used this way:
let print thing = Io.format "~0tp~n" [ thing ]
let main _ =
let transforms = [ Binary.first; Binary.last ] in
print (Lists.map (fun g -> g "Hello World") transforms)
results in
% Source code generated with Caramel.
-module(main).
-export([main/1]).
-export([print/1]).
-spec print(_) -> ok.
print(Thing) -> io:format(<<"~0tp~n">>, [Thing | []]).
-spec main(_) -> ok.
main(_) ->
Transforms = [binary:first | [binary:last | []]],
print(lists:map(fun
(G) -> G(<<"Hello World">>)
end, Transforms)).
fun
and the /arity
is missing
From #57 by @michallepicki:
This leads to another related issue, currently:
generates
where it lacks the erlang: prefix and the arity is wrong. Not sure if this is something that should be supported right now or not.