about summary refs log tree commit diff stats
path: root/btech.lsp
diff options
context:
space:
mode:
authorDarren Bane <dbane@tilde.institute>2022-01-07 11:49:16 +0000
committerDarren Bane <dbane@tilde.institute>2022-01-07 11:49:16 +0000
commit3f26f5eeaeb94fc05db3b7f19982ed5eb4104c2d (patch)
treeab8371d04fe30c2812ba5f28e3ea4bc22e644818 /btech.lsp
parent1942ee886453a3650666c9c731dcc3f64a798db1 (diff)
parentccb2aac02c83a057f9a22d59e6fbaecf25709073 (diff)
downloadlsp-3f26f5eeaeb94fc05db3b7f19982ed5eb4104c2d.tar.gz
Merge branch 'master' of /home/dbane/public_repos/lsp into master
Diffstat (limited to 'btech.lsp')
-rwxr-xr-xbtech.lsp45
1 files changed, 18 insertions, 27 deletions
diff --git a/btech.lsp b/btech.lsp
index 5a4d11b..07b0d48 100755
--- a/btech.lsp
+++ b/btech.lsp
@@ -1,27 +1,18 @@
-#!/home/dbane/openlisp-10.9.0/uxlisp -shell
-;;; ISLisp is fine so long as you do "read-line" from the same place you call the entry point fun.
-;;; So -shell with an immediate call doesn't work, something is closed after reading the Lisp source.
-;;; -shell -keep, supplying the call from the keyboard works fine.
-;;;
-;;; Calling entry point from a Lisp CLI (after "load") also works.
-;;; And this may be what I end up with, if I'm doing a view in Emacs.
-(require "cmd")
-(require "builtins")
-(defpackage #:btech
-  (:use #:cmd #:builtins)
-  (:export
-    #:main))
-(in-package #:btech)
-;; Favour symbols & objects over C-like numbers
-(defconstant +cmds+ (list
-                      (create-tab #'bt-quit "QUIT" 1)
-                      (create-tab #'help "help" 2)
-                      (create-tab #'look "look" 2)))
-(defun main ()
-  (read-line)                           ; Throw away LF
-  (format (standard-output) "> ")
-  (let* ((tab (lookup (parse (read-line)) +cmds+))
-          (f (fun tab)))
-    (funcall f)))                       ; I *think* this is better than (flet ...
-(provide "btech")
-(main)
+(defclass <unit> () ((name :initarg n :reader name)
+                     (tp :initarg tp :reader tp)
+                     (pv :initarg p :reader pv)))
+(defconstant +mad-3r+ (create (class <unit>)
+                              'n 'marauder
+                              'tp 'bm
+                              'p 42
+                              'sz 3
+                              'tmm 1
+                              'mv 8
+                              'role 'sniper
+                              'skill 3
+                              'damage #(2 3 3)
+                              'ov 1
+                              'a 0
+                              's 0
+                              'crit
+                              'id))