diff options
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/ifa.tl | 13 | ||||
-rw-r--r-- | share/txr/stdlib/package.tl | 13 | ||||
-rw-r--r-- | share/txr/stdlib/struct.tl | 15 |
3 files changed, 19 insertions, 22 deletions
diff --git a/share/txr/stdlib/ifa.tl b/share/txr/stdlib/ifa.tl index 36ae2ae7..253f2688 100644 --- a/share/txr/stdlib/ifa.tl +++ b/share/txr/stdlib/ifa.tl @@ -69,13 +69,12 @@ (defmacro whena (test . body) ^(ifa ,test (progn ,*body))) -(macro-time - (defun sys:if-to-cond (if-oper cond-oper pairs) - (tree-case pairs - (((test . forms) . rest) ^(,if-oper ,test (progn ,*forms) - (,cond-oper ,*rest))) - (() ()) - (else (throwf 'eval-error "~s: bad syntax: ~s" cond-oper pairs))))) +(defun sys:if-to-cond (if-oper cond-oper pairs) + (tree-case pairs + (((test . forms) . rest) ^(,if-oper ,test (progn ,*forms) + (,cond-oper ,*rest))) + (() ()) + (else (throwf 'eval-error "~s: bad syntax: ~s" cond-oper pairs)))) (defmacro conda (. pairs) (sys:if-to-cond 'ifa 'conda pairs)) diff --git a/share/txr/stdlib/package.tl b/share/txr/stdlib/package.tl index 7e744a66..1360cb29 100644 --- a/share/txr/stdlib/package.tl +++ b/share/txr/stdlib/package.tl @@ -24,13 +24,12 @@ ;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -(macro-time - (defun sys:name-str (kind sym-or-string) - (cond - ((symbolp sym-or-string) (symbol-name sym-or-string)) - ((stringp sym-or-string) sym-or-string) - (t (throw 'eval-error "~s: ~s isn't a valid ~a name" - 'defpackage sym-or-string kind))))) +(defun sys:name-str (kind sym-or-string) + (cond + ((symbolp sym-or-string) (symbol-name sym-or-string)) + ((stringp sym-or-string) sym-or-string) + (t (throw 'eval-error "~s: ~s isn't a valid ~a name" + 'defpackage sym-or-string kind)))) (defmacro defpackage (name . clauses) (let* ((pkg (gensym "pkg-")) diff --git a/share/txr/stdlib/struct.tl b/share/txr/stdlib/struct.tl index 1ad96d06..c02f3d30 100644 --- a/share/txr/stdlib/struct.tl +++ b/share/txr/stdlib/struct.tl @@ -24,15 +24,14 @@ ;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -(macro-time - (defun sys:bad-slot-syntax (form arg) - (compile-error form "bad slot syntax ~s" arg)) +(defun sys:bad-slot-syntax (form arg) + (compile-error form "bad slot syntax ~s" arg)) - (defun sys:prune-missing-inits (slot-init-forms) - (remove-if (tb ((kind name : (init-form nil init-form-present))) - (and (member kind '(:static :instance :function)) - (not init-form-present))) - slot-init-forms))) +(defun sys:prune-missing-inits (slot-init-forms) + (remove-if (tb ((kind name : (init-form nil init-form-present))) + (and (member kind '(:static :instance :function)) + (not init-form-present))) + slot-init-forms)) (defmacro defstruct (:form form name-spec super . slot-specs) (tree-bind (name args) (tree-case name-spec |