]> asedeno.scripts.mit.edu Git - cl-protobufs.git/blobdiff - utilities.lisp
define-proto: refactor DEFINE-EXTEND
[cl-protobufs.git] / utilities.lisp
index 0cc04959d4a9fffc13cfd95a8bb9a83d536c7e59..d524371058ec9b1d5901e7fa749bdbbd701eda01 100644 (file)
            ,@body)))))
 
 
+(defmacro appendf (place tail)
+  "Append 'tail' to the list given by 'place', then set the place to the new list."
+  `(setf ,place (append ,place ,tail)))
+
+
 ;;; Functional programming, please
 
 (defun curry (function &rest args)
 
 ;; Type expansion
 (defun type-expand (type)
+  #+(or abcl xcl) (system::expand-deftype type)
   #+allegro (excl:normalize-type type :default type)
   #+ccl (ccl::type-expand type)
   #+clisp (ext:type-expand type)
   #+cmu (kernel:type-expand type)
+  #+(or ecl mkcl) (si::expand-deftype type)
   #+lispworks (type:expand-user-type type)
   #+sbcl (sb-ext:typexpand type)
-  #-(or allegro ccl clisp cmu lispworks sbcl) type)
+  #-(or abcl allegro ccl clisp cmu ecl lispworks mkcl sbcl xcl) type)
+
 
 ;;; Code generation utilities
 
-(defvar *proto-name-separators* '(#\- #\_ #\/ #\space))
-(defvar *camel-case-field-names* nil)
+(defparameter *proto-name-separators* '(#\- #\_ #\/ #\space))
+(defparameter *camel-case-field-names* nil)
 
 (defun find-proto-package (name)
   "A very fuzzy definition of 'find-package'."