Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Document comma-separated conditions in language FAQ #362

Open
lucaswerkmeister opened this issue Nov 12, 2015 · 2 comments
Open

Document comma-separated conditions in language FAQ #362

lucaswerkmeister opened this issue Nov 12, 2015 · 2 comments
Milestone

Comments

@lucaswerkmeister
Copy link
Contributor

The Language design Frequently Asked Questions¹ should cover our syntax of comma-separated conditions

if (exists a, nonempty b)

since newcomers will naturally want to write

if (exists a && nonempty b)

This could be added to the existing section Prefix form for is Type, exists, and nonempty (with a generalized title), or a new section below it. I vote for the former – I think that

  • the prefix form of these conditions,
  • the need for comma-separating them (ambiguity of exists x = a && b), and
  • the existence of and difference to their postfix forms, which do not need commas

should better be explained in a single section.

I can take a stab at this tomorrow.

¹ which, aside, would look much better as Language Design Frequently Asked Questions

@lucaswerkmeister
Copy link
Contributor Author

That section needs an update in general. This “confusing unsupported syntax”

if (!person is Employee) { ... } //confusing unsupported syntax

is actually supported. And of course it talks about how the postfix form doesn’t work when in fact it is available.

lucaswerkmeister added a commit to lucaswerkmeister/ceylon-lang.org that referenced this issue Nov 13, 2015
lucaswerkmeister added a commit to lucaswerkmeister/ceylon-lang.org that referenced this issue Nov 13, 2015
@ePaul
Copy link
Contributor

ePaul commented Jun 25, 2016

@lucaswerkmeister While if(! person is Employee){ ... } is valid syntax, it doesn't narrow down the type of person (what the whole point of conditions vs. expressions is). Maybe this is what was meant with the comment?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants