JuliaLang/julia — pull request #1680 by vtjnash (2012-12-04 23:11:36+00:00)
Title: RFC: allow ccall to use local (non-static) function pointers)

This attempts to eval the first argument to ccall to any pointer type in the local scope before interpreting it as a toplevel expression. This allows the following to work, as a self-contained example:

```julia
julia> function f()
f2 = cfunction(+, Int, (Int,Int))
ccall(f2, Int, (Int,Int), 1, 2)
end

julia> f()
3
```

I put this as RFC since I wasn't sure of the best way to select the scope fallback vs throwing an error. static_eval() seems OK with symbols, but not with with tuples in the AST.