about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDarren Bane <darren.bane@gmail.com>2021-01-26 22:01:42 +0000
committerDarren Bane <darren.bane@gmail.com>2021-01-26 22:01:42 +0000
commit6d6911084595fe755311b875753295beba71c1c8 (patch)
treedb227363247b1e2b01e3bb24d43774bd4e3071b3
parent92de5365b2d521da510614f4910bf4926d260b20 (diff)
downloadlsp-6d6911084595fe755311b875753295beba71c1c8.tar.gz
Switching computers for a while
-rw-r--r--clex.lisp2
-rwxr-xr-xdoc/macros.ms115
-rw-r--r--loot.lsp92
3 files changed, 83 insertions, 126 deletions
diff --git a/clex.lisp b/clex.lisp
index 7ca04f0..25d86d4 100644
--- a/clex.lisp
+++ b/clex.lisp
@@ -79,5 +79,5 @@
 		 ((member c '(#\< #\>))
 		  (forward cl)
 		  
-  )
+  ))))))
 (provide "clex")
diff --git a/doc/macros.ms b/doc/macros.ms
deleted file mode 100755
index e95e98b..0000000
--- a/doc/macros.ms
+++ /dev/null
@@ -1,115 +0,0 @@
-.de F1
-.nr OI \\n(.iu
-.nr PW 1v
-.KF
-.sp 0.3v
-..
-.de T1
-.F1
-..
-.de F2
-.ds Fp Figure\ \\n(Fi
-.ds Fn Figure\ \\n+(Fi
-.ds Fq \\*(Fp
-.F0
-..
-.de T2
-.ds Tp Table\ \\n(Ti
-.ds Tn Table\ \\n+(Ti
-.ds Tq \\*(Tp
-.T0
-..
-.de F0
-.nr BD 1
-.if t .ps \\n(PS-1
-.ie \\n(VS>=41 .vs \\n(VSu-1p
-.el .vs \\n(VSp-1p
-.ft 1
-.di DD
-.ll \\n(.lu*3u/4u
-.in 0
-.fi
-.ad b
-.sp 0.5v
-\f3\\*(Fq\f1\ \ \c
-..
-.de T0
-.nr BD 1
-.if t .ps \\n(PS-1
-.ie \\n(VS>=41 .vs \\n(VSu-1p
-.el .vs \\n(VSp-1p
-.ft 1
-.di DD
-.ll \\n(.lu*3u/4u
-.in 0
-.fi
-.ad b
-.sp 0.5v
-\f3\\*(Tq\f1\ \ \c
-..
-.de F3
-.sp 0.5v
-.di
-.br
-.ll \\n(.lu*4u/3u
-.if \\n(dl>\\n(BD .nr BD \\n(dl
-.if \\n(BD<\\n(.l .in (\\n(.lu-\\n(BDu)/2u
-.nf
-.DD
-.in \\n(OIu
-.nr BD 0
-.fi
-.KE
-.ie \\n(VS>=41 .vs \\n(VSu
-.el .vs \\n(VSp
-..
-.de T3
-.F3
-..
-.de EX
-.\" P1
-.DS L
-.ft CW
-\s-4
-..
-.de EE
-\s+4
-.\" P2
-.ft
-.DE
-..
-.nr Fi 1 +1
-.nr Ti 1 +1
-.ds Fn Figure\ \\n(Fi
-.ds Tn Table\ \\n(Ti
-.nr XP 2	\" delta point size for program
-.nr XV 2p	\" delta vertical for programs
-.nr XT 4	\" delta tab stop for programs
-.nr DV .5v	\" space before start of program
-.\" FP lucidasans
-.nr PS 11
-.nr VS 13
-.\" nr LL 6.6i
-.\" nr PI 0	\" paragraph indent
-.nr PD 4p	\" extra space between paragraphs
-.\" pl 11i
-.rm CH
-.de L=
-.ie '\\$1'sec' .NH \\$2
-.el .ie '\\$1'table' .if !'\\$3'*' \{
-.DS C
-Table '\\$3' about here
-.DE
-\}
-.el .if '\\$1'fig' .if !'\\$3'*' \{
-.DS C
-Figure '\\$3' about here
-.DE
-\}
-..
-.de R1
-.ig R2
-..
-.\"
-.\" groff-specific:
-.ds FAM H
diff --git a/loot.lsp b/loot.lsp
index 727f8f3..857c7af 100644
--- a/loot.lsp
+++ b/loot.lsp
@@ -1,5 +1,5 @@
 ;;; Port of https://en.wikipedia.org/wiki/ModernPascal#Code_Sample[3].
-;;; And then to CL.
+;;; And then to CL and ISLisp.
 ;;; I prefer my version.
 (defconstant +max-probability+ 1000)
 ;; Because this is a simple enum and not a full sum/product type,
@@ -15,11 +15,7 @@
     (for ((loop 0 (+ loop 1)))
 	((>= (elt (probabilities self) (mod loop 13)) random-value) (elt +loot-type+ (mod loop 13))))))
 (defmethod initialize-object :after ((self <looter>) initargs)
-  (setf (probabilities self) (vector 10 77 105 125 142 159 172 200 201 202 216 282 +max-probability+)))
-(defun as-string (l)
-  ;; Could use assoc here, but this is closer to the original.
-  ;; Also saves translating nil to "".
-  (case l
+  (setf (probabilities self) (vector 10 77 105 125 142 159 172 200 201 202 216 282 +max-probability+  (case l
     ((bloodstone) "Bloodstone")
     ((copper) "Copper")
     ((emeraldite) "Emeraldite")
@@ -34,8 +30,84 @@
     ((iron) "Iron")
     (t "")))
 (defun main ()
-  (let ((loot (create (class <looter>))))
-    (for ((n 0 (+ n 1)))
-	((> n 99))
+  (let ((loot (create (class <looter>)))    (for ((n 0 (+ n 1)))
+
+                                                 	((> n 99))
 	(format (standard-output) "~A~%" (as-string (choose loot))))))
-(main)
+
+
+. /usr/local/plan9/bin/9.rc
+if (test -d /usr/local/bin) {
+	path = (/usr/local/bin $path)
+}
+if (test -d /usr/local/opt/emacs-plus/bin) {
+	path = ($path /usr/local/opt/emacs-plus/bin)
+}
+if (test -d $home/bin) {
+	path = ($path $home/bin)
+}
+if (test -d $home/opt/GNAT/2020/bin) {
+	path = ($home/opt/GNAT/2020/bin $path)
+}
+
+OPENLISP = $home/openlisp-11.0.0
+if (test -d $OPENLISP) {
+	path = ($path $OPENLISP)
+}
+
+# These break some commands like man.
+# Use the new names instead.
+#fn grep { rg $* }
+#fn ls { exa $* }
+#fn find { fd $* }
+#fn cat { bat $* }
+#fn more { bat $* }
+#fn xterm { alacritty $* }
+
+#prompt = ('$ ' '$ ')
+REFER = $home/lsp/doc/refs
+
+if (test -d $home/.cargo/bin) {
+	path = ($home/.cargo/bin $path)
+}
+
+if (test -d /usr/local/opt/tcl-tk/bin) {
+   path = (/usr/local/opt/tcl-tk/bin $path)
+}
+
+if (test -d $home/obnc/usr/local/bin) {
+   path = ($path $home/obnc/usr/local/bin)
+}
+
+if (test -d $home/.emacs.d/bin) {
+   path = ($path $home/.emacs.d/bin)
+}
+fn doom { u doom $* }
+if (test -d /Applications/Emacs.app/Contents/MacOS/bin) {
+   path = ($path /Applications/Emacs.app/Contents/MacOS/bin)
+}
+if (test -f /Applications/Emacs.app/Contents/MacOS/Emacs) {
+   EMACS = /Applications/Emacs.app/Contents/MacOS/Emacs
+   fn emacs { u $EMACS -nw $* }
+}
+if (test -f /Applications/Emacs.app/Contents/MacOS/bin/emacsclient) {
+   fn emacsclient { u /Applications/Emacs.app/Contents/MacOS/bin/emacsclient $* }
+}
+
+LANG = en_IE.UTF-8
+TZ = Europe/Dublin
+LESS_IS_MORE = t
+MORE = '-SEXIER'
+POSIXLY_CORRECT = t
+REFER = $home/lsp/doc/refs
+
+if (test -d $home/context/tex/texmf-osx-64/bin) {
+   path = ($path $home/context/tex/texmf-osx-64/bin)
+}
+
+if (test -d $home/Library/Python/3.8/bin) {
+   path = ($path $home/Library/Python/3.8/bin)
+}
+
+TCLLIBPATH = $home/lib/tklib0.7
+