Giter Club home page Giter Club logo

Comments (1)

sjkelly avatar sjkelly commented on June 12, 2024

More atomic case:

 julia> b = FRep(Sphere(4, (1,2,3)))
Descartes.FRep{3,Int64}(Descartes.Sphere{3,Int64}(4,(1,2,3)),sphere_frep)

julia> @code_lowered b.func(1,2,3)
1-element Array{Any,1}:
 :($(Expr(:lambda, Any[:x,:y,:z], Any[Any[],Any[Any[:x,Any,0],Any[:y,Any,0],Any[:z,Any,0]],Any[Any[:s,Descartes.Sphere{3,Int64},1]],0], :(begin  # /home/steve/.julia/v0.4/Descartes/src/frep.jl, line 7:
        return sqrt((x - getindex((top(getfield))(s,:location)::Any,1)::Any)::Any ^ 2::Any + (y - getindex((top(getfield))(s,:location)::Any,2)::Any)::Any ^ 2::Any + (z - getindex((top(getfield))(s,:location)::Any,3)::Any)::Any ^ 2::Any::Any)::Any - (top(getfield))(s,:radius)::Any::Any
    end::Any))))

So it looks like closures blow at type inference.

from descartes.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.