]> git.earman.xyz Git - lisp/workenv.git/commitdiff
Set up for use as a package, get rid of defalias calls
authorrearman <rearman@r717.net>
Fri, 12 Sep 2025 18:44:50 +0000 (14:44 -0400)
committerrearman <rearman@r717.net>
Fri, 12 Sep 2025 18:44:50 +0000 (14:44 -0400)
electrical.lisp
math.lisp
package.lisp [new file with mode: 0644]
plc.lisp
refrigeration.lisp
unit-conv.lisp
work-env.asd [new file with mode: 0644]

index a25cee755c45523806620c7ee333448afb05236b..c3f9474bc86963fc480c14bc5f311777a7774a33 100644 (file)
@@ -1,3 +1,7 @@
+;;;; electrical.lisp
+
+(in-package #:work-env)
+
 (defun eff-imp (r1 r2) (/ (+ (inv r1) (inv r2))))
 
 (defun amps->volts (amps imp) (* amps imp))
index 4ac87942988cc245162595172182bca8e2d4cc52..31f2ded6fa575a85bdc804c4c80d2bd8b735cd69 100644 (file)
--- a/math.lisp
+++ b/math.lisp
@@ -1,4 +1,8 @@
-(defalias ^ expt)
+;;;; math.lisp
+
+(in-package #:work-env)
+
+(setf (fdefinition '^) #'expt)
 
 (defmacro square (x) `(^ ,x 2))
 
diff --git a/package.lisp b/package.lisp
new file mode 100644 (file)
index 0000000..bdd4675
--- /dev/null
@@ -0,0 +1,4 @@
+;;;; package.lisp
+
+(defpackage #:work-env
+  (:use #:cl))
index 344b44ecae4c5d5ce45c7202a3e348e8dde13906..9434c4121919a8d5170417546a3228e2ed710e77 100644 (file)
--- a/plc.lisp
+++ b/plc.lisp
@@ -1,3 +1,7 @@
+;;;; plc.lisp
+
+(in-package #:work-env)
+
 (defparameter *volt-max* 10.0)
 (defparameter *resolution* 16)
 (defparameter *impedance* 249)
@@ -5,10 +9,10 @@
 (defun 13-bit! () (setq *resolution* 13 *volt-max* 10.0))
 (defun 16-bit! () (setq *resolution* 16 *volt-max* 10.0))
 
-(defalias p3k! 16-bit!)
-(defalias slc! 16-bit!)
-(defalias p1k! 13-bit!)
-(defalias dl4! 13-bit!)
+(setf (fdefinition 'p3k!) #'16-bit!)
+(setf (fdefinition 'slc!) #'16-bit!)
+(setf (fdefinition 'p1k!) #'13-bit!)
+(setf (fdefinition 'dl4!) #'13-bit!)
 
 (defun max-counts (resolution) (- (^ 2 resolution) 1))
 
index ac025e2eb542cdd488f5b0c019a06b7352ed62a7..105a4e5efc8488fbd3e2db47a2eb9543e2a150c1 100644 (file)
@@ -1,3 +1,7 @@
+;;;; refrigeration.lisp
+
+(in-package #:work-env)
+
 (defun cfm-circ (fpm radius) (float (* pi fpm (square (/ radius 12)))))
 
 (defun cfm-rect (fpm width height)
index 76bfa1d1da4cb8fb84d5f64aad471c5d2da66d13..87ee6797b247128edc5078ce8d5e4b1c1cc5c436 100644 (file)
@@ -1,3 +1,7 @@
+;;;; unit-conv.lisp
+
+(in-package #:work-env)
+
 (defun mm->in (mm) (/ mm 25.4))
 
 (defun in->mm (in) (* in 25.4))
diff --git a/work-env.asd b/work-env.asd
new file mode 100644 (file)
index 0000000..0ee1650
--- /dev/null
@@ -0,0 +1,18 @@
+;;;; work-env.asd
+
+(asdf:defsystem #:work-env
+  :description
+  "Typical work environment for a Controls Engineer"
+  :author
+  "Rush Earman IV"
+  :version
+  "0.0.1"
+  :serial
+  t
+  :components
+  ((:file "package")
+   (:file "math")
+   (:file "unit-conv")
+   (:file "electrical")
+   (:file "plc")
+   (:file "refrigeration")))