Coder Social home page Coder Social logo

Comments (4)

vtjnash avatar vtjnash commented on June 16, 2024

This sounds like a bug nearly identical to #53667, but yeah we could rename that to something more awkward to avoid clashes while this bug is still pending in the hygiene computation

from julia.

Pangoraw avatar Pangoraw commented on June 16, 2024

Linking #48910 which has a similar cause/problem (although with @inline).

from julia.

0x0f0f0f avatar 0x0f0f0f commented on June 16, 2024

I'm confused by the behavior of local?

julia> begin 
           x = 2 
           begin 
               local x = 3
           end
           x
       end
3

julia> x = 2 
           begin 
               local x = 3
           end
           x
2 # works correctly in global scope? 

julia> begin 
           x = 2 
           if x > 1
               local x = 3
           end
           x
       end
3

julia> begin 
           x = 2 
           for i in 1:x
               local x = 3
           end
           x
       end
2

I'm referring to the manual page on scoping https://docs.julialang.org/en/v1/manual/variables-and-scoping/

Notably missing from this table are begin blocks and if blocks which do not introduce new scopes. The three types of scopes follow somewhat different rules which will be explained below.

If local has no effect on begin and if blocks, why use it in @inbounds and @inline?

from julia.

giordano avatar giordano commented on June 16, 2024

Also similar to #41451 and #48015 (for logging macros).

from julia.

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.