浏览代码

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 月之前
父节点
当前提交
c717c67c97
共有 2 个文件被更改,包括 4 次插入0 次删除
  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