There's no difference in what's generated by the i->i syntax and the
function(i) i end syntax:

julia> function w1()
         f = i->i
       end
w1 (generic function with 1 method)

julia> code_typed(w1,())
1-element Array{Any,1}:
 Expr(lambda, {}, {{#s3,f},{{#s3,Function,18},{f,Function,18}},{}}, quote
 # none, line 2:
    #s3 = AST(Expr(lambda, {i::Any}, {{},{{i,Any,0}},{}}, quote  # none,
line 2:
    return i
end))
    f = #s3::F
    return #s3::F
end)

julia> function w2()
         f = function(i) i end
       end
w2 (generic function with 1 method)

julia> code_typed(w2,())
1-element Array{Any,1}:
 Expr(lambda, {}, {{#s3,f},{{#s3,Function,18},{f,Function,18}},{}}, quote
 # none, line 2:
    #s3 = AST(Expr(lambda, {i::Any}, {{},{{i,Any,0}},{}}, quote  # none,
line 2:
    return i
end))
    f = #s3::F
    return #s3::F
end)


On Mon, Feb 17, 2014 at 5:12 PM, Fil Mackay <[email protected]>wrote:

> On Tue, Feb 18, 2014 at 9:04 AM, Stefan Karpinski <[email protected]>wrote:
>
>> Rather than have me try to guess what you're doing, how about posting it
>> in the thread?
>>
>
> Posting which - the wrapper function, or the full LLVM? Apologies, I
> wanted to keep the pollution to a minimum and felt I'd used the patience of
> some already in pursuing this..
>
> eg.
>
> function w()
>   f = i->i
> end
> code_llvm(w, ())
>
>

Reply via email to