Browse Source

doc: add more references to _ and 'ans'

_/ans are only mentioned in the cli-usage page, this was hard
to find so add it to the syntax overviews as well
Dominique Martinet 7 months ago
parent
commit
c717c67c97
2 changed files with 4 additions and 0 deletions
  1. 2 0
      book/src/example-numbat_syntax.md
  2. 2 0
      examples/numbat_syntax.nbt

+ 2 - 0
book/src/example-numbat_syntax.md

@@ -58,6 +58,8 @@ pi/3 + pi |> cos  # Same, 'arg |> f' is equivalent to 'f(arg)'
                   # which makes it very useful for interactive
                   # terminals (press up-arrow, and add '|> f')
 
+_                 # Result of last calculation, also 'ans'
+
 # 4. Constants
 
 let n = 4                          # Simple numerical constant

+ 2 - 0
examples/numbat_syntax.nbt

@@ -53,6 +53,8 @@ pi/3 + pi |> cos  # Same, 'arg |> f' is equivalent to 'f(arg)'
                   # which makes it very useful for interactive
                   # terminals (press up-arrow, and add '|> f')
 
+_                 # Result of last calculation, also 'ans'
+
 # 4. Constants
 
 let n = 4                          # Simple numerical constant