mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-22 21:52:31 +03:00
Fix typos.
This commit is contained in:
parent
4d80a56d2c
commit
879da6be51
@ -81,8 +81,8 @@ see square \ dup * ; ok
|
|||||||
\ In Forth, -1 is used to represent truth, and 0 is used to represent false.
|
\ In Forth, -1 is used to represent truth, and 0 is used to represent false.
|
||||||
\ The idea is that -1 is 11111111 in binary, whereas 0 is obviously 0 in binary.
|
\ The idea is that -1 is 11111111 in binary, whereas 0 is obviously 0 in binary.
|
||||||
\ However, any non-zero value is usually treated as being true:
|
\ However, any non-zero value is usually treated as being true:
|
||||||
42 42 = / -1 ok
|
42 42 = \ -1 ok
|
||||||
12 53 = / 0 ok
|
12 53 = \ 0 ok
|
||||||
|
|
||||||
\ `if` is a *compile-only word*. This means that it can only be used when we're
|
\ `if` is a *compile-only word*. This means that it can only be used when we're
|
||||||
\ compiling a word. The format is `if` <stuff to do> `then` <rest of program>.
|
\ compiling a word. The format is `if` <stuff to do> `then` <rest of program>.
|
||||||
@ -99,7 +99,7 @@ see square \ dup * ; ok
|
|||||||
\ `do` is like `if` in that it is also a compile-only word, though it uses
|
\ `do` is like `if` in that it is also a compile-only word, though it uses
|
||||||
\ `loop` as its terminator:
|
\ `loop` as its terminator:
|
||||||
: myloop ( -- ) 5 0 do cr ." Hello!" loop ; \ ok
|
: myloop ( -- ) 5 0 do cr ." Hello!" loop ; \ ok
|
||||||
test
|
myloop
|
||||||
\ Hello!
|
\ Hello!
|
||||||
\ Hello!
|
\ Hello!
|
||||||
\ Hello!
|
\ Hello!
|
||||||
|
Loading…
Reference in New Issue
Block a user