mallus-fabres / cue

0 stars 0 forks source link

fix for list type issues here #1

Closed dr-frmr closed 2 years ago

dr-frmr commented 2 years ago

https://github.com/mallus-fabres/cue/blob/1f58ba44506e31505ee2d1f85b0f31e7a2ba1a5b/app/cue.hoon#L123-L130 can do something like this:

=/  rng  ~(. og eny)                      :: random number generator
=/  unread=(list [key=@ item])
  %+  murn  (tap:i-orm items)
  |=  [k=@ =item]
  ?.(done.item ~ `[k item]) :: list of unread items
=/  val  (rad:rng (lent unread))          :: gets a random number between 0 and the length of the list generated on the next line
=/  randomitem=[@ item]  (snag val unread)
:^  ~  ~  %cue-update
!>  ^-  update
[now %cue [randomitem ~]]

you can more easily identify where these issues stem from by assigning types to your faces, like I'm doing here: =/ unread=(list [key=@ item])

dr-frmr commented 2 years ago

also recommend adding desk.bill and sys.kelvin files to this repo, also, breaking those huge murn statements into multiple lines with tall form.