Update docs for $_ and $nil.

This commit is contained in:
Qi Xiao 2020-09-04 22:45:04 +01:00
parent 5cb2a83959
commit 5ec11cfe2b
2 changed files with 2 additions and 5 deletions

View File

@ -12,8 +12,7 @@ import (
//
// A blackhole variable.
//
// Values assigned to it will be discarded. Trying to use its value (like `put $_`)
// causes an exception.
// Values assigned to it will be discarded. Referencing it always results in $nil.
//elvdoc:var args
//
@ -44,8 +43,6 @@ import (
//elvdoc:var nil
//
// A special value useful for representing the lack of values.
//
// **WARNING**: Due to a bug, `$nil` cannot be used as a map key now.
//elvdoc:var paths
//

View File

@ -12,7 +12,7 @@ func (blackhole) Get() interface{} {
// NewBlackhole returns a blackhole variable. Assignments to a blackhole
// variable will be discarded, and getting a blackhole variable always returns
// an empty string.
// nil.
func NewBlackhole() Var {
return blackhole{}
}