Changeset 8640


Ignore:
Timestamp:
02/26/05 17:36:52 (16 years ago)
Author:
piso
Message:

EXPAND-DEFTYPE

Location:
trunk/j/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/autoloads.lisp

    r8635 r8640  
    22;;;
    33;;; Copyright (C) 2003-2005 Peter Graves
    4 ;;; $Id: autoloads.lisp,v 1.178 2005-02-24 18:51:33 piso Exp $
     4;;; $Id: autoloads.lisp,v 1.179 2005-02-26 17:36:52 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    113113(autoload-macro 'check-type)
    114114(autoload-macro 'deftype)
     115(autoload 'expand-deftype "deftype")
    115116(autoload-macro '(defclass defgeneric defmethod define-condition) "clos")
    116117(autoload-macro 'with-standard-io-syntax)
  • trunk/j/src/org/armedbear/lisp/deftype.lisp

    r6834 r8640  
    11;;; deftype.lisp
    22;;;
    3 ;;; Copyright (C) 2004 Peter Graves
    4 ;;; $Id: deftype.lisp,v 1.3 2004-05-19 20:06:09 piso Exp $
     3;;; Copyright (C) 2004-2005 Peter Graves
     4;;; $Id: deftype.lisp,v 1.4 2005-02-26 17:36:19 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    1818;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    1919
    20 (in-package "SYSTEM")
     20(in-package #:system)
    2121
    2222(defmacro deftype (name lambda-list &rest body)
     
    3939     (setf (get ',name 'deftype-definition) #'(lambda ,lambda-list ,@body))
    4040     ',name))
     41
     42(defun expand-deftype (type)
     43  (let (tp i)
     44    (loop
     45      (if (consp type)
     46          (setf tp (car type) i (cdr type))
     47          (setf tp type i nil))
     48      (if (and (symbolp tp) (get tp 'deftype-definition))
     49          (setf type (apply (get tp 'deftype-definition) i))
     50          (return))))
     51  type)
Note: See TracChangeset for help on using the changeset viewer.