diff --git a/intro.md b/intro.md index e5379fc..2524f6b 100644 --- a/intro.md +++ b/intro.md @@ -183,6 +183,7 @@ helpful for this sort of construction: QUOTE DQUOTE BQUOTE + UPLINE These all evaluate to atoms whose names are the unreadable characters, some of which may be helpful for text games and other diversions: @@ -211,6 +212,11 @@ some of which may be helpful for text games and other diversions: () > +The `UPLINE` character, in particular, which moves the cursor to the +beginning of the previous line, is useful for making command-line +output which repeatedly updates the line in place, rather than +printing multiple lines. + ## Functions Functions come in two flavors: temporary functions, called "lambda" diff --git a/l1.md b/l1.md index 8f917f4..9af1931 100644 --- a/l1.md +++ b/l1.md @@ -183,6 +183,7 @@ helpful for this sort of construction: QUOTE DQUOTE BQUOTE + UPLINE These all evaluate to atoms whose names are the unreadable characters, some of which may be helpful for text games and other diversions: @@ -211,6 +212,11 @@ some of which may be helpful for text games and other diversions: () > +The `UPLINE` character, in particular, which moves the cursor to the +beginning of the previous line, is useful for making command-line +output which repeatedly updates the line in place, rather than +printing multiple lines. + ## Functions Functions come in two flavors: temporary functions, called "lambda" diff --git a/lisp/builtin.go b/lisp/builtin.go index 8b40f4f..2fab1e3 100644 --- a/lisp/builtin.go +++ b/lisp/builtin.go @@ -30,6 +30,7 @@ func InitGlobals() Env { globals.Set("QUOTE", Atom{"'"}) globals.Set("BQUOTE", Atom{"`"}) globals.Set("DQUOTE", Atom{"\""}) + globals.Set("UPLINE", Atom{"\033[F"}) return globals }