Re: The limits of lisps synatactic gymnastics? (i sure hope not)
- From: Wade Humeniuk <whumeniu+anti+spam@xxxxxxxxx>
- Date: Fri, 30 Sep 2005 19:48:12 GMT
Though not particularly recommended, CLOS is much better...
(defmacro defobject (name) `(let ((slots nil)) (defun ,name (slot-name) (getf slots slot-name)) (defun (setf ,name) (value slot-name) (setf (getf slots slot-name) value))))
CL-USER 1 > (defobject jimmy) (SETF JIMMY)
CL-USER 2 > (setf (jimmy 'name) "jimmy") "jimmy"
CL-USER 3 > (setf (jimmy 'age) 74) 74
CL-USER 4 > (jimmy 'name) "jimmy"
CL-USER 5 > (jimmy 'age) 74
CL-USER 6 > (jimmy 'height) NIL
CL-USER 7 >
Wade .
- Follow-Ups:
- Re: The limits of lisps synatactic gymnastics? (i sure hope not)
- From: Peter Seibel
- Re: The limits of lisps synatactic gymnastics? (i sure hope not)
- References:
- The limits of lisps synatactic gymnastics? (i sure hope not)
- From: robbie.carlton@xxxxxxxxx
- The limits of lisps synatactic gymnastics? (i sure hope not)
- Prev by Date: Re: Giving info to CONSTANTP
- Next by Date: Re: The limits of lisps synatactic gymnastics? (i sure hope not)
- Previous by thread: Re: The limits of lisps synatactic gymnastics? (i sure hope not)
- Next by thread: Re: The limits of lisps synatactic gymnastics? (i sure hope not)
- Index(es):