JanetDocsPlaygroundI'm feeling luckyGitHub sign in

=



    function

    (= & xs)

    Check if all values in xs are equal. Returns a boolean.


4 examplesSign in to add an example
Loading...
# janet 1.10.1

(=       [1 1]   [1 1])  # => true
(=       [1 1]   [2 3])  # => false
(=       [1 1]  @[1 1])  # => false
(=       [1 1]  @[2 3])  # => false
(=      @[1 1]  @[1 1])  # => false
(=      @[1 1]  @[2 3])  # => false

(deep=   [1 1]   [1 1])  # => true
(deep=   [1 1]   [2 3])  # => false
(deep=   [1 1]  @[1 1])  # => false
(deep=   [1 1]  @[2 3])  # => false
(deep=  @[1 1]  @[1 1])  # => true
(deep=  @[1 1]  @[2 3])  # => false
cellularmitosisPlayground
(def a @[1 2])
(def b @[1 2])
(= a b)  # => false

(def a @[1 2])
(def b (array/concat a 3))
a        # => @[1 2 3]
b        # => @[1 2 3]
(= a b)  # => true
cellularmitosisPlayground
# janet 1.10.1

(= :a :a)    # => true
(= :a "a")   # => false
(= :a ":a")  # => false

(= "a" "a")    # => true
(= "a" @"a")   # => false
(= @"a" @"a")  # => false

(= [1 2] [1 2])    # => true
(= [1 2] @[1 2])   # => false
(= @[1 2] @[1 2])  # => false

(= {:a 1} {:a 1})    # => true
(= {:a 1} @{:a 1})   # => false
(= @{:a 1} @{:a 1})  # => false

(= (fn []) (fn []))  # => false
cellularmitosisPlayground
(= 1 1)  # => true
(= 1 2)  # => false

(= 1.1 1.1)  # => true
(= 1.1 1.2)  # => false

(= 1 1.0)  # => true

# these are representations of two different IEEE-754 64-bit buckets:
(= 
 1.0000000000000001
 1.0000000000000002)  # => false

# these are two representations of the same IEEE-754 64-bit bucket:
(= 
 1.00000000000000001
 1.00000000000000002)  # => true
cellularmitosisPlayground