Reconsider identifiers
See original GitHub issueIs it really a good idea to have that freedom on identifiers (ID
)?
Some identifiers that I believe are good to have:
abc
,name1
and such (C-style) should be ID (Latin, Arabic digits)sin²
should be valid (mix Latin with unicode Arabic digits)αθηνα
should be valid (Greek)ΩS¹
,sinβ
should be a valid (mix Greek with Latin and unicode digits)+
,/
,-
,*
should be valid (operators) but we may reserve a few as keywords like@
(like Java),#
(?) or%
(like Idris)⁄
,⌀
,⁒
,·
,÷
should be valid (unicode operators)::
,:<
,>>=
are valid (several operators)+₁
,+₂
,÷₂
,*‘
should be valid (operators followed by unicode digits)
Something that are currently ID, I think are confusing:
+1
– looks likeλx. x + 1
. Similarly1+
call/cc
looks likecall / cc
to people w/o scheme experience. We may call similar functioncallCC
,shiftReset
suc-suc
– because we knowsuc
is not a “number” so we know it’s notsuc - suc
, but if it’so-o
, it’s less clear. It can beo - o
.a+b
– even worse.a+b=c
– also valid in Agda. EVEN worse.+-comm
– commonly used in Agda. In Idris it’s calledplusCommutative
iirc. I think the Idris name is acceptable. I’m not sure though.
I am thinking about a criterion that is similar to Haskell:
- Let
\a
denote Latin/Greek/CJK/Russian alphabets - Let
\o
denote operators (unicode inclusive) - Let
\u
denote unicode superscript and subscript (numeric and alphabetic) - Let
\d
denote digits (unicode inclusive, exclude super/subscript)
Then \a[\a\d]*\u* | \o+\u*
basically describes what I wanted. This will cause some renaming in the current stdlib.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Appendix B: Reconsider the de-identification standard, reduce ...
Appendix B: Reconsider the de-identification standard, reduce the number of data categories, and focus on safeguards in recording and publishing ...
Read more >Version Identifiers Reconsidered | W3C Blog
Version Identifiers Reconsidered · The earliest version of the language with which the document is compatible (1.0 in the recipe example)? · The ......
Read more >Reconsidering Anonymization-Related Concepts ... - PubMed
The crucial term "identification" seems especially hard to define, since its definition presupposes the existence of identifying characteristics, leading to ...
Read more >Reconsider guidance about boilerplate in short-form ID files
Background: Currently, appendix V says that when using a short-form ID with a license that has a "boilerplate" license header, ...
Read more >Claim Resubmission and Reconsideration Process - AHCCCS
This could include a change in tier status, missing documentation, incorrect CPT/HCPCS codes or units or date of service change. When filing reconsiderations, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In general, I am fine with current identifiers, that is, composing IDs from a sequence of visually visible characters. I don’t like putting restrictions on identifiers (because remembering these rules is also a burden to users) except those that significantly improve readability:
114514ULL
)And there are other reasons:
+-comm
looks better thanplusComm
because for humans (at least for me), splitting by the hyphen-
is easier than splitting by any upper-case alphabet. I know you can chooseplus_comm
but the underlines are less beautiful – they are not centered.a+b=c
,+1
anda+b=b+a
do not actually make code harder to understand. Because the formatter always producesa + b = b + a
if it is really an expression.I think as long as we disallow white-spaces in identifiers, I’m totally fine 😄 If in addition we enforce white-space in between identifiers, then having the current naming freedom also induce no ambiguity (and arguably still easy to parse by human). While probably it is better to use
addComm
overa+b=b+a
, naming proof terms of more complicated relation with the white-space collapsing, symbolic style can be easier and clearer in some situations. Naming things is already hard enough for us programmers, and I think having a wider range of naming style to choose can help alleviate the burden a bit.