-
Notifications
You must be signed in to change notification settings - Fork 57
fixes the macro expansion of $> and $< specs #1176
Conversation
These specs have some limitations that should be called out explicitly. Most notably, some of them are not directly bunt-able:
This "intuitively" follows from that fact that specs are not available at runtime, but the user-experience is less than intuitive. The ability-to-bunt can be restored (in a frustratingly-explicit nanner) with
As I mentioned, I think the right way to use these specs is in building up a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ha not surprised that I f*ed this up.
Yes these are very useful for dynamic checks of static properties we can’t statically check.
They should be applied to containers as well — more urgent. Also to a layer of managed string types. No one should be able to send you a misordered set or a dodgy string over the network.
…Sent from my iPhone
On May 24, 2019, at 2:36 PM, Joe Bryan ***@***.***> wrote:
The expansions of $> and $< were infinitely recursive. These are new specs for building molds from parts of other $% molds. They are ?>-style assertions against the head of the noun being cast or nest-checked. For example:
> `task:able:ames`[%west ~zod /foo 1]
[%west p=~zod q=/foo r=1]
>
> `$>(%west task:able:ames)`[%west ~zod /foo 1]
[%west p=~zod q=/foo r=1]
>
> `$<(%west task:able:ames)`[%west ~zod /foo 1]
nest-fail
I think it would be very helpful to use these specs when building the +note and +sign molds for vanes, which are obviously subtypes of the +task and +gift types of the other vanes in the system. If there's interest, I'd be happy to do so now.
You can view, comment on, or merge this pull request online at:
#1176
Commit Summary
fixes the macro expansion of $> and $< specs
File Changes
M sys/hoon.hoon (4)
Patch Links:
https://github.com/urbit/arvo/pull/1176.patch
https://github.com/urbit/arvo/pull/1176.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I think
For example:
|
There is also a way to fix this...
…Sent from my iPhone
On May 24, 2019, at 3:28 PM, Joe Bryan ***@***.***> wrote:
These specs have some limitations that should be called out explicitly. Most notably, some of them are not directly bunt-able:
> *$<(%west task:able:ames)
[%want p=~zod q=/ r=0]
> *$>(%west task:able:ames)
ford: %ride failed to execute:
This "intuitively" follows from that fact that specs are not available at runtime, but the user-experience is less than intuitive. The ability-to-bunt can be restored (in a frustratingly-explicit nanner) with $~:
> *$~([%west ~zod / 0] $>(%west task:able:ames))
[%west p=~zod q=/ r=0]
As I mentioned, I think the right way to use these specs is in building up a $% that references other specs, like +note and +sign in the vanes. The whole $% should be wrapped in a single $~ to ensure that it bunts, but the individual "pages" of the tagged-union "book" need not be bunt-able.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Ha ha of course, wrong rune pair.
…Sent from my iPhone
On May 24, 2019, at 4:09 PM, Joe Bryan ***@***.***> wrote:
I think $| is the key for dynamic checks. +map should be something like:
+* map [key value]
$| (tree (pair @ @))
|=(a=(tree (pair @ @)) ~(apt by a))
For example:
($|((tree (pair @ @)) |=((tree (pair @ @)) ~(apt by +<))) [[1 2] ~ [[3 4] ~ ~]])
{[p=1 q=2] [p=3 q=4]}
($|((tree (pair @ @)) |=((tree (pair @ @)) ~(apt by +<))) [[1 2] [[3 4] ~ ~] ~])
ford: %ride failed to execute:
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh, very nice. I would like to see the vanes moved to this style soon.
The expansions of
$>
and$<
were infinitely recursive. These are new specs for building molds from parts of other$%
molds. They are?>
-style assertions against the head of the noun being cast or nest-checked. For example:I think it would be very helpful to use these specs when building the
+note
and+sign
molds for vanes, which are obviously subtypes of the+task
and+gift
types of the other vanes in the system. If there's interest, I'd be happy to do so now.