Download core/eval-loop.lisp from Snapkitty/nekomata: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/Snapkitty/nekomata/resolve/main/core/eval-loop.lisp
- Command line
-
hf download hf://Snapkitty/nekomata/core/eval-loop.lisp
-
curl -L -o eval-loop.lisp https://huggingface.co/Snapkitty/nekomata/resolve/main/core/eval-loop.lisp
1.05 kB
| (in-package #:nekod) | |
| ;; The Nekomata eval loop — infrastructure as a read-eval-print loop | |
| (defun nekod-eval (form) | |
| "Evaluate an infrastructure form. Returns the result." | |
| (typecase form | |
| (container-spec form) ; Already a spec, return as-is | |
| (symbol (if (boundp form) (symbol-value form) form)) | |
| (cons | |
| (case (car form) | |
| (define-container (eval form)) | |
| (with-failover (eval form)) | |
| (t (eval form)))) | |
| (t form))) | |
| (defun nekod-repl () | |
| "Interactive REPL for Nekomata infrastructure management." | |
| (format t "~&Nekomata ~a~%Type :quit to exit.~%nekod> " "0.1.0") | |
| (finish-output) | |
| (loop | |
| (let ((form (read *standard-input* nil :eof))) | |
| (when (eq form :eof) (return)) | |
| (when (eq form :quit) (return)) | |
| (handler-case | |
| (let ((result (nekod-eval form))) | |
| (format t "~&=> ~s~%nekod> " result) | |
| (finish-output)) | |
| (nekomata-error (e) | |
| (format t "~&Error: ~a~%nekod> " (error-message e)) | |
| (finish-output)))))) | |