Proposal-pattern-matching: special case Infinity and NaN matching iff undefined is special cased

Created on 26 Mar 2018  ·  8Comments  ·  Source: tc39/proposal-pattern-matching

While I don't like the special casing of undefined, it would be irresponsibly inconsistent if it was special cased without Infinity and NaN having equivalent semantics.

All 8 comments

Ooh, yeah, those have the same behavior as undefined - frozen on the global, but technically shadowable in functions. Makes sense to treat them the same. (Plus -Infinity, just in case the grammar doesn't magically include that.)

Come to think of it, Infinity and -Infinity having wildly different behaviour might be another "wat" we'd like to avoid. Maybe the special-casing isn't so bad...

See #80

I've removed the special case altogether for the time being. I agree that if we special case one special read-only global, we need to special case all of them, possibly as literals. Hopefully we'll have a single, structured discussion at some point about what the right thing to do with something like this actually is.

I think that’s a big mistake that will prevent advancement of this proposal; please reopen this issue until the committee has discussed it.

@ljharb it's a stage 0 proposal. Far as I'm told this level of detail is irrelevant at this stage. If you care about this, set up a PR with a bikeshed section on CORE.md so it stays a point to discuss. Issues can't keep up with changes. I will not be reopening this.

I suppose that’s fair, it will just come up again during stage 2. I’m not sure i see the benefit of closing it now.

PR'd. Since you're the real owner of the repo, Kat, feel free to merge or edit as you see fit. ^_^

Was this page helpful?
0 / 5 - 0 ratings