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


From: Elf
Subject: Re: [Chicken-users] Re: A few questions
Date: Thu, 31 Jan 2008 10:28:20 -0800 (PST)


i had previously read that, kon.  i was thinking of an alternate representation
for arity when i mentioned that it should be simple.  it should have gone
into a diff post.

simplest arity is a pair, int . bool, required args and rest?.
optionals present a problem: do we want to keep defaults, names, or just ordering?
keywords also present a similar problem.

theres yet another problem as well with anything more complex than the pair
mentioned above. keywords dont have to be specified in the definition, there exists support procedures for parsing out keywords from an arbitrary
rest arg.  additionally, whats the arity of case-lambda?  or of parameters?
perhaps instead of a direct arity function/macro, a valid-arity? macro
could exist instead.  that should trade in the can of worms of arity for
an entirely different, hopefully smaller can.

-elf

On Thu, 31 Jan 2008, Kon Lovett wrote:


On Jan 31, 2008, at 9:02 AM, Elf wrote:


this brings to mind a fourth possibility:

chicken-man is hopelessly out of date.
an entirely new chicken-man-ish system, and export external docs that can be loaded if desired. this gives the same set of functionality without requiring strings on the stack, and should be slightly easier to maintain in
the long run, i think.  unfortunately it doesnt solve the problem of arity.


arity should be fairly simple though...

Sorry, no. See:
http://lists.gnu.org/archive/html/chicken-users/2008-01/msg00229.html


-elf


See:
http://chicken.wiki.br/procedure-decoration

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

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

<snip>

Best Wishes,
Kon




_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users





reply via email to

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