>From 6637ce41e5e8cbfefe4c14c47ac79c7a3f5a6cfe Mon Sep 17 00:00:00 2001 From: Cedric Cellier
Date: Wed, 11 Jan 2012 17:12:48 +0100 Subject: [PATCH] document program-arguments-alist and program-lambda-list --- doc/ref/api-procedures.texi | 9 +++++++++ module/system/vm/program.scm | 2 ++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/doc/ref/api-procedures.texi b/doc/ref/api-procedures.texi index 2b4a05e..5875ced 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 address@hidden {Scheme Procedure} program-arguments-alist program [ip] address@hidden {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) + address@hidden 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. address@hidden deffn @node Optional Arguments @subsection Optional Arguments diff --git a/module/system/vm/program.scm b/module/system/vm/program.scm index 02d5ec4..d4de335 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) -- 1.7.2.5