mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
Update docs for $_ and $nil.
This commit is contained in:
parent
5cb2a83959
commit
5ec11cfe2b
|
@ -12,8 +12,7 @@ import (
|
||||||
//
|
//
|
||||||
// A blackhole variable.
|
// A blackhole variable.
|
||||||
//
|
//
|
||||||
// Values assigned to it will be discarded. Trying to use its value (like `put $_`)
|
// Values assigned to it will be discarded. Referencing it always results in $nil.
|
||||||
// causes an exception.
|
|
||||||
|
|
||||||
//elvdoc:var args
|
//elvdoc:var args
|
||||||
//
|
//
|
||||||
|
@ -44,8 +43,6 @@ import (
|
||||||
//elvdoc:var nil
|
//elvdoc:var nil
|
||||||
//
|
//
|
||||||
// A special value useful for representing the lack of values.
|
// 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
|
//elvdoc:var paths
|
||||||
//
|
//
|
||||||
|
|
|
@ -12,7 +12,7 @@ func (blackhole) Get() interface{} {
|
||||||
|
|
||||||
// NewBlackhole returns a blackhole variable. Assignments to a blackhole
|
// NewBlackhole returns a blackhole variable. Assignments to a blackhole
|
||||||
// variable will be discarded, and getting a blackhole variable always returns
|
// variable will be discarded, and getting a blackhole variable always returns
|
||||||
// an empty string.
|
// nil.
|
||||||
func NewBlackhole() Var {
|
func NewBlackhole() Var {
|
||||||
return blackhole{}
|
return blackhole{}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user