-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
We have syntax to add a field, but it adds a new record. For example,
from e in emps,
pay = e.sal + e.commreturns elements with fields e and pay. (The e field is a record, containing all 8 fields of emps, and pay is a scalar.)
But we need a syntax to add a field to e, so that it has 9 fields (one of which is pay). Inspired by with (added in #249) which replaces a field with a new value, we could add withnew, like this:
from e in emps
yield {e withnew pay = e.sal + e.comm}withnew is not a great name. We should find a better word. But it's good that this can be achieved without adding a new relational operator (type of step).
Elm-like syntax
Elm has extensible records. With Elm's syntax, this example would be
from e in emps
yield {e | pay = e.sal + e.comm}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels