; This is an "x" version of Lisp's read-eval-print loop.  When the function
; read-xeval-print-loop is run, it will interactively input sexpr's from the
; terminal and hand them over to xeval.  Note that alist is defined as a prog
; var, that is sent automatically as a parameter to xeval.  Note further that
; the environment component of the alist is initialized with the built-in
; atomic types (int, etc) and the built-in datatype operations (index, etc),
; using the preload-built-ins function, q.v.
;
(load "preload-built-ins.l")

(defun read-xeval-print-loop ()
  (prog (alist result)
    (setq alist (preload-built-ins))
    loop
	(princ "X>")
	(setq result (xeval (read) alist))
	(cond ( (eq (car result) ':q)
		(return 'Bye) )
	)
	(princ (car result))
	(setq alist (cadr result))
	(terpri)(terpri)
	(go loop)
  )
)