Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injectable set expressions in DML #295

Open
EvanKirshenbaum opened this issue Jan 30, 2024 · 0 comments
Open

Injectable set expressions in DML #295

EvanKirshenbaum opened this issue Jan 30, 2024 · 0 comments
Labels
3 medium Issue of medium importance in: DML issues related to the macro language is: feature Issue proposes a new feature

Comments

@EvanKirshenbaum
Copy link

Thinking about paths some more (#282), one of the things you often want to do is assert a new reagent for the drop, either waste or something protocol-specific. The most straightforward way to do this is probably something like

... : set reagent = waste : ...

(or to waste).

This would be essentially equivalent to

... : lambda(drop d) { d's reagent=waste; } : ...

or possibly better

... : (lambda(drop d, reagent r) { d's reagent=r; })(waste) : ...

except that when the compile sees set reagent = waste, it can't know that what it's going to need is a drop. So what I probably want is a result that can take anything that has a reagent attributethat could takewaste`.

In other words, set A to E evaluates E and returns a lambda that can take anything that has an A that can be set using E's type. To do this right, I will definitely need overloaded functions (#288).

One thing to note here is that I want to get the precedence right so that set expressions can sit within injection chains. That is,

... : set attr to x+1 : ...

should put the addition within the value, but

... : set attr to x : f : ...

should take f as the next injection target. To make it part of the value, you should have to say

... : set attr to (x : f) : ...
Migrated from internal repository. Originally created by @EvanKirshenbaum on Aug 03, 2023 at 11:43 AM PDT.
@EvanKirshenbaum EvanKirshenbaum added 3 medium Issue of medium importance in: DML issues related to the macro language is: feature Issue proposes a new feature labels Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 medium Issue of medium importance in: DML issues related to the macro language is: feature Issue proposes a new feature
Projects
None yet
Development

No branches or pull requests

1 participant