[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: interrogation about introspecting function bindings
From: |
Andy Wingo |
Subject: |
Re: interrogation about introspecting function bindings |
Date: |
Tue, 10 Jan 2012 22:15:54 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
Hi Cedric,
On Wed 21 Dec 2011 13:26, address@hidden writes:
> I'm trying to get a list of parameter names from a function, using
> this:
>
> (use-modules (system vm program))
> (define (val->string v)
> (if (string? v) v (object->string v)))
> (define (fun-params fun)
> (let ((bindings (program-bindings fun)))
> (map (lambda (binding) (val->string (binding:name binding))) bindings)))
Why not use program-arguments-alist, or program-lambda-list?
> is it guaranteed that the first b bindings will be the parameters ?
No, because there are complications with case-lambda, keyword, rest, and
optional arguments.
Cheers,
Andy
--
http://wingolog.org/
- Re: interrogation about introspecting function bindings,
Andy Wingo <=