diff options
author | Andy Wingo <wingo@pobox.com> | 2013-01-07 22:02:26 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-01-07 22:02:26 +0100 |
commit | 9f17d967c9b108f856776c035462e93017a6e7e2 (patch) | |
tree | 499037548c7923880f0ec5415c810550a3ba6c62 /doc/ref/api-procedures.texi | |
parent | 6fca8730f768429b31906104635cb5501e7e3df4 (diff) | |
download | guile-9f17d967c9b108f856776c035462e93017a6e7e2.tar.gz |
More procedure-arguments-alist documentation and a bugfix
* doc/ref/api-procedures.texi (Compiled Procedures): Expand
program-arguments-alist and program-lambda-list documentation.
* module/system/vm/program.scm (arity->arguments-alist): Fix the rest
arg if there are also keyword args, a bug found while documenting!
* test-suite/tests/session.test ("procedure-arguments"): Update.
Diffstat (limited to 'doc/ref/api-procedures.texi')
-rw-r--r-- | doc/ref/api-procedures.texi | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/doc/ref/api-procedures.texi b/doc/ref/api-procedures.texi index baa47cc71..d77a2bdcc 100644 --- a/doc/ref/api-procedures.texi +++ b/doc/ref/api-procedures.texi @@ -1,7 +1,7 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010, -@c 2011, 2012 Free Software Foundation, Inc. +@c 2011, 2012, 2013 Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @node Procedures @@ -271,7 +271,25 @@ sense at certain points in the program, delimited by these @end deffn @deffn {Scheme Procedure} program-arguments-alist program [ip] -@deffnx {Scheme Procedure} program-lambda-list [ip] +Return an association list describing the arguments that @var{program} accepts, or +@code{#f} if the information cannot be obtained. + +For example: +@example +(program-arguments-alist + (lambda* (a b #:optional c #:key (d 1) #:rest e) + #t)) @result{} +((required . (a b)) + (optional . (c)) + (keyword . ((#:d . 4))) + (allow-other-keys? . #f) + (rest . d)) +@end example + +The alist keys that are currently defined are `required', `optional', +`keyword', `allow-other-keys?', and `rest'. + +@deffnx {Scheme Procedure} program-lambda-list program [ip] Accessors for a representation of the arguments of a program, with both names and types (ie. either required, optional or keywords) |