You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just a contribution / proposal for an improved surface syntax:
An expression with an "observed variable" <expr> !v
is difficult to read, because the variable "banging" is at the end and v is always a valid variable from the context. Since <expr> may be arbitrary large and complex, it may be misleading when you first read <expr> and only realize afterwards that v has been made readonly. Even in the bilby fs code there are examples where <expr> has more than one line.
I propose the syntax let !v in <expr>
instead (or additionally, to be upward compatible). Remarks:
the rationale is that !v can be understood as introducing a new variable which is bound to the readonly value and shadows in its scope <expr> the existing variable with the linear value.
the usual abbreviation using and could be applied to support several banged variables and also to mix them with normal bindings, such as in let a = 10 and !v and !w and b = v.m in ...
syntactically let !v in <expr> would be a special form of the normal let-expression and may be used wherever a let-expression is permitted (or is that a problem for the core syntax?). This would even simplify the syntax (and the parser) by removing the special cases now present for banged variables.
Description
For some reason, we want to rewrite our surface syntax parser, and also take this opportunity to revise our surface syntax.
The text was updated successfully, but these errors were encountered: