mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
document program-arguments-alist and program-lambda-list
This commit is contained in:
parent
44390164ce
commit
6fca8730f7
2 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue