On Tue, Feb 18, 2014 at 11:56 AM, Stefan Karpinski <[email protected]>wrote:
> Even if anonymous functions were exactly like named functions (they're
> not), the non-constness of the bindings in your original example prevent
> inlining, etc.
>
Yup. I added in const as well to remove this factor. I am left with types
being dropped:
julia> const f = i->i
(anonymous function)
# dropped types
julia> [f(x) for x in [1,2,3]]
3-element Array{*Any*,1}:
1
2
3
# but this one works?
julia> [(i->i)(x) for x in [1,2,3]]
3-element Array{*Int64*,1}:
1
2
3
I'm assuming this is just the way it is for the time being (used named
functions).