Re: Next YAML: drop equality definition

Osamu TAKEUCHI <[email protected]> Sat, 5 Mar 2016 02:49:11 +0900
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
Oren,
  
>     Let me confirm one point. Does this allow identity-based
>     comparison of mapping nodes with some specific tags?
>
>
> Not sure what you mean. In YAML each mapping node has its own
>identity which is different from all other nodes. The only way
>for two mapping nodes to have the same identity is via an alias
>(anchor and reference).

My question was: Can we evaluate mapping nodes' equality with
their identity instead of their property values?

This question arose from your old post:
   https://sourceforge.net/p/yaml/mailman/message/23576035/

> > At first, I want to confirm that, a description
> > "two nodes are equal only when some condition is met" means
> > "two nodes are not equal when some condition is not met."
>
> Yes, it is an if-and-only-if, at least as far as the spec is concerned.

According to this rule, the description in the current spec
does not allow identity-base comparison.

>  Two mappings are equal only when they have the same tag and
>  an equal set of keys, and each key in this set is associated
>with equal values in both mappings.

It tells that the equality of mapping nodes must be done by
property values regardless of the equality operator of the
native object. It does not allow us to compare mapping nodes
by identity even if it is the native object's equality.

Best,
Osamu Takeuchi


------------------------------------------------------------------------------