changelog shortlog graph tags branches files raw help

Mercurial > core / changeset: sk print init, reconcile doc:file-header and skel file headers

changeset 573: f8b76ced5e2d
parent 572: ce91ffc6cc7a
child 574: 9e7d4393eac6
author: Richard Westhaver <ellis@rwest.io>
date: Thu, 01 Aug 2024 21:21:07 -0400
files: lisp/lib/cli/clap/macs.lisp lisp/lib/skel/core/header.lisp lisp/lib/skel/core/pkg.lisp lisp/lib/skel/core/proto.lisp lisp/lib/skel/skel.asd
description: sk print init, reconcile doc:file-header and skel file headers
     1.1--- a/lisp/lib/cli/clap/macs.lisp	Tue Jul 30 21:57:21 2024 -0400
     1.2+++ b/lisp/lib/cli/clap/macs.lisp	Thu Aug 01 21:21:07 2024 -0400
     1.3@@ -22,12 +22,26 @@
     1.4          (sb-ext:enable-debugger)
     1.5          (sb-ext:disable-debugger))
     1.6      (unwind-protect
     1.7-          (handler-case (progn ,@body)
     1.8+          (restart-case
     1.9+              (progn ,@body)
    1.10             (sb-sys:interactive-interrupt ()
    1.11               (println ":SIGINT")
    1.12-              (sb-ext:exit :code 130)))
    1.13+              (sb-ext:exit :code 130))
    1.14+            (abort ()
    1.15+              :report (lambda (s)
    1.16+                        (write-string
    1.17+                         "Skip to toplevel READ/EVAL/PRINT loop."
    1.18+                         s)
    1.19+                        (log:debug! "CONTINUEing from pre-REPL RESTART-CASE")
    1.20+                        (values)))
    1.21+            (exit ()
    1.22+              :report "Exit SBCL (calling #'EXIT, killing the process)."
    1.23+              ;; :test (lambda (c) (declare (ignore c)) t)
    1.24+              (log:debug! "falling through to EXIT from pre-REPL RESTART-CASE")
    1.25+              (exit :code 1))))
    1.26+     (sb-impl::flush-standard-output-streams)
    1.27        ;; reset terminal state
    1.28-       #+nil (.ris))))
    1.29+       #+nil (.ris)))
    1.30 
    1.31 ;; TODO fix these macros
    1.32 (defmacro defcmd (name &body body)
     2.1--- a/lisp/lib/skel/core/header.lisp	Tue Jul 30 21:57:21 2024 -0400
     2.2+++ b/lisp/lib/skel/core/header.lisp	Thu Aug 01 21:21:07 2024 -0400
     2.3@@ -8,14 +8,11 @@
     2.4 ;;; File Headers
     2.5 (deftype file-header-kind () '(member :source :shebang))
     2.6 
     2.7-(declaim (inline %make-file-header))
     2.8-(defstruct (file-header (:constructor %make-file-header)
     2.9-			   (:conc-name sk-fh-))
    2.10-  (kind :source :type file-header-kind)
    2.11-  (str "" :type string))
    2.12+(defclass sk-file-header (file-header)
    2.13+  ((kind :initform :source :type file-header-kind :initarg :kind)))
    2.14 
    2.15-(defun make-file-header (kind string)
    2.16-  (%make-file-header :kind kind :str (or string "")))
    2.17+(defun make-file-header (kind hl)
    2.18+  (make-instance 'sk-file-header :kind kind :headline hl))
    2.19 
    2.20 (defun make-source-file-header (str)
    2.21   (make-file-header :source str))
    2.22@@ -56,7 +53,6 @@
    2.23 (defun extract-source-file-header (str)
    2.24   "Extract a FILE-HEADER from STR, returning two values: the extracted object, and the modified string."
    2.25   (with-input-from-string (s str)
    2.26-
    2.27     (values
    2.28      (make-file-header :source (parse-stream-file-header s))
    2.29      str)))
     3.1--- a/lisp/lib/skel/core/pkg.lisp	Tue Jul 30 21:57:21 2024 -0400
     3.2+++ b/lisp/lib/skel/core/pkg.lisp	Thu Aug 01 21:21:07 2024 -0400
     3.3@@ -31,10 +31,18 @@
     3.4    :sk-find-rule :sk-find-script
     3.5    :sk-find :sk-find*
     3.6    :sk-convert :sk-load-component
     3.7-   :sk-path :sk-path-merge))
     3.8+   :sk-path :sk-path-merge
     3.9+   :sk-install
    3.10+   :sk-test
    3.11+   :sk-deploy
    3.12+   :sk-fetch
    3.13+   :sk-pack
    3.14+   :sk-unpack
    3.15+   :sk-bundle
    3.16+   :sk-unbundle))
    3.17 
    3.18 (defpackage :skel/core/header
    3.19-  (:use :cl :std :skel/core/err)
    3.20+  (:use :cl :std :skel/core/err :doc)
    3.21   (:export
    3.22    :make-file-header 
    3.23    :make-shebang-file-header 
    3.24@@ -99,3 +107,8 @@
    3.25 (defpackage :skel/core/vm
    3.26   (:use :cl :std :skel/core/err)
    3.27   (:export :make-stack-slot :make-sk-vm :sks-ref :sks-pop :sks-push))
    3.28+
    3.29+(defpackage :skel/core/print
    3.30+  (:use :cl :std :skel/core/err :skel/core/obj :skel/core/types :skel/core/proto :skel/core/vars)
    3.31+  (:export
    3.32+   :*sk-print-dispatch-table*))
     4.1--- a/lisp/lib/skel/core/proto.lisp	Tue Jul 30 21:57:21 2024 -0400
     4.2+++ b/lisp/lib/skel/core/proto.lisp	Thu Aug 01 21:21:07 2024 -0400
     4.3@@ -28,6 +28,22 @@
     4.4   (:documentation "Compile object SELF."))
     4.5 (defgeneric sk-build (self &key &allow-other-keys)
     4.6   (:documentation "Build a skel-object."))
     4.7+(defgeneric sk-install (self &key &allow-other-keys)
     4.8+  (:documentation "Install a skel-object."))
     4.9+(defgeneric sk-test (self &key &allow-other-keys)
    4.10+  (:documentation "Test a skel-object."))
    4.11+(defgeneric sk-deploy (self &key &allow-other-keys)
    4.12+  (:documentation "Deploy a skel-object."))
    4.13+(defgeneric sk-fetch (self &key &allow-other-keys)
    4.14+  (:documentation "Fetch a skel-object."))
    4.15+(defgeneric sk-pack (self &key &allow-other-keys)
    4.16+  (:documentation "Pack a skel-object."))
    4.17+(defgeneric sk-unpack (self &key &allow-other-keys)
    4.18+  (:documentation "Unpack a skel-object."))
    4.19+(defgeneric sk-bundle (self &key &allow-other-keys)
    4.20+  (:documentation "Bundle a skel-object."))
    4.21+(defgeneric sk-unbundle (self &key &allow-other-keys)
    4.22+  (:documentation "Unbundle a skel-object."))
    4.23 (defgeneric sk-transform (self other &key &allow-other-keys)
    4.24   (:documentation "Transform SELF to skel-object of type OTHER."))
    4.25 (defgeneric sk-convert (self)
     5.1--- a/lisp/lib/skel/skel.asd	Tue Jul 30 21:57:21 2024 -0400
     5.2+++ b/lisp/lib/skel/skel.asd	Thu Aug 01 21:21:07 2024 -0400
     5.3@@ -23,6 +23,7 @@
     5.4      (:file "header")
     5.5      (:file "vars")
     5.6      (:file "obj")
     5.7+     (:file "print")
     5.8      (:file "util")
     5.9      (:file "vm")))
    5.10    (:module "comp"