3 ms·
How hard would it be to uniquely extend the language to make *fun* into *fn* and *...* into a single letter *…*? fun all_same([str0, str, ...]): all(
by eviks 2y ago
How hard would it be to uniquely extend the language to make *fun* into *fn* and *...* into a single letter *…*?
fun all_same([str0, str, ...]):
all(str0 == str, ...)
- rscho 2y agoVery easy. You could do it yourself after 5 min of reading ;-)
- eviks 2y agoThat time would only be enough to read the overview, go through the examples, click on the "uniquely customizable" link hoping to see the answer and then be flooded with the garbage digital tokens of the scientific world - 100+ references...
- fc417fc802 2y agoTrue. If you are new to Lisps it will require substantially more than 5 minutes to learn about the different types of macros. For Racket in general you might start here.[0][1] For Rhombus probably here.[2][3] I'm not clear what your asking about regarding the ellipses though. [0] https://docs.racket-lang.org/guide/macros.html https://docs.racket-lang.org/guide/macros.html [1] https://docs.racket-lang.org/reference/Reader_Extension.html https://docs.racket-lang.org/reference/Reader_Extension.html [2] https://docs.racket-lang.org/rhombus-meta/index.html https://docs.racket-lang.org/rhombus-meta/index.html [3] https://docs.racket-lang.org/rhombus/Syntax_Objects_and_Macros.html https://docs.racket-lang.org/rhombus/Syntax_Objects_and_Macr...
- eviks 2y agoThe ellipses was about replacing 3 ascii symbols 1. 2. 3. with 1 unicode symbol 1… and have it serve the exact language function (repetitions)
- psychoslave 2y agoSo basically, assuming no special constructor for array, this is fun all_same(array(str0, str, ...)): all(=(str0, str), ...) Which taking could just as well be rendered only using English words for each token: let all-same of array of former eft latter eft more sam sam be all of tie of former eft later sam eft more sam Though "more" could also be replaced with "etcetera" or "etc" or "mo" for terseness or "and·son·on" for something more casual. Admittedly some of these words are not very frequently used in English, but that can actually be a big plus for a programming language keyword. On the other hand all of these terms have a meaning recorded in lexicographic works that would make perfect sense for the context they are placed in each position above. And taking the exact opposite of the approach to carry so much semantic in non-phonetic symbols, that is making them as semantically as void as a space or a comment in code parlance, they can just as well be introduced again: 【let〖all-same⦅of(array〚of[former„eft”latter„eft”⋮more⋮]sam〛)sam⦆be〗⧘:⧙ { all⦅of(tie〚of[former„eft”later]sam〛„eft”⋮more⋮)sam⦆∎ }】◼ Ok, a bit far fetched, but it does illustrate well what this reversed approach regarding soundless symbols can open in term of additional scriptural cues compared to the one which also will bind them to some semantic and syntax constraints. https://en.wiktionary.org/wiki/mo#Adverb https://en.wiktionary.org/wiki/mo#Adverb https://en.wiktionary.org/wiki/sam#Adverb https://en.wiktionary.org/wiki/sam#Adverb https://en.wiktionary.org/wiki/eft#Adverb https://en.wiktionary.org/wiki/eft#Adverb
- samdphillips 2y agoThe easiest way would be to rename the imported names #lang rhombus import rhombus: only: fun ... rename fun as fn rename ... as … open fn all_same([str0, str, …]): all(str0 == str, …)