Procedure utilities documentation.
This commit is contained in:
parent
edb6f14a9d
commit
89e66e8f79
1 changed files with 46 additions and 0 deletions
46
doc/utils.md
46
doc/utils.md
|
@ -207,6 +207,52 @@ pair consisting of symbol created by interning the string of
|
|||
non-whitespace characters before the first whitespace character and
|
||||
the string with the rest of the line.
|
||||
|
||||
### Proc
|
||||
|
||||
(import util-proc)
|
||||
|
||||
This module provides a few simple procedures for querying properties
|
||||
of other procedures.
|
||||
|
||||
((procedure-arity=? n) proc)
|
||||
|
||||
* ```n``` - integer representing the number of arguments
|
||||
* ```proc``` - procedure to query
|
||||
|
||||
Returns true if the procedure ```proc``` accepts exactly ```n```
|
||||
arguments.
|
||||
|
||||
((procedure-arity>=? n) proc)
|
||||
|
||||
* ```n``` - integer representing the number of arguments
|
||||
* ```proc``` - procedure to query
|
||||
|
||||
Returns true if the procedure ```proc``` accepts at least ```n```
|
||||
arguments.
|
||||
|
||||
((procedure-arity>? n) proc)
|
||||
|
||||
* ```n``` - integer representing the number of arguments
|
||||
* ```proc``` - procedure to query
|
||||
|
||||
Returns true if the procedure ```proc``` accepts more than ```n```
|
||||
arguments.
|
||||
|
||||
(procedure-num-args proc)
|
||||
|
||||
* ```proc``` - procedure to check
|
||||
|
||||
Returns the number of mandatory arguments.
|
||||
|
||||
(procedure-arg-names proc)
|
||||
|
||||
* ```proc``` - procedure to check
|
||||
|
||||
Returns the (possibly improper) list of arguments the procedure
|
||||
```proc``` accepts. If it accepts arbitrary number of arguments, it is
|
||||
signalled by simple symbol instead of pair at the last position. If it
|
||||
accepts an exact number of arguments, it returns a proper list.
|
||||
|
||||
### Set (List)
|
||||
|
||||
(import util-set-list)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue