-
Notifications
You must be signed in to change notification settings - Fork 28
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
modal harmony #159
Comments
160: introduce shlease r=nikomatsakis a=nikomatsakis Introduce the `shleased` mode and `shlease` action, and some tests demonstrating the difference between `foo.shlease` and `foo.lease.share`. cc #159 Co-authored-by: Niko Matsakis <[email protected]>
Other random names and thoughts I figured I might as well jot down. I've been pondering the names. shlease really feels like a non-starter the more I think about it. :) Read and write. We could call the leased modes "read" and "write" (and the verbs to get them
Interesting thing, given some Leased and shared. We could call the leased modes "leased" and "shared", but in that case
Then you would do:
or
You could apply Can we get rid of shleases? Of course the big question is if we need the idea of a shlease. I considered a few alternatives. At some point I wanted to
There are some assumptions in this example, though. I'm assuming that sharing from. I've been pondering also what I want the fully typed, non-elided forms to look like. I am expecting something like this:
where Conclusion. Nothing really, just that I need to come up with a canonical set of examples I can use to illustrate the various options. I have a bunch of modes, combinations and examples floating in my head and it's hard to remember them all at once! Going to work a bit on that. |
|
The "modal harmony" branch is my attempt to "revamp" dada by adding "modes" to variables. This is a tracking issue covering the plan and pending work and decisions.
The plan
If we make further changes (e.g., see the unresolved questions below), will add new PRs here.
Implementation steps
m
applies the appropriate operation (e.g., assigning to amy
variable is agive
, etc)m
also applies that effect to themy
requires unique ownership)our leased
in Modal harmony #148)print
to not print permissions and to shlease its arguments, just as user code would doUnresolved questions
Names for the modes
Currently the modes are as follows.
my
our
leased
shleased
There are also the following "verbs" to transform permissions:
o.give
produces another value with same permissions aso
o.share
moves "one slot" to the right, so given amy
value it produces anour
, given aleased
value you get back ashleased
o.lease
moves "one slot" down, so given amy
value you get aleased
, given anour
you get ashleased
I am pondering whether the following names would be better:
owned
shared
leased
shleased
They are longer, which is a drag, but they are more consistent.
The text was updated successfully, but these errors were encountered: