Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

15
Task/JSON/Hoon/json.hoon Normal file
View file

@ -0,0 +1,15 @@
:- %say
|= [^ [in=@tas ~] ~]
:- %noun
=+ obj=(need (poja in)) :: try parse to json
=+ typ=$:(name=@tas age=@ud) :: datastructure
=+ spec=(ot name/so age/ni ~):jo :: parsing spec
?. ?=([%o *] obj) :: isnt an object?
~
=+ ^= o
%. %. (spec obj) :: parse with spec
need :: panic if failed
,typ :: cast to type
=. age.o +(age.o) :: increment its age...
%: crip %: pojo :: pretty-print result
(jobe [%name s/name.o] [%age n/(crip <age.o>)] ~) :: convert back to json