mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-04 02:37:50 +08:00
36 lines
478 B
Plaintext
36 lines
478 B
Plaintext
//////
|
|
# ns #
|
|
//////
|
|
|
|
~> kind-of (ns [&])
|
|
▶ ns
|
|
|
|
## equality ##
|
|
// an Ns is only equal to itself ##
|
|
~> var ns = (ns [&])
|
|
eq $ns $ns
|
|
▶ $true
|
|
~> eq (ns [&]) (ns [&])
|
|
▶ $false
|
|
~> eq (ns [&]) [&]
|
|
▶ $false
|
|
|
|
## access ##
|
|
~> var ns: = (ns [&a=b &x=y])
|
|
put $ns:a
|
|
▶ b
|
|
~> var ns: = (ns [&a=b &x=y])
|
|
put $ns:[a]
|
|
▶ b
|
|
|
|
## keys ##
|
|
~> keys (ns [&a=b &x=y]) | order
|
|
▶ a
|
|
▶ x
|
|
|
|
## has-key ##
|
|
~> has-key (ns [&a=b &x=y]) a
|
|
▶ $true
|
|
~> has-key (ns [&a=b &x=y]) b
|
|
▶ $false
|