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

EXPAND-DEFTYPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.