July 7th 2026 - Things I Worked On

Added for and foreach loops to Hith

(for i 0 (< i 10) (setq i (+ i 1))
     (setq total (+ total i)))

(foreach item (list 1 2 3)
         (setq total (+ total item)))

Added making symbols and generating usused symbols

(make-symbol "x")
;; => x

(gensym)
;; => #:G1

Added t and nil to Hith

nil
t

Added cond to Hith

(defun check-value (x)
  (cond
    ((< x 0)   "X is negative")
    ((eq x 0)  "X is zero")
    ((eq x 1)  "X is exactly one")
    (t         "X is something else (default case)")))

(check-value -1)
;; => "X is negative"

(check-value 0)
;; => "X is zero"

(check-value 1)
;; => "X is exactly one"

(check-value 10)
;; => "X is something else (default case)"

Turned while into a macro in Hith

Uses recursion to loop.

(defmacro while (condition &rest body)
  (setq cond-fn (gensym))
  (setq loop-fn (gensym))
  `(progn
     (defun ,cond-fn () ,condition)
     (defun ,loop-fn ()
       (if (,cond-fn)
           (progn
             ,@body
             (,loop-fn))))
     (,loop-fn)))