Skip to content

Should ? not be allowed as an identifier name? #19061

@carlobaldassi

Description

@carlobaldassi

Given its role in ternary expressions (and perhaps in more upcoming syntactic constructs?), isn't letting ? be used as a variable name allowing too much room for potential confusion?

julia>  ? = true
true

julia>  ??!?:?
false

julia>  !??!?:!??!?:?
true

julia>  !???:!?:?
false:true

julia> (x->(?->?(?))(?->x(x->?(?)(x))))(x->(?->(?==0?1:(?*x(?-1))))).(?:?<<?<<?)
4-element Array{Int64,1}:
  1
  2
  6
 24

(also isn't it amazing that these even parse?) Anyway, I suppose, unless one really wants to use ? as a function or macro name, that this possibility could be deprecated?

Metadata

Metadata

Assignees

No one assigned

    Labels

    parserLanguage parsing and surface syntax

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions