1 Déc
2006
1 Déc
'06
15:49
Brad, On 11/30/06, Bradley Lucier <lucier@math.purdue.edu> wrote:
Do you have any quick suggestions about how to fix this?
Here's a hack I came up with: (define-macro (define-record-type name constructor predicate . fields) (let* ((te (string->symbol (string-append "type-exhibitor-" (symbol->string name))))) `(begin (define-type ,name constructor: ,constructor predicate: ,predicate type-exhibitor: ,te ,@fields) (define ,name (,te))))) Now:
(define-record-type :pare (kons x y) pare? (x kar set-kar!) (y kdr)) :pare #<type #2 :pare>
Hope that helps. --Jeff