Sometimes I think Hoon is one of the only mistakes in Urbit. I hate syntax. On the other hand, unlike other languages, Hoon's syntax in unambiguous and regular, so it's trivial to parse (as if).I'm not smart enough to understand any of this but it looks interesting, haven't seen anything like the programming language either.
I can sort of read it. The terms have been translated to human speak because if I'm calling it core, gate, arm, subject, etc, I get a feeling someone on the forum will find me and put a bomb under my car
1. |= function, receives one parameter, end, of type atom (@) which is a number
2. =/ local parameter count of type atom initialized to 1
3. function body starts
4. I think this is a return type hint. List of numbers
5. Branch. if end == count, nil, else
6 :- construct a cell (like cons in lisp) out of count and
7 $ recur with count bound to count++
If I read this correctly, this builds up a list of numbers from 1 to end.
Translated to Scheme:
(define (foo end) (define (bar count) (if (= count end) '() (cons count (bar (+ 1 count))))) (bar 1)) [email protected](guile-user)> (foo 5) $3 = (1 2 3 4)