chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Re: A few questions (oops)


From: Kon Lovett
Subject: Re: [Chicken-users] Re: A few questions (oops)
Date: Thu, 31 Jan 2008 10:15:40 -0800

Sorry,

Example didn't handle "curry'ed" defines.

(use procedure-decoration)
(define-procedure-extender docstring procedure-documentation documented-procedure?)
(define-macro (define/doc ?head ?docstr . ?body)
  (let ([nam (let loop ([hd ?head])
               (if (pair? hd)
                   (loop (car hd))
                   hd))])
    `(begin
       (define ,?head ,@?body)
       (set! (procedure-documentation ,nam) ,?docstr) ) ) )

(define/doc (foo . args) "procedure is foo" #t)
(procedure-documentation foo)

Best Wishes,
Kon






reply via email to

[Prev in Thread] Current Thread [Next in Thread]