← Starting Henceforth
Episode 6
Letters are numbers
Letters, words, even pictures — all just numbers you print.
1:59 · Trepak · Russian Dance (Nutcracker, Op. 71)
Watch here · code in the app
Henceforth is the real terminal — one purchase ($9.99) for iPhone, iPad and Mac. Type the commands below into the app as you watch.
Code along
Tap to copy, then type it into Henceforth.
What you’ll learn
- ✓ emit prints one character from its number — 42 is *, and 65 66 67 are A B C. A letter is just a number you print.
- ✓ A word can hold text too: : dog ." the dog" ; — then string printing-words into a sentence. Words from words, applied to letters.
- ✓ s" hands you a string as a pair — an address and a count — and type prints it. That same pair is what pay-rent fed send back in episode four.
Transcript
- we've moved numbers around. but what about letters?
- two ways to print. first — just text.
- dot-quote prints what you typed. the quotes hold the words.
- the other way — one letter at a time.
- forty-two — a star came out.
- wait. one number, one character?
- a, b, c — next number, next letter. letters are just numbers.
- name it once — now star's a word.
- thirty-two? just a blank — a space is a number too.
- a word can hold text, too — not just a number.
- now string them — a space between each. that's a word too, remember.
- a sentence — built from words.
- ...the dog. that's me, by the way.
- and the same words draw pictures.
- letters, words, pictures — all just numbers you print.
- and a whole word at once?
- s-quote hands you a string — an address, and a length.
- type prints all of it — given where, and how many.
- remember this pair — an address, and a count?
- that's exactly what pay-rent fed send, back in episode four.
- a string, and where it goes.
- more in episode ten.
- henceforth.