+
Skip to content
This repository was archived by the owner on Aug 14, 2019. It is now read-only.

Conversation

philipcmonk
Copy link
Contributor

Suppose my-mark has type my-type.

In gall apps, +diff-my-mark handles all %diff cards with mark my-mark and takes an argument of type [wire my-type].

However, +diff handles all %diff cards not otherwise handled, and takes an argument of type [wire cage]. A cage includes vase, which is very unhelpful (so it was never used).

This is obviously wrong. This PR makes it so +diff takes an argument of type [wire %my-mark my-type]. This gives us a well-typed value, so we can actually do something with this.

The same applies to +sigh, so I changed that too.

The motivation for this is in the philip/trad branch, where I would like to be able to handle all subscription results in a single arm because the library that creates this arm doesn't know until compile time what are the possible subscription results (it gets the types via |* mold parameterization). See

arvo/lib/tapp.hoon

Lines 149 to 159 in 40c4ea4

++ diff
|= [=wire =in-peer-data]
^- (quip move _this-tapp)
?> ?=([@ @ *] wire)
=/ her (slav %p i.wire)
=* app i.t.wire
=* pax t.t.wire
=. waiting (~(put to waiting) %diff [her app] pax in-peer-data)
?^ active
`this-tapp
start-trad
and the definition of in-peer-data

arvo/lib/tapp.hoon

Lines 3 to 8 in 40c4ea4

|* $: state-type=mold
command-type=mold
poke-data=mold
out-peer-data=mold
in-peer-data=mold
==

@philipcmonk philipcmonk requested a review from jtobin May 28, 2019 22:54
@belisarius222
Copy link

Am I correct in interpreting this as a shift from [mark vase] to !>([mark data])? That was a change I was pushing for in Ford-Fiesta, and I suspect there are several places we should make that transformation.

@philipcmonk
Copy link
Contributor Author

No, from gall's perspective it's a shift from !>([mark !>(data)]) to !>([mark data]). From the app's perspective, you take off the outer !>, so it's a shift from [mark !>(data)] to [mark data].

@cgyarvin
Copy link
Contributor

cgyarvin commented May 28, 2019 via email

Copy link
Contributor

@jtobin jtobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, from gall's perspective it's a shift from !>([mark !>(data)]) to !>([mark data]). From the app's perspective, you take off the outer !>, so it's a shift from [mark !>(data)] to [mark data].

It actually took me a little bit of time to see this, but seems clear now.

Also, interesting: I hadn't realised that nothing has been using +diff in its intended fallback mode of sorts.

@jtobin jtobin merged commit a4a2f36 into master May 29, 2019
@jtobin jtobin deleted the philip/ap-cage branch May 29, 2019 07:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载