From: Andy Wingo <wingo@pobox.com>
To: rixed@happyleptic.org
Cc: guile-user@gnu.org
Subject: Re: interrogation about introspecting function bindings
Date: Tue, 10 Jan 2012 22:15:54 +0100 [thread overview]
Message-ID: <87aa5vfed1.fsf@pobox.com> (raw)
In-Reply-To: <20111221122633.GA11850@ccellier.rd.securactive.lan> (rixed@happyleptic.org's message of "Wed, 21 Dec 2011 13:26:33 +0100")
Hi Cedric,
On Wed 21 Dec 2011 13:26, rixed@happyleptic.org 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/
next prev parent reply other threads:[~2012-01-10 21:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-21 12:26 interrogation about introspecting function bindings rixed
2012-01-10 21:15 ` Andy Wingo [this message]
2012-01-11 16:13 ` rixed
2013-01-07 21:04 ` Andy Wingo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87aa5vfed1.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=guile-user@gnu.org \
--cc=rixed@happyleptic.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).