Comments (3)
Perhaps better example:
julia> module A
setproperty!(x) = x
end
Main.A
julia> A.setproperty! == setproperty!
false
julia> module B
const c = setproperty! # just use it
setproperty!(x) = x
end
ERROR: invalid method definition in B: function Base.setproperty! must be explicitly imported to be extended
Stacktrace:
[1] top-level scope
@ none:0
[2] top-level scope
@ REPL[3]:3
from julia.
This is intentional and an explicit feature of the languag. Base functions can be shadowed, if they haven't been referred to before.
One major advantage of this is that it allows Base to export new symbols without breaking existing code, while also preventing Base from monopolizing a huge number of names.
from julia.
indeed this is a great feature...my case was specifically referred to the help search side effect which can be a bit surprising, but, at the same time, it makes sense because if you search for a name, it is much more likely that you want to extend it than if you don't do so. So, I guess it is a good default
from julia.
Related Issues (20)
- Substrings mask annotations
- Base.AnnotatedString needs compat annotation
- `front` and `tail` for `AbstractVector` HOT 10
- equality for iterators HOT 1
- Add symlink for system lld
- Julia level SROA ignores swapfield and replacefield
- Allow `\to` or `\mapsto` for `->` in anonymous functions HOT 3
- Non-deterministic `mul!` of `ComplexF32` arrays under Apple Silicon HOT 25
- Make `schedule` handle threadpools
- `jl_print_task_backtraces` does not show some task backtraces
- Improve error message for `ERROR: TypeError: in <:, expected Type, got a value of type TypeVar`
- Base.summarysize returns different memory usage values on different runs HOT 4
- [1.10] Function returns wrong value instead of throwing an error HOT 7
- the UnionAll identity subtyping property fails to hold for types involving a parameter bounded from above with Bottom HOT 1
- the invariance subtyping property fails to hold for types involving a parameter bounded from above with Bottom HOT 1
- the covariance subtyping property fails to hold for types involving a parameter bounded from above with Bottom HOT 1
- List JuliaPackageComparisons on https://julialang.org/packages/ HOT 2
- suboptimal typeintersections for degenerate TypeVars HOT 13
- `jl_array_data` returns a null pointer when called with an array of bits unions HOT 6
- Option to pin GC threads
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia.