Skip to content
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

[IDEA] Introduce charcode macro #6284

Open
Jermolene opened this issue Nov 26, 2021 · 20 comments
Open

[IDEA] Introduce charcode macro #6284

Jermolene opened this issue Nov 26, 2021 · 20 comments

Comments

@Jermolene
Copy link
Owner

As discussed here, it is proposed to add a new charcode JavaScript macro designed to make it easier to introduce sequences of control characters into filters:

[get[field]addprefix<charcode 93>]
[<currentTiddler>addsuffix<charcode 13 10>]
[<currentTiddler>addsuffix<charcode cr lf>]
[<currentTiddler>addsuffix<charcode [[>]

The charcode macro would take a variable number of parameters, each being either:

  • a numeric Unicode codepoint,
  • a shortcut name for a control character or
  • a single typed character (this feature would not work properly characters that could be misinterpreted as a quotation symbol like ", ')
@AnthonyMuscio
Copy link
Contributor

AnthonyMuscio commented Nov 30, 2021

Jeremy,

If I may just add, Control characters are often very different to the other cases as they may not easily be copy/pasted, or read when in text/wiki text etc... This functionality is important. Here are a few notes that may help clarify or scope what you are proposing. If you do not expect to merge or address these in the same macro feel free to request spawn another discussion.

Sorry for my verbosity, but its all "pent up", and hopefully useful, and relevant to charcode design considerations. In fact it may simplify its scope and suggest other macros/operators. Perhaps I can even write these other macros.

  • I wonder if the charcode operator should be limited to invisible control characters (in ASCII) and named character codes.
  • We separately introduce a string macro/operator which would allow embedding strings of any characters in filters and elsewhere eg <string "[["> the quotes(or another delimiter) helping with readability, when I see <string [[> in a filter I experience a form of dyslexia.
  • We introduce a unicode Operator to provide access to and conversions from and to alt character sets

The named special characters are a great idea but it would be helpful if it were extensible, where the user/designer could add named character sequences eg rather than cr lf, I could name a paragraph "cr lf cr lf" "13 10 13 10". We could call these named character codes. below is an example and how I may hope this feature to assist with;

{{{ [<currentTiddler>addsuffix<charcode paragraph>] }}}

But this is also important when importing and exporting content and the ability to "give a character"/"returning a code" may also be helpful.

After all the problem with Control Characters is their visibility and remembering them. The ability to use multiple numbers an names (lf) to build a string to use in the filter is valuable. Arguably if the solution is extensible then its size can be minimised ie no need to document all the names, if people can make them as needed. However just he invisible control characters is a small set to name.

However as implied by your example, you are also suggesting charcode can be also used to introduce anything but "whole of filter delimiters" to a filter as you demonstrated with "[[" , this is often as a parameter to a filter operator eg
"[<input-string>prefix<charcode [>then[Filter provided in input]" but this is no longer really a charcode but actual characters or strings.

Finally beyond control characters, named or otherwise, including special characters or strings there is the question of access to Unicode characters.

  • Remember we have the related https://tiddlywiki.com/#decodehtml%20Operator and HTML entities.
  • It would be nice to set variables to Unicode characters, including by
  • Or to list a range of Unicode characters using Unicode decimals.

Perhaps the hardest issue I see with unicode is being able to see "programmatically" if the Unicode character of choice is visible to the current user with the fonts available. Although many are "browser safe" characters, many are not. We need to document the ranges that are safe with the fonts tiddlywiki makes use of by default.

I have not shared much on my experiments with unicode in tiddlywiki yet but there is a lot of potential value, including what is effectively additional name spaces. They key issue is there has being insufficient support to easy develop an in tiddlywiki "unicode keyboard" to copy, set or type content in unicode characters from one or more ranges. The advantage of a keyboard is one could select a unicode character range copy and or type (with 0-9A-Z equivalent sets) once copied they can be pasted in filters and wiki text and you need not use a charcode macro etc...

It would also be nice to use an offset into another character set so you can translate between different contiguous ranges eg 0-9A-Z to 𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫𝔸𝔹ℂ𝔻𝔼𝔽𝔾ℍ𝕀𝕁𝕂𝕃𝕄ℕ𝕆ℙℚℝ𝕊𝕋𝕌𝕍𝕎𝕏𝕐ℤ and back.

Safe Unicode characters are a good alternative to installing images for icons and can themselves be text inside svg so this consuming far less space.

More on unicode as an alternate name space
You can create tiddlers and field named with Unicode character sets you cant enter at the keyboard, for example this is normal text "listitem" this can be searched for in tiddlywiki with any three of the characters within it.

If however you named a tiddler 𝕝𝕚𝕤𝕥𝕚𝕥𝕖𝕞 it is another tiddler, not as searchable and the following works {{||𝕝𝕚𝕤𝕥𝕚𝕥𝕖𝕞}} [[𝕝𝕚𝕤𝕥𝕚𝕥𝕖𝕞]] even macros defined <<𝕄>> this way. So we can use simple language tiddler names for templates etc... without them ending up in user searches.

Once we have the underlying mechanism I would build a unicode EditorToolbar item to enter such alt-character sets, or unicode icons. including Emoticons, Only a little extensibility is needed.

@AnthonyMuscio
Copy link
Contributor

Here is a sample of unicode characters to see how they display for you;

Remember these are alt-characters not FONTs.

Circled 0①②③④⑤⑥⑦⑧⑨ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ
Circled (neg) ⓿123456789🅐🅑🅒🅓🅔🅕🅖🅗🅘🅙🅚🅛🅜🅝🅞🅟🅠🅡🅢🅣🅤🅥🅦🅧🅨🅩🅐🅑🅒🅓🅔🅕🅖🅗🅘🅙🅚🅛🅜🅝🅞🅟🅠🅡🅢🅣🅤🅥🅦🅧🅨🅩
Fullwidth 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
Math bold 𝟎𝟏𝟐𝟑𝟒𝟓𝟔𝟕𝟖𝟗𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙
Math bold Fraktur 0123456789𝖆𝖇𝖈𝖉𝖊𝖋𝖌𝖍𝖎𝖏𝖐𝖑𝖒𝖓𝖔𝖕𝖖𝖗𝖘𝖙𝖚𝖛𝖜𝖝𝖞𝖟𝕬𝕭𝕮𝕯𝕰𝕱𝕲𝕳𝕴𝕵𝕶𝕷𝕸𝕹𝕺𝕻𝕼𝕽𝕾𝕿𝖀𝖁𝖂𝖃𝖄𝖅
Math bold italic 0123456789𝒂𝒃𝒄𝒅𝒆𝒇𝒈𝒉𝒊𝒋𝒌𝒍𝒎𝒏𝒐𝒑𝒒𝒓𝒔𝒕𝒖𝒗𝒘𝒙𝒚𝒛𝑨𝑩𝑪𝑫𝑬𝑭𝑮𝑯𝑰𝑱𝑲𝑳𝑴𝑵𝑶𝑷𝑸𝑹𝑺𝑻𝑼𝑽𝑾𝑿𝒀𝒁
Math bold script 0123456789𝓪𝓫𝓬𝓭𝓮𝓯𝓰𝓱𝓲𝓳𝓴𝓵𝓶𝓷𝓸𝓹𝓺𝓻𝓼𝓽𝓾𝓿𝔀𝔁𝔂𝔃𝓐𝓑𝓒𝓓𝓔𝓕𝓖𝓗𝓘𝓙𝓚𝓛𝓜𝓝𝓞𝓟𝓠𝓡𝓢𝓣𝓤𝓥𝓦𝓧𝓨𝓩
Math double-struck 𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫𝔸𝔹ℂ𝔻𝔼𝔽𝔾ℍ𝕀𝕁𝕂𝕃𝕄ℕ𝕆ℙℚℝ𝕊𝕋𝕌𝕍𝕎𝕏𝕐ℤ
Math monospace 𝟶𝟷𝟸𝟹𝟺𝟻𝟼𝟽𝟾𝟿𝚊𝚋𝚌𝚍𝚎𝚏𝚐𝚑𝚒𝚓𝚔𝚕𝚖𝚗𝚘𝚙𝚚𝚛𝚜𝚝𝚞𝚟𝚠𝚡𝚢𝚣𝙰𝙱𝙲𝙳𝙴𝙵𝙶𝙷𝙸𝙹𝙺𝙻𝙼𝙽𝙾𝙿𝚀𝚁𝚂𝚃𝚄𝚅𝚆𝚇𝚈𝚉
Math sans 𝟢𝟣𝟤𝟥𝟦𝟧𝟨𝟩𝟪𝟫𝖺𝖻𝖼𝖽𝖾𝖿𝗀𝗁𝗂𝗃𝗄𝗅𝗆𝗇𝗈𝗉𝗊𝗋𝗌𝗍𝗎𝗏𝗐𝗑𝗒𝗓𝖠𝖡𝖢𝖣𝖤𝖥𝖦𝖧𝖨𝖩𝖪𝖫𝖬𝖭𝖮𝖯𝖰𝖱𝖲𝖳𝖴𝖵𝖶𝖷𝖸𝖹
Math sans bold 𝟬𝟭𝟮𝟯𝟰𝟱𝟲𝟳𝟴𝟵𝗮𝗯𝗰𝗱𝗲𝗳𝗴𝗵𝗶𝗷𝗸𝗹𝗺𝗻𝗼𝗽𝗾𝗿𝘀𝘁𝘂𝘃𝘄𝘅𝘆𝘇𝗔𝗕𝗖𝗗𝗘𝗙𝗚𝗛𝗜𝗝𝗞𝗟𝗠𝗡𝗢𝗣𝗤𝗥𝗦𝗧𝗨𝗩𝗪𝗫𝗬𝗭
Math sans bold italic 0123456789𝙖𝙗𝙘𝙙𝙚𝙛𝙜𝙝𝙞𝙟𝙠𝙡𝙢𝙣𝙤𝙥𝙦𝙧𝙨𝙩𝙪𝙫𝙬𝙭𝙮𝙯𝘼𝘽𝘾𝘿𝙀𝙁𝙂𝙃𝙄𝙅𝙆𝙇𝙈𝙉𝙊𝙋𝙌𝙍𝙎𝙏𝙐𝙑𝙒𝙓𝙔𝙕
Math sans italic 0123456789𝘢𝘣𝘤𝘥𝘦𝘧𝘨𝘩𝘪𝘫𝘬𝘭𝘮𝘯𝘰𝘱𝘲𝘳𝘴𝘵𝘶𝘷𝘸𝘹𝘺𝘻𝘈𝘉𝘊𝘋𝘌𝘍𝘎𝘏𝘐𝘑𝘒𝘓𝘔𝘕𝘖𝘗𝘘𝘙𝘚𝘛𝘜𝘝𝘞𝘟𝘠𝘡
Parenthesized 0⑴⑵⑶⑷⑸⑹⑺⑻⑼⒜⒝⒞⒟⒠⒡⒢⒣⒤⒥⒦⒧⒨⒩⒪⒫⒬⒭⒮⒯⒰⒱⒲⒳⒴⒵⒜⒝⒞⒟⒠⒡⒢⒣⒤⒥⒦⒧⒨⒩⒪⒫⒬⒭⒮⒯⒰⒱⒲⒳⒴⒵
Regional Indicator 0123456789🇦🇧🇨🇩🇪🇫🇬🇭🇮🇯🇰🇱🇲🇳🇴🇵🇶🇷🇸🇹🇺🇻🇼🇽🇾🇿🇦🇧🇨🇩🇪🇫🇬🇭🇮🇯🇰🇱🇲🇳🇴🇵🇶🇷🇸🇹🇺🇻🇼🇽🇾🇿
Squared 0123456789🄰🄱🄲🄳🄴🄵🄶🄷🄸🄹🄺🄻🄼🄽🄾🄿🅀🅁🅂🅃🅄🅅🅆🅇🅈🅉🄰🄱🄲🄳🄴🄵🄶🄷🄸🄹🄺🄻🄼🄽🄾🄿🅀🅁🅂🅃🅄🅅🅆🅇🅈🅉
Squared (neg) 0123456789🅰🅱🅲🅳🅴🅵🅶🅷🅸🅹🅺🅻🅼🅽🅾🅿🆀🆁🆂🆃🆄🆅🆆🆇🆈🆉🅰🅱🅲🅳🅴🅵🅶🅷🅸🅹🅺🅻🅼🅽🅾🅿🆀🆁🆂🆃🆄🆅🆆🆇🆈🆉
Tag 󠀰󠀱󠀲󠀳󠀴󠀵󠀶󠀷󠀸󠀹󠁡󠁢󠁣󠁤󠁥󠁦󠁧󠁨󠁩󠁪󠁫󠁬󠁭󠁮󠁯󠁰󠁱󠁲󠁳󠁴󠁵󠁶󠁷󠁸󠁹󠁺󠁁󠁂󠁃󠁄󠁅󠁆󠁇󠁈󠁉󠁊󠁋󠁌󠁍󠁎󠁏󠁐󠁑󠁒󠁓󠁔󠁕󠁖󠁗󠁘󠁙󠁚
A-cute pseudoalphabet 0123456789ábćdéfǵhíjḱĺḿńőṕqŕśtúvẃxӳźÁBĆDÉFǴHíJḰĹḾŃŐṔQŔśTŰVẂXӲŹ
CJK+Thai pseudoalphabet 0123456789ム乃cd乇キgんノフズレᄊ刀oアq尺丂イu√wメリ乙ム乃cd乇キgんノフズレᄊ刀oアq尺丂イu√wメリ乙
Curvy 1 pseudoalphabet 0123456789ค๒ƈɗﻉिﻭɦٱﻝᛕɭ๓กѻρ۹ɼรՇપ۷ฝซץչค๒ƈɗﻉिﻭɦٱﻝᛕɭ๓กѻρ۹ɼรՇપ۷ฝซץչ
Curvy 2 pseudoalphabet 0123456789αв¢∂єƒﻭнιנкℓмησρ۹яѕтυνωχуչαв¢∂єƒﻭнιנкℓмησρ۹яѕтυνωχуչ
Curvy 3 pseudoalphabet 0123456789ค๒ς๔єŦﻮђเןкɭ๓ภ๏קợгรՇยשฬאץչค๒ς๔єŦﻮђเןкɭ๓ภ๏קợгรՇยשฬאץչ
Faux Cyrillic pseudoalphabet 0123456789аъсↁэfБЂіјкlмиорqѓѕтцvшхЎzДБҀↁЄFБНІЈЌLМИФРQЯЅГЦVЩЖЧZ
Faux Ethiopic pseudoalphabet 0123456789ልጌርዕቿቻኗዘጎጋጕረጠክዐየዒዪነፕሁሀሠሸሃጊልጌርዕቿቻኗዘጎጋጕረጠክዐየዒዪነፕሁሀሠሸሃጊ
Math Fraktur pseudoalphabet 0123456789𝔞𝔟𝔠𝔡𝔢𝔣𝔤𝔥𝔦𝔧𝔨𝔩𝔪𝔫𝔬𝔭𝔮𝔯𝔰𝔱𝔲𝔳𝔴𝔵𝔶𝔷𝔄𝔅ℭ𝔇𝔈𝔉𝔊ℌℑ𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔ℜ𝔖𝔗𝔘𝔙𝔚𝔛𝔜ℨ
Rock Dots pseudoalphabet 012ӟ456789äḅċḋëḟġḧïjḳḷṁṅöṗqṛṡẗüṿẅẍÿżÄḄĊḊЁḞĠḦЇJḲḶṀṄÖṖQṚṠṪÜṾẄẌŸŻ
Small Caps pseudoalphabet 0123456789ᴀʙᴄᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴩqʀꜱᴛᴜᴠᴡxyᴢᴀʙᴄᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴩQʀꜱᴛᴜᴠᴡxYᴢ
Stroked pseudoalphabet 01ƻ3456789ȺƀȼđɇfǥħɨɉꝁłmnøᵽꝗɍsŧᵾvwxɏƶȺɃȻĐɆFǤĦƗɈꝀŁMNØⱣꝖɌSŦᵾVWXɎƵ
Subscript pseudoalphabet ₀₁₂₃₄₅₆₇₈₉ₐbcdₑfgₕᵢⱼₖₗₘₙₒₚqᵣₛₜᵤᵥwₓyzₐBCDₑFGₕᵢⱼₖₗₘₙₒₚQᵣₛₜᵤᵥWₓYZ
Superscript pseudoalphabet ⁰¹²³⁴⁵⁶⁷⁸⁹ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖqʳˢᵗᵘᵛʷˣʸᶻᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾQᴿˢᵀᵁⱽᵂˣʸᶻ
Inverted pseudoalphabet 0123456789ɐqɔpǝɟƃɥıɾʞןɯuodbɹsʇnʌʍxʎzɐqɔpǝɟƃɥıɾʞןɯuodbɹsʇn𐌡ʍxʎz
Inverted pseudoalphabet (backwards) zʎxʍ𐌡nʇsɹbdouɯןʞɾıɥƃɟǝpɔqɐzʎxʍʌnʇsɹbdouɯןʞɾıɥƃɟǝpɔqɐ9876543210
Reversed pseudoalphabet 0߁23456789AdↄbɘꟻgHijklmᴎoqpᴙꙅTUvwxYzAdↃbƎꟻGHIJK⅃MᴎOꟼpᴙꙄTUVWXYZ
Reversed pseudoalphabet (backwards)

@Jermolene
Copy link
Owner Author

Thanks @AnthonyMuscio – I appreciate your thoughts very much but I would also really appreciate it if you could try to write shorter. There's 800 words in your first post, and it's really quite hard work to figure out what you're trying to say.

I think your post boils down to:

  • Would it be possible to have user defined shortcut names? (Worth thinking about)
  • Would it be possible to use the charcode macro to generate Unicode characters? (yes)
  • Would it be possible for those shortcut names to insert more than one character at a time? (yes)
  • Instead of overloading the charcode macro to accept raw strings, could we introduce a new string macro for including string literals? (excellent idea!)
  • Is it possible to figure out programmatically which Unicode characters can be displayed on a particular browser? (please discuss elsewhere)

The post you have written reads like somebody thinking aloud. It's an interesting insight into your process, but it would be much more efficient for everybody else if you could aim for the brief, precise style you see most of us using on GitHub. Imagine if I woke up to 5 posts like yours every morning. I simply would not have the time to put in the work to try to understand what is being said.

The reason why this matters is because you have a track record of very good insights and suggestions. I don't want to miss the good stuff!

@pmario
Copy link
Contributor

pmario commented Dec 1, 2021

@Jermolene

Thanks for summarizing it!

It would also be nice to use an offset into another character set so you can translate between different contiguous ranges eg 0-9A-Z to 𝟘-𝟡𝕒-𝕫𝔸-ℤ and back.

I do like the "offset" idea, but I wouldn't want it to be part of the charcode macro.

I'm thinking about "shift-string", "morph-string" or something similar, which imo should be explored in a different issue. <<morph-string "abc" by:"0x1122">> which may rendered as 𝕒𝕓𝕔

@pmario
Copy link
Contributor

pmario commented Dec 1, 2021

I'll create a draft-PR soon

@flibbles
Copy link
Contributor

flibbles commented Dec 2, 2021

Hey, before we get too far into this, I have another proposal.

I noticed recently that there is no complement operator to enlist[]. Meaning, you can give enlist a string like "apple [[star fruit]] banana" and it'll break it into ["apple", "star fruit", "banana"]. But there's no way to turn that array back into a string. I've been meaning to bring this up.

IF such an operator existed (say relist[] maybe, or !enlist[]), it could have a relist:force[] suffix which made every incoming input get wrapped in brackets regardless of whether it has spaces. This would solve the bracket problem for most people since it seems double-bracket-wrapping is the most common use case here. It'd also provide functionality useful outside of that, like if people want to condense a list of inputs into a Tiddlywiki string array.

@flibbles
Copy link
Contributor

flibbles commented Dec 2, 2021

I'm going to post this on that talk.tiddlywiki thread too.

@Jermolene
Copy link
Owner Author

@flibbles we now have the format:titlelist operator for this

@Jermolene
Copy link
Owner Author

@flibbles
Copy link
Contributor

flibbles commented Dec 2, 2021

I see. I hope this is very new, or else I will feel very stupid.

@Jermolene
Copy link
Owner Author

I see. I hope this is very new, or else I will feel very stupid.

For sure, it was only added v5.2.0

@flibbles
Copy link
Contributor

flibbles commented Dec 2, 2021

I feel better. Too bad it's no good for what I needed. I was hoping for a real complement, like !enlist[]. format:titlelist[]join[ ] is way too cumbersome for any kind of uglify magic.

@pmario
Copy link
Contributor

pmario commented Dec 3, 2021

Math bold 𝟎𝟏𝟐𝟑𝟒𝟓𝟔𝟕𝟖𝟗𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙

@AnthonyMuscio ... Unicode Math bold will be relatively complicated to be mapped, since they are not arranged in a way the standard Latin character set is.

See: https://unicode-table.com/en/blocks/mathematical-alphanumeric-symbols/

We will need to map it like so:

<<morph "test string` from:"a" to:"𝐚">>
<<morph "UPPER CASE` from:"A" to:"𝐀">>
<<morph "01234` from:"0" to:"𝟎">>

Which will look like this

grafik

@pmario
Copy link
Contributor

pmario commented Dec 3, 2021

Cool things can happen :)

grafik

@AnthonyMuscio
Copy link
Contributor

AnthonyMuscio commented Dec 4, 2021

Mario et al,

Please note, this is not off topic to the charcode macro, but in my view needs to be considered along side the expansion of the charcode macro.

Morph comments in particular moved here

Ideally we need to consider the usability of charcode, morph and or recode macros to be used in wikitext and code so we can easily display, text etc... the result in either direction and use them as parameters to other macros and wikitext.

@pmario
Copy link
Contributor

pmario commented Dec 4, 2021

Without using morph, or adding a new feature to it we can simply supply two strings (code set) and test for the matching position, thus making such non-contiguous sets, into contiguous ones.

math-0a-Z "𝟎𝟏𝟐𝟑𝟒𝟓𝟔𝟕𝟖𝟗𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙"
0a-Z "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

this is a lookup table. .. I'll have to look for an implementation, that doesn't need to recalculate the matches everytime the macro is called.

@AnthonyMuscio
Copy link
Contributor

AnthonyMuscio commented Dec 4, 2021

This Morph post moved to #6295 (comment)

On JSString/Charcode

Can the list of named control codes be extended by the user?, or do we need to decide what is included to publish this?

@Jermolene
Copy link
Owner Author

Please note, this is not off topic to the charcode macro, but in my view needs to be considered along side the expansion of the charcode macro.

I do not see the link here I'm afraid. Unless I'm missing something the proposed <<morph>> macro does not provide a way to achieve the things in the OP.

There is a very high bar for showing that the ability to morph character sets belongs in the core. The core is intended for functionality that is universally useful. This OP derives from many requests over the years from end users. The morph macro has been conjured up by one user, with no good evidence that it is generally useful.

I'm tempted to delete the last 5 posts, but in any case if you want to continue that discussion please open a discussion thread.

@AnthonyMuscio
Copy link
Contributor

In favour of the counter argument charcode addresses access to characters we can not access from the keyboard, or in operators and macros. Morph and JSstring also does. I believe access to the Unicode set has also long being neglected, perhaps also for many years.

Never the less, as long as the those attending to the charcode issues is aware of morph, and JSString on the demo it seem to me simply an administrative issue to split. Please allow us an opportunity to move the content if you prefer.

Mario's elegant Morph and especially JSstring may actually contain code for the charcode solution, and perhaps a few bytes of tweaks would "kill a few birds with the one stone".

@Jermolene
Copy link
Owner Author

Thanks @AnthonyMuscio I should said more clearly that I think the morph stuff is a fun idea and cool in it's own right

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

No branches or pull requests

4 participants