Language Reference

Keywords

Jock currently supports the following keywords:

  • let: variable assignment / Hoon =/ , C variable declaration

  • if: boolean decision / Hoon ?:

  • else: boolean decision, other branch

  • crash: end program / Hoon !!, C exit

  • assert: positive assertion / Hoon ?>

  • object: core with named arms / Hoon |%

  • loop: loop start point, similar to C do/ Hoon |-

  • defer: unexecuted closure (Hoon trap |.// Lisp quote)

  • recur: loop recursion point, similar to continue / Hoon %= $

  • match: Hoon-styleswitch over type with _ as default case / ?+/?-

  • switch, C-style switch over value with _ as default case / Hoon nested ?:

  • eval: evaluate raw Nock / Hoon .*

  • compose: compose subjects / Hoon =>

  • with: indicates predicate for compose

  • this: ., the current subject / Hoon .

  • func function creation / Hoon |=

  • lambda inline anonymous function closure creation / Hoon |=

  • class class/core creation with methods / Hoon |_

  • print show literal as a side effect / Hoon ~&, +slog

Last updated