Skip to content

Rename 'singlequote' to 'tick' in test file names#46

Closed
dgr wants to merge 1 commit intojank-lang:mainfrom
dgr:dgr-consistent-file-naming
Closed

Rename 'singlequote' to 'tick' in test file names#46
dgr wants to merge 1 commit intojank-lang:mainfrom
dgr:dgr-consistent-file-naming

Conversation

@dgr
Copy link
Contributor

@dgr dgr commented Jan 21, 2025

For brevity.

@jeaye
Copy link
Member

jeaye commented Jan 21, 2025

Clojure uses singlequote. Looks like jank uses squote to be shorter. When I think tick, I think backtick, or grave: `

I'd prefer to keep this singlequote. I think jank should be updated to follow Clojure more closely, too.

Clojure

static final public IPersistentMap CHAR_MAP =
		PersistentHashMap.create('-', "_",
//		                         '.', "_DOT_",
':', "_COLON_",
'+', "_PLUS_",
'>', "_GT_",
'<', "_LT_",
'=', "_EQ_",
'~', "_TILDE_",
'!', "_BANG_",
'@', "_CIRCA_",
'#', "_SHARP_",
'\'', "_SINGLEQUOTE_",
'"', "_DOUBLEQUOTE_",
'%', "_PERCENT_",
'^', "_CARET_",
'&', "_AMPERSAND_",
'*', "_STAR_",
'|', "_BAR_",
'{', "_LBRACE_",
'}', "_RBRACE_",
'[', "_LBRACK_",
']', "_RBRACK_",
'/', "_SLASH_",
'\\', "_BSLASH_",
'?', "_QMARK_");

jank

  static native_unordered_map<char, native_persistent_string_view> const munge_chars{
    {  '-',        "_" },
    {  ':',  "_COLON_" },
    {  '+',   "_PLUS_" },
    {  '>',     "_GT_" },
    {  '<',     "_LT_" },
    {  '=',     "_EQ_" },
    {  '~',  "_TILDE_" },
    {  '!',   "_BANG_" },
    {  '@',  "_CIRCA_" },
    {  '#',  "_SHARP_" },
    { '\'', "_SQUOTE_" },
    {  '"', "_DQUOTE_" },
    {  '%',   "_PERC_" },
    {  '^',  "_CARET_" },
    {  '&',    "_AMP_" },
    {  '*',   "_STAR_" },
    {  '|',    "_BAR_" },
    {  '{', "_LBRACE_" },
    {  '}', "_RBRACE_" },
    {  '[', "_LBRACK_" },
    {  ']', "_RBRACK_" },
    {  '/',  "_SLASH_" },
    { '\\', "_BSLASH_" },
    {  '?',  "_QMARK_" }
  };

@jeaye
Copy link
Member

jeaye commented Jan 21, 2025

Nah, thought about this a bit more. Clojure's munges are too long. Let's be consistent with jank, though. I'd rather have two standards than three. That means squote for these, but it also means things like qmark instead of questionmark.

@dgr
Copy link
Contributor Author

dgr commented Jan 21, 2025

OK, I can update to "squote" and "qmark". Yea, I was just looking for shorter names overall. Tick is used a lot in Forth. I'll update the Babashka new-test task to generate these. I wasn't aware that there was a table somewhere.

@dgr
Copy link
Contributor Author

dgr commented Jan 21, 2025

I notice that the dollar sign is not in either of those lists. I have it as mapping to "dollar". Is that good, or do we want something else?

@jeaye
Copy link
Member

jeaye commented Jan 21, 2025

I notice that the dollar sign is not in either of those lists. I have it as mapping to "dollar". Is that good, or do we want something else?

No need for you to map that. Dollar sign doesn't exist in Clojure vars, since it's used to indicate nested Java classes.

@dgr
Copy link
Contributor Author

dgr commented Jan 21, 2025

I'm going to close this and do the rename of the files in the Babashka tasks PR.

@dgr dgr closed this Jan 21, 2025
@dgr dgr deleted the dgr-consistent-file-naming branch January 21, 2025 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants