You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Special thanks to Tracy Harms for first showing me this code in a talk of his, which finally made "forks" click!
NB. A numeronym is formed by joining:NB. - The first letter of the stringNB. - The number of letters between the ends of the string (length - 2)NB. - The last letter of the stringNB. So "numeronym" itself is transformed as follows:NB. n [umerony] mNB. ^^7^^NB. n7mNB. We can grab the first letter of the string{.'internationalization'NB. iNB. We can grab the last letter of the string{:'internationalization'NB. nNB. We can grab the number of letters in the string#'internationalization'NB. 20NB. We can partially evaluate a verb with using "binding"2+3NB. 5
(2&+) 3NB. 55-1NB. 4
(-&1) 5NB. 4NB. We can create a verb that subtracts 2 from an input
(-&2) 10NB. 8NB. We can compose verbs#'hello'NB. 5
((-&2) @#) 'hello'NB. 3
((-&2) @#) 'internationalization'NB. 18NB. We can concatenate lists12,34NB. 1 2 3 4'hello ','world'NB. hello worldNB. But we can't mix types12,'hello'NB. |domain errorNB. | 1 2 ,'hello'NB. The format verb can convert numbers to strings
(":12) ,'hello'NB. 1 2helloNB. We can compose our length-minus-2 further
((-&2) @#) 'internationalization'NB. 18
(":@ (-&2) @#) 'internationalization'NB. 18 (but a string!)NB. We can begin building our numeronym verb
({.'numeronym') , ((":@ (-&2) @#) 'numeronym') , ({:'numeronym')
NB. n7mNB. J allows us to transform (f x) g (h x) into (f g h) x
({.'numeronym') , (((":@ (-&2) @#) ,{:) 'numeronym')
NB. n7mNB. We can keep going
({., (":@ (-&2) @#) ,{:) 'numeronym'NB. n7mNB. We can save this as our own verb
n7m =: {., (":@ (-&2) @#) ,{:
n7m 'internationalization'NB. i18n
n7m 'accessibility'NB. a11y
The text was updated successfully, but these errors were encountered:
Numeronyms
[How to read this blog post]
Special thanks to Tracy Harms for first showing me this code in a talk of his, which finally made "forks" click!
The text was updated successfully, but these errors were encountered: