Ver Fonte

Tweak example for using variable defined by fn.

Qi Xiao há 3 anos atrás
pai
commit
ab09c81cc5
1 ficheiros alterados com 4 adições e 6 exclusões
  1. 4 6
      website/ref/language.md

+ 4 - 6
website/ref/language.md

@@ -2017,14 +2017,12 @@ recursive functions:
 ```
 
 Under the hood, `fn` defines a variable with the given name plus `~` (see
-[variable suffix](#variable-suffix)).
+[variable suffix](#variable-suffix)). Example:
 
 ```elvish-transcript
-~> fn f []{ echo hello from f }
-~> f
-hello from f
-~> ff = $f~
-~> $ff
+~> fn f { echo hello from f }
+~> var v = $f~
+~> $v
 hello from f
 ```