From 01a6b8a16a7c23f729d35ccad7213efb752f1910 Mon Sep 17 00:00:00 2001 From: fang Date: Wed, 6 Jul 2022 16:33:28 +0200 Subject: [PATCH] hoon: improve $pith pattern mode syntax Produce the correct type, support the ~ element, allow specifying an open-ended type. --- pkg/arvo/sys/hoon.hoon | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 2d279b23b..2158a5acb 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -13132,15 +13132,23 @@ ;~ pose :: /name=@aura :: - %+ stag %bcts - ;~ plug sym - ;~ pfix tis pat - (stag %base (stag %atom mota)) - == == + %+ cook + |= [=term =aura] + ^- spec + :+ %bccl + [%leaf %tas aura] + [%bcts term [%base %atom aura]]~ + ;~(plug sym ;~(pfix tis pat mota)) + :: :: /constant :: - (stag %leaf (stag %tas sym)) + (stag %leaf (stag %tas ;~(pose sym (cold %$ buc)))) == + :: + :: /~ + :: + :- '~' + (cold [%bccl [%leaf %tas %n] [%base %null] ~] sig) == :: ;~ pose