=

= (leftValue rightValue -- isEqual)

Inputs

Outputs

= compares dereferenced values by value equality.

Supported inputs are values whose dereferenced schemas are same-schema Cond, numeric, or non-NIL Text.

= answers a different question from is and same. Use is for identity-like equality and same for dereferenced schema identity.

Behavior

Example

{} 0 {} [
  condValue: TRUE dynamic;
  first: 7;
  second: 7;
  numberValue: 0 dynamic;
  textValue: 0 ("") dynamic @;

  "-- cond --" printCompilerMessage
  TRUE TRUE = printStack _:;
  TRUE FALSE = printStack _:;
  condValue TRUE = printStack _:;

  "-- numbers compare by value --" printCompilerMessage
  7 7 = printStack _:;
  7 8 = printStack _:;

  "-- references are dereferenced first --" printCompilerMessage
  @first @second = printStack _:;
  @first @second is printStack _:;

  "-- unknown int32 --" printCompilerMessage
  numberValue 7 = printStack _:;

  "-- text --" printCompilerMessage
  "alpha" "alpha" = printStack _:;
  "alpha" "beta" = printStack _:;

  "-- unknown text --" printCompilerMessage
  textValue "alpha" = printStack _:;

  0
] "main" exportFunction

Expected Output During Compilation

-- cond --
TRUE
FALSE
Cond
-- numbers compare by value --
TRUE
FALSE
-- references are dereferenced first --
TRUE
FALSE
-- unknown int32 --
Cond
-- text --
TRUE
FALSE
-- unknown text --
Cond

See also