-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of a decimal point to show Floats ambiguous #3777
Comments
There doesn't seem to be a definition of |
Right good point. I guess my confusion stems from how it often seems to be acceptable to use 1. to mean a Float, but here that breaks down. Confusing behaviour? |
This could be a tricky point for beginners, but I think it's worth it to be able to use |
We deliberately decided to resolve the ambiguous case |
One thing we could do to make this a little better is to put a comment in the style guide advocating whitespace around operators, which is what Google partially recommends for languages like Python and R: http://google-styleguide.googlecode.com/svn/trunk/pyguide.html This won't resolve the issue, but discourages ambiguity. |
Isn't there an ambiguity warning that could be issued here? I do agree that the current behavior makes sense, but printing a warning message that this is ambiguous, and that it's better to write either |
…53220) Replaces #53216 (I can't push to that repo branch) Adds - making pkgimages for REPLExt - Fixes PkgCompletionProvider location Stdlib: Pkg URL: https://github.com/JuliaLang/Pkg.jl.git Stdlib branch: master Julia branch: master Old commit: f3b81f1aa New commit: 6dd0e7c9e Julia version: 1.11.0-DEV Pkg version: 1.11.0 Bump invoked by: @IanButterworth Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaLang/Pkg.jl@f3b81f1...6dd0e7c ``` $ git log --oneline f3b81f1aa..6dd0e7c9e 6dd0e7c9e Revert "add test for recurring precompile" (#3779) dbf114fa9 Merge pull request #3777 from JuliaLang/kc/repl_extension a49d47981 fixup e3edf3917 avoid prompting for git creds on CI (#3778) 510454343 make the `REPL` specific code into an extension 12d2de14e make `pkgstr` independent of REPL ``` --------- Co-authored-by: Dilum Aluthge <dilum@aluthge.com> Co-authored-by: Valentin Churavy <vchuravy@users.noreply.github.com> Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com> Co-authored-by: Jameson Nash <vtjnash@gmail.com>
type Vec
x::Float64
y::Float64
z::Float64
end
a = Vec(1., 2., 3.)
_(a::Int64, b::Vec) = Vec(a_b.x, a_b.y, a_b.z)
_(a::Float64, b::Vec) = Vec(a_b.x, a_b.y, a_b.z)
println(1_a)
println(2.5_a)
println(1.a) # This line fails with ERROR: no method .(Int64,Vec)
The text was updated successfully, but these errors were encountered: