Make conns and directions read-only after creation; replace makefile with build script
parent
7fb0e91f96
commit
854580be14
14
Makefile
14
Makefile
|
@ -1,14 +0,0 @@
|
||||||
LISP ?= sbcl
|
|
||||||
|
|
||||||
default: build
|
|
||||||
|
|
||||||
# https://lispcookbook.github.io/cl-cookbook/scripting.html
|
|
||||||
build:
|
|
||||||
$(LISP) --eval '(require :asdf)' \
|
|
||||||
--eval '(load "ywatds.asd")' \
|
|
||||||
--eval '(asdf:load-system "ywatds")' \
|
|
||||||
--eval '(asdf:make :ywatds)' \
|
|
||||||
--eval '(quit)'
|
|
||||||
|
|
||||||
clean:
|
|
||||||
-rm ywatds *~ *.backup API.md
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
(require :asdf)
|
||||||
|
(load "ywatds.asd")
|
||||||
|
(asdf:load-system :ywatds)
|
||||||
|
(asdf:make :ywatds)
|
||||||
|
(quit)
|
|
@ -4,8 +4,8 @@
|
||||||
(defparameter *conns-shared* nil)
|
(defparameter *conns-shared* nil)
|
||||||
|
|
||||||
(defstruct trackside
|
(defstruct trackside
|
||||||
(:pos (error "no coordinates specified") :type aux:v3d)
|
(:pos (error "no coordinates specified") :type aux:v3d :read-only t)
|
||||||
(:side (error "no side specified") :type (integer 0 15)))
|
(:side (error "no side specified") :type (integer 0 15) :read-only t))
|
||||||
|
|
||||||
(defmacro trackside (pos side)
|
(defmacro trackside (pos side)
|
||||||
(alexandria:once-only
|
(alexandria:once-only
|
||||||
|
@ -22,8 +22,8 @@
|
||||||
(json:encode-json (list (cons "p" p) (cons "s" side)))))
|
(json:encode-json (list (cons "p" p) (cons "s" side)))))
|
||||||
|
|
||||||
(defstruct dir
|
(defstruct dir
|
||||||
(:c 0 :type (integer 0 15))
|
(:c 0 :type (integer 0 15) :read-only t)
|
||||||
(:r 0 :type (integer 0 1)))
|
(:r 0 :type (integer 0 1) :read-only t))
|
||||||
|
|
||||||
(defmethod print-object ((obj dir) s)
|
(defmethod print-object ((obj dir) s)
|
||||||
(print-unreadable-object (obj s)
|
(print-unreadable-object (obj s)
|
||||||
|
|
Loading…
Reference in New Issue