story: generators: add check for invalid case

This commit is contained in:
Yaseen 2022-02-18 22:30:24 -05:00
parent c02f59818e
commit a149dc6c40
3 changed files with 6 additions and 3 deletions

View File

@ -15,7 +15,9 @@
:: leaning towards no, and potentially even making the case non-optional
=/ our p.bec
=? cas =(*case cas) r.bec :: use case from beak if cas not provided
:: TODO case existence check
?: !.^(? %cs /(scot %cs /(scot %p our)/[desk]/(scot cas)/case))
~& >> "Error: invalid case {<cas>} provided"
helm-pass+[%d %noop ~]
=/ tak
?: ?=([%tako tako:clay] cas)
p.cas

View File

@ -13,7 +13,9 @@
?: !(~(has in .^((set ^desk) %cd /(scot %p our)/$/(scot %da now))) desk)
~& >> "Error: desk {<desk>} does not exist."
helm-pass+[%d %noop ~]
:: TODO case existence check
?: !.^(? %cs /(scot %cs /(scot %p our)/[desk]/(scot cas)/case))
~& >> "Error: invalid case {<cas>} provided"
helm-pass+[%d %noop ~]
=/ tak
?: ?=([%tako tako:clay] cas)
p.cas

View File

@ -11,7 +11,6 @@
:: 0 \ b = 0 :: anything in 0 but not in b is by definition 0
::
?: =(~ a) ~
~& a
:: uno := (a-b) + (merged items in both a and b) + (b-a)
:: ret := (a-b) + (merged items in both a and b)
:: ret = (~(int by a) uno) :: preserve only the entries whose keys are in a