From b2c704deaf460e97e89895f409368879e3f46f60 Mon Sep 17 00:00:00 2001 From: HorseMD Date: Thu, 13 Nov 2014 16:29:40 +0000 Subject: Fix missing comment, pull up a few lines. --- forth.html.markdown | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'forth.html.markdown') diff --git a/forth.html.markdown b/forth.html.markdown index 8cfa46e4..11300159 100644 --- a/forth.html.markdown +++ b/forth.html.markdown @@ -16,7 +16,7 @@ Forth, but most of what is written here should work elsewhere. \ Forth is an interactive programming language which is comprised of \ *words*. These are Forth subroutines which are executed once you press -, from left to right. +\ , from left to right. \ ------------------------------ Precursor ------------------------------ @@ -46,8 +46,6 @@ Forth, but most of what is written here should work elsewhere. 1360 23 - . \ 1337 ok 12 12 / . \ 1 ok -\ And so on. - \ ----------------------------- Stack Manipulation ----------------------------- \ Naturally, as we work with the stack, we'll want some useful methods: @@ -83,18 +81,15 @@ see square \ dup * ; ok \ 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. \ However, any non-zero value is usually treated as being true: - 42 42 = / -1 ok 12 53 = / 0 ok \ `if` is a *compile-only word*. This means that it can only be used when we're \ compiling a word. The format is `if` `then` . - : ?>64 ( n -- n ) DUP 64 > if ." Greater than 64!" then ; \ ok 100 ?>64 \ Greater than 64! ok \ Else: - : ?>64 ( n -- n ) DUP 64 > if ." Greater than 64!" else ." Less than 64!" then ; 100 ?>64 \ Greater than 64! ok 20 ?>64 \ Less than 64! ok -- cgit v1.2.3