Lessons

Forth · Easy

Forth · Easy. Ten lessons. Open-book quizzes. Lesson 1 free.

10 lessons · The Host · Lesson 1 free

Pass all ten lessons for the certificate. Sample · Claim

  1. CASE OF ENDOF ENDCASE

    Lesson 1 · On the house

    CASE OF ENDOF ENDCASE

    Dispatch on a kept selector with case ... of ... endof ... endcase, and put a default branch before endcase.

  2. Deferred words: DEFER IS ACTION-OF

    Lesson 2

    Deferred words: DEFER IS ACTION-OF

    Bind a name now and fill in its behaviour later with defer, is and action-of, for hooks and late binding.

  3. Locals: brace lists that name stack items

    Lesson 3

    Locals: brace lists that name stack items

    Name inputs with { a b -- out } inside a definition, read them as words, and keep the stack comment honest.

  4. Exceptions: THROW and CATCH

    Lesson 4

    Exceptions: THROW and CATCH

    Protect a call with catch, signal failure with throw, and branch on the thrown code without unwinding by hand.

  5. File I/O: create-file, read-file, write-file, include

    Lesson 5

    File I/O: create-file, read-file, write-file, include

    Open files with create-file and open-file, transfer bytes with write-file and read-file, close handles, and load source with include.

  6. Wordlists: VOCABULARY, GET-ORDER, SET-ORDER

    Lesson 6

    Wordlists: VOCABULARY, GET-ORDER, SET-ORDER

    Isolate names in vocabularies, search them with also/previous, and switch the compilation wordlist with definitions.

  7. Structures: struct, field, end-struct, %allot

    Lesson 7

    Structures: struct, field, end-struct, %allot

    Lay out records with Gforth struct/field, allocate them with %allot, and read fields as address offsets.

  8. Floating point: the float stack

    Lesson 8

    Floating point: the float stack

    Push floats with e-suffix literals, compute on the separate float stack with f+ f* f/, and print with f.

  9. Pictured numeric output: <# # #s #>

    Lesson 9

    Pictured numeric output: <# # #s #>

    Build digit strings with <# # #s #> HOLD and SIGN, and restore BASE after hex or padded prints.

  10. Execution tokens: tick, EXECUTE, POSTPONE, LITERAL

    Lesson 10

    Execution tokens: tick, EXECUTE, POSTPONE, LITERAL

    Get xts with ' and ['], run them with execute, compile them with postpone, and bake values with literal.

Sample certificate

Certificate of completion

Sign in to claim your certificate of completion.

Certificate

Finish all ten lessons, then sign in

Pass every lesson on this device (quizzes and checks). Then sign in or create an account to type your name and download the JPG.

All lessons