Semantic restriction_is_

Definitions:

atom, semantic restriction function
Source: /avail/Avail/Foundation/Bootstrap/Fallible Primitives
Categories: Semantic Restrictions
Define the specified semantic restriction. Henceforth whenever the method named by methodName is invoked with arguments accepted by restriction, then apply restriction with the most specific available types of the actual arguments. This is determined by the compiler at the method's call site.

A semantic restriction has two responsibilities. First, it may reject a method invocation on any appropriate semantic grounds by calling `Reject parse,expected:_`. Second, it may strengthen the type of value produced at the call site by answering a subtype of the method's declared return type.

Position Name Type Description
Parameters
1 methodName atom The name of the method to which the semantic restriction applies.
2 restriction semantic restriction function The restriction function.
Returns
Raises
incorrect-number-of-arguments exception
incorrect-argument-type exception
type-restriction-must-accept-only-types exception
incorrect-type-for-group exception
exclamation-mark-must-follow-an-alternation-group exception
incorrect-type-for-complex-group exception
incorrect-use-of-double-dagger exception
unbalanced-guillemets exception
method-name-is-not-canonical exception
expected-operator-after-backquote exception
incorrect-type-for-boolean-group exception
incorrect-type-for-counting-group exception
octothorp-must-follow-a-simple-group exception
question-mark-must-follow-a-simple-group exception
case-insensitive-expression-canonization exception
tilde-must-not-follow-argument exception
double-question-mark-must-follow-a-token-or-simple-group exception
alternative-must-not-contain-arguments exception
vertical-bar-must-separate-tokens-or-simple-groups exception
incorrect-type-for-numbered-choice exception
loading-is-over exception
string, semantic restriction function
Source: /avail/Avail/Foundation/Bootstrap/Fallible Primitives
Categories: Semantic Restrictions
Define the specified semantic restriction. Henceforth whenever the method named by methodName is invoked with arguments accepted by restriction, then apply restriction with the most specific available types of the actual arguments. This is determined by the compiler at the method's call site.

A semantic restriction has two responsibilities. First, it may reject a method invocation on any appropriate semantic grounds by calling `Reject parse,expected:_`. Second, it may strengthen the type of value produced at the call site by answering a subtype of the method's declared return type.

Position Name Type Description
Parameters
1 methodName string The name of the method to which the semantic restriction applies.
2 restriction semantic restriction function The restriction function.
Returns
Raises
incorrect-number-of-arguments exception
incorrect-argument-type exception
type-restriction-must-accept-only-types exception
incorrect-type-for-group exception
ambiguous-name exception
exclamation-mark-must-follow-an-alternation-group exception
incorrect-type-for-complex-group exception
incorrect-use-of-double-dagger exception
unbalanced-guillemets exception
method-name-is-not-canonical exception
expected-operator-after-backquote exception
incorrect-type-for-boolean-group exception
incorrect-type-for-counting-group exception
octothorp-must-follow-a-simple-group exception
question-mark-must-follow-a-simple-group exception
case-insensitive-expression-canonization exception
tilde-must-not-follow-argument exception
double-question-mark-must-follow-a-token-or-simple-group exception
alternative-must-not-contain-arguments exception
vertical-bar-must-separate-tokens-or-simple-groups exception
incorrect-type-for-numbered-choice exception
loading-is-over exception