a8b03be59283

Support :conc-name nil and fix clampf
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Mon, 07 Jan 2019 18:28:22 -0500
parents 6b2d21a74a45
children 957d61081ff7
branches/tags (none)
files src/clos.lisp src/eldritch-horrors.lisp src/mutation.lisp

Changes

--- a/src/clos.lisp	Sun Dec 16 18:26:55 2018 -0500
+++ b/src/clos.lisp	Mon Jan 07 18:28:22 2019 -0500
@@ -5,7 +5,9 @@
                             (type nil type?)
                             (documentation nil documentation?)
                             (initform nil initform?)
-                            (accessor (symb conc-name name))
+                            (accessor (if conc-name
+                                        (symb conc-name name)
+                                        name))
                             (initarg (ensure-keyword name)))
       (ensure-list slot-spec)
     `(,name
--- a/src/eldritch-horrors.lisp	Sun Dec 16 18:26:55 2018 -0500
+++ b/src/eldritch-horrors.lisp	Mon Jan 07 18:28:22 2019 -0500
@@ -49,7 +49,7 @@
   (destructuring-bind (type &key (conc-name (symb type '-)))
       (ensure-list type-and-options)
     (let* ((accessors (loop :for slot :in slots
-                            :collect (symb conc-name slot)))
+                            :collect (if conc-name (symb conc-name slot) slot)))
            (symbol-args (loop :for slot :in slots
                               :collect (symb slot '-symbol)))
            (macro-name (symb 'with- type))
--- a/src/mutation.lisp	Sun Dec 16 18:26:55 2018 -0500
+++ b/src/mutation.lisp	Mon Jan 07 18:28:22 2019 -0500
@@ -50,7 +50,7 @@
 (define-modify-macro remainderf (divisor) rem
   "Remainder `place` by `divisor` in-place.")
 
-(define-modify-macro clampf (from to) clamp
+(define-modify-macro clampf (from to) losh.math:clamp
   "Clamp `place` between `from` and `to` in-place.")
 
 (define-modify-macro negatef () -