Jock Documentation
  • Introduction to Jock
  • Getting Started
  • Language Basics
  • Operators and Expressions
  • Functions
  • Control Flow
  • Data Structures
  • Classes and Objects
  • Compiler
  • Hoon Interface
  • Nock Interface
  • Language Reference
    • ASCII
  • Tutorial
Powered by GitBook
On this page
Export as PDF

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 |_

PreviousNock InterfaceNextASCII

Last updated 28 days ago