summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Cellier <cedric.cellier@securactive.net>2012-01-11 17:12:48 +0100
committerAndy Wingo <wingo@pobox.com>2013-01-07 20:37:07 +0100
commit6fca8730f768429b31906104635cb5501e7e3df4 (patch)
tree070b49dfa893de8e9a5010d2926bd6f69801c20d
parent44390164ce7ad4b28571d30037529833a4b4f985 (diff)
downloadguile-6fca8730f768429b31906104635cb5501e7e3df4.tar.gz
document program-arguments-alist and program-lambda-list
-rw-r--r--doc/ref/api-procedures.texi9
-rw-r--r--module/system/vm/program.scm2
2 files changed, 11 insertions, 0 deletions
diff --git a/doc/ref/api-procedures.texi b/doc/ref/api-procedures.texi
index 02d777155..baa47cc71 100644
--- a/doc/ref/api-procedures.texi
+++ b/doc/ref/api-procedures.texi
@@ -270,6 +270,15 @@ sense at certain points in the program, delimited by these
@code{arity:start} and @code{arity:end} values.
@end deffn
+@deffn {Scheme Procedure} program-arguments-alist program [ip]
+@deffnx {Scheme Procedure} program-lambda-list [ip]
+Accessors for a representation of the arguments of a program, with both
+names and types (ie. either required, optional or keywords)
+
+@code{program-arguments-alist} returns this information in the form of
+an association list while @code{program-lambda-list} returns the same
+information in a form similar to a lambda definition.
+@end deffn
@node Optional Arguments
@subsection Optional Arguments
diff --git a/module/system/vm/program.scm b/module/system/vm/program.scm
index 02d5ec409..d4de3356b 100644
--- a/module/system/vm/program.scm
+++ b/module/system/vm/program.scm
@@ -238,11 +238,13 @@
;; the name "program-arguments" is taken by features.c...
(define* (program-arguments-alist prog #:optional ip)
+ "Returns the signature of the given procedure in the form of an association list."
(let ((arity (program-arity prog ip)))
(and arity
(arity->arguments-alist prog arity))))
(define* (program-lambda-list prog #:optional ip)
+ "Returns the signature of the given procedure in the form of an argument list."
(and=> (program-arguments-alist prog ip) arguments-alist->lambda-list))
(define (arguments-alist->lambda-list arguments-alist)