-
Notifications
You must be signed in to change notification settings - Fork 23
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
deprecate any
(redundant with auto
)
#281
Comments
any
and tyAnything
(redundant with auto
)any
(redundant with auto
)
any is shorter and more accurate name for a type, should we decom auto instead |
To me It's kinda neat that Nim allows to write code that looks so little like typed code, but... Who would honestly use |
auto is widespread, and common in other languages; it's here to stay.
yes
same holds for proc fn[T1,T2](a1: T1, a2: T2) = discard
proc fn(a1, a2: auto) = discard # shorter, and makes sense if you're not using T1, T2 |
I support removal of Also Which leads to some strange errors and crashes: nim-lang/Nim#14255 |
Deprecation of |
@juancarlospaco can you please make a PR? |
block:
var a = newSeq[bool](1000)
if false:
echo "ok?"
elif auto(a):
echo "false" Error: internal error: getTypeDescAux(tyFromExpr) |
|
https://nim-lang.github.io/Nim/manual.html claims:
any | distinct auto (see below)
but then doesn't show examples with
any
.And in fact this seems incorrect:
so
any
seems redundant withauto
, unless I'm missing something.(docs also mention this: https://nim-lang.github.io/Nim/manual.html#templates-symbol-binding-in-templates
it's also not used (much/at all) IIRC and is underdocumented.
note
docs also says:
but IMO a pragma should be used for that instead of changing meaning of
auto
note 2
docs should add right here:
typedesc is a "bind many" type class:
that
auto
is also "bind many"The text was updated successfully, but these errors were encountered: