-
Notifications
You must be signed in to change notification settings - Fork 8
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
Reconsider the use/explanation of extract
in the tutorial's "Second loop example"
#51
Comments
That sounds like a good idea. I've, in fact, been looking for a different name for
|
"focus"?
…On Mon, Jul 22, 2024 at 9:49 AM Christopher Pulte ***@***.***> wrote:
That sounds like a good idea.
I've, in fact, been looking for a different name for extract that better
describes what it does: extract P, i (for some predicate name P) tells CN
that it should feel free to instantiate and "reverse-instantiate" iterated
resources with predicate name P for index i. So the name "extract" is not
representative of what it actually does in two ways:
-
it allows CN not just to extract but also to re-attach, and
-
the extract does not just prompt a single action, it's more
declarative -- following the extract CN knows that for the remainder
of this control-flow path it should freely extract and re-attach that index
in matching iterated resources.
—
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/rems-project/cn-tutorial/issues/51*issuecomment-2243012776__;Iw!!IBzWLUs!WkHjkGWa2F9gcnwJv5UBC8KxM5A5QHYLVVV-Jx023p3Eez13nxHJmaS4k8htYe4GMrkYpKMKRhQLONIwrAB6HKTl3oQK$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/ABVQQCYLAHZBXFHQ7P7ECRTZNUEX5AVCNFSM6AAAAABLFNO2YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBTGAYTENZXGY__;!!IBzWLUs!WkHjkGWa2F9gcnwJv5UBC8KxM5A5QHYLVVV-Jx023p3Eez13nxHJmaS4k8htYe4GMrkYpKMKRhQLONIwrAB6HFx7pZ6n$>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
or some variant of "treat specially"
On Mon, Jul 22, 2024 at 9:50 AM Benjamin Pierce ***@***.***>
wrote:
… "focus"?
On Mon, Jul 22, 2024 at 9:49 AM Christopher Pulte <
***@***.***> wrote:
> That sounds like a good idea.
>
> I've, in fact, been looking for a different name for extract that better
> describes what it does: extract P, i (for some predicate name P) tells
> CN that it should feel free to instantiate and "reverse-instantiate"
> iterated resources with predicate name P for index i. So the name
> "extract" is not representative of what it actually does in two ways:
>
> -
>
> it allows CN not just to extract but also to re-attach, and
> -
>
> the extract does not just prompt a single action, it's more
> declarative -- following the extract CN knows that for the remainder
> of this control-flow path it should freely extract and re-attach that index
> in matching iterated resources.
>
> —
> Reply to this email directly, view it on GitHub
> <https://urldefense.com/v3/__https://github.com/rems-project/cn-tutorial/issues/51*issuecomment-2243012776__;Iw!!IBzWLUs!WkHjkGWa2F9gcnwJv5UBC8KxM5A5QHYLVVV-Jx023p3Eez13nxHJmaS4k8htYe4GMrkYpKMKRhQLONIwrAB6HKTl3oQK$>,
> or unsubscribe
> <https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/ABVQQCYLAHZBXFHQ7P7ECRTZNUEX5AVCNFSM6AAAAABLFNO2YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBTGAYTENZXGY__;!!IBzWLUs!WkHjkGWa2F9gcnwJv5UBC8KxM5A5QHYLVVV-Jx023p3Eez13nxHJmaS4k8htYe4GMrkYpKMKRhQLONIwrAB6HFx7pZ6n$>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
|
"focus" actually matches quite well! |
Just for completeness: it is in principle also possible to change the semantics of But "focus" seems quite good! |
Ah, I see - I guess the idiom is probably to put all of your At any rate, I like "focus" as well, though I wouldn't be opposed to two different annotations for the two different directions. I've also just seen that there is some content in the tutorial about the "reverse" direction for |
Agreed. "Focus" would be better naming (previously I'd been considering "movable", but that isn't ideal either), but more tutorial text+examples would probably also be needed. |
I'll start by saying that this issue might just be a result of my misunderstanding.
When I was going through the second loop example in the tutorial, I was surprised by its second use of
extract
:It didn't easily fit into the mental model of
extract
- a tool to extract individual elements from in-scope iterated resources - that earlier parts of the tutorial had been guiding me towards. Now, the tutorial does offer some explanation of this:But, to the extent I understand this explanation, it's describing an entirely different semantics for
extract
as compared to its prior and subsequent mentions. Not only was I surprised that it's apparently doing the opposite of whatextract
usually does, I was particularly surprised to see that one is able to write thisextract
seemingly before theOwned
resource is actually introduced (which I would assume would happen at the write top[j]
).I think that this use case for
extract
might warrant a bit more explanation, and perhaps another motivating example, to help tutorial consumers gain a better understanding of it.The text was updated successfully, but these errors were encountered: