▲ | kragen 2 days ago | ||||||||||||||||
LINQ uses "where". As for single-word alternatives, "if" is common. For example, in Python:
Common Lisp uses "if" but also uses "when":
Perl and Common Lisp both use "unless", of course with the sense inverted:
SQL uses both "where" and "having". You could also reasonably use "suppose", "stipulate", "assert", "wolog", or "let". Lisp M-expressions (and, arguably, Dijkstra's guarded command language) used "→". | |||||||||||||||||
▲ | layer8 2 days ago | parent [-] | ||||||||||||||||
For my second question I was actually more thinking of value constrains as type annotations. For example, something like
Meaning the compiler would statically verify that x < y for all instances of S at all times. Alternatively, you could also have:
to only restrict a specific variable."If" wouldn't fit that use case, and neither would "when". I suppose "require" would work, but it also feels different from "such that". The intended meaning of the latter example would be "let s be an S such that s.x < s.y". "Given", as the sibling comment by hallole proposes, also doesn't fit. | |||||||||||||||||
|