   realize-stream-head.
 
   This is useful for defining recursive goals."
-  [g]
+  [goal]
   `(fn delayed-goal-outer [state#]
-     (fn delayed-goal-inner [] (~g state#))))
+     (fn delayed-goal-inner [] (~goal state#))))
 
 (defmacro ldisj+
   "Extended version of the `ldisj` function. This one handles multiple


(defn ldisj
  "Logical disjuction ('or'). Construct a new goal that succeeds
  whenever *g1* or *g2* succeed. `merge-streams` is used on each
  goal's output to ensure fair scheduling between the two."
  [g1 g2]
  (fn disj-goal [state]
    (merge-streams (g1 state) (g2 state))))

(defn lconj
  "Logical conjunction ('and'). Construct a new goal that succeeds
  when both *g1* and *g2* succeed."
  [g1 g2]
  (fn conj-goal [state]
    (mapcat-stream (g1 state) g2)))





(defmacro fresh
  "Provide a more convenient syntax for `call-fresh`. `fresh` lets you
  declare multiple logic variables at once, and it takes care of the
  function declaration mechanics for you.

  The body of fresh is passed to `lconj+`, a logical 'and'.
