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

+vats changes #6390

Closed
wants to merge 4 commits into from
Closed

+vats changes #6390

wants to merge 4 commits into from

Conversation

elizasviel
Copy link

@elizasviel elizasviel commented Mar 15, 2023

Description

Resolves #6297.

Took a first pass at this upgrading +vats; you can add options with +vats, =options [%option], =short [?]

@belisarius222

Would appreciate any feedback

@elizasviel elizasviel marked this pull request as ready for review March 15, 2023 00:44
:: usage: +vats, =options [%option], =short [?]
|%
+$ options ?(%suspended %running %blocking %exists %default)

Copy link
Contributor

Choose a reason for hiding this comment

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

Hoon style requires :: on blank lines.

++ report-running
|= [our=@p now=@da =short]
^- tang
=/ desks .^((set desk) %cd /(scot %p our)/base/(scot %da now)) ::preps desk variable, set of desks, scries clay for desks
Copy link
Contributor

Choose a reason for hiding this comment

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

style: lines should not exceed 80 characters

==
[%tang (report-vats p.bec now)]
?+ options [%tang (report-vats p.bec now short)]
%running [%tang (report-running p.bec now short)]
Copy link
Contributor

Choose a reason for hiding this comment

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

style: indent inside a ?+

@@ -49,7 +52,7 @@
^- tank
=/ ego (scot %p our)
=/ wen (scot %da now)
=+ .^(=cass %cw /[ego]/[syd]/[wen])
=+ .^(=cass %cw /[ego]/[syd]/[wen])
Copy link
Contributor

Choose a reason for hiding this comment

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

trailing whitespace

@@ -108,6 +111,64 @@
leaf/"kids desk: {?~(sink <~> ?~(kid.u.sink <~> <u.kid.u.sink>))}"
leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}"
==

++ report-vat-short
|= $: $: tyr=rock:tire =cone sor=(map desk [ship desk])
Copy link
Contributor

Choose a reason for hiding this comment

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

style: I'd put each of these on their own line, like this:

$:  tyr=rock:tire
    =cone
    sor=(map desk [ship desk])
    zyn=(map [desk ship desk] sync-state)
==

Copy link
Contributor

@belisarius222 belisarius222 Mar 15, 2023

Choose a reason for hiding this comment

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

Sometimes when making a large noun, such as an Arvo move, we will have multiple entries in a :* on the same line, but the standard for $: is to put each item on its own line.

|= syd=desk
=/ deskstatus .^(rock:tire:clay %cx /(scot %p our)//(scot %da now)/tire)
=(%live -:(~(got by deskstatus) syd))
=/ prep (report-prep our now)
Copy link
Contributor

Choose a reason for hiding this comment

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

The code starting here seems to be repeated in all of these new functions. The "options" field just selects a set of desks, so I think this would be cleaner if reporting on a set of desks was factored separately from using the option to determine that set of desks. I would also rename "options" to "filter", since it's more specific -- it filters the set of desks.

^- tang
=/ desks .^((set desk) %cd /(scot %p our)/base/(scot %da now)) ::preps desk variable, set of desks, scries clay for desks
=. desks
%- silt
Copy link
Contributor

Choose a reason for hiding this comment

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

second argument to a =. should be indented

=. desks
%- silt
%+ skim
~(tap in desks)
Copy link
Contributor

Choose a reason for hiding this comment

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

second argument to a %+ should be indented

@hoclun-rigsep hoclun-rigsep mentioned this pull request Mar 15, 2023
@elizasviel
Copy link
Author

Implemented all the changes @belisarius222

@jalehman jalehman closed this Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

+vats is hard to use
3 participants