From: Andy Wingo <wingo@pobox.com>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: rtl metadata musings
Date: Sun, 12 May 2013 23:20:33 +0200 [thread overview]
Message-ID: <87obcfopy6.fsf@pobox.com> (raw)
In-Reply-To: <87wqr63yvt.fsf@tines.lan> (Mark H. Weaver's message of "Sat, 11 May 2013 00:48:38 -0400")
On Sat 11 May 2013 06:48, Mark H Weaver <mhw@netris.org> writes:
> I have only one comment for now, which regards arity information. The
> required/optional/rest representation is not sufficiently general. Not
> only is it unable to handle empty case-lambdas, but it's also unable to
> properly represent a case-lambda that can accept 1 or 3 arguments, but
> not 2.
I did think about this and I think I just didn't express myself well. I
said:
struct guile_arity {
Elf_Addr pc;
Elf_Off size;
nreq; // encodings for these not determined yet
nopt;
flags; // has-keyword-args, has-rest, is-case-lambda
Elf_Offset offset;
}
An entry describes how many required, optional, keyword, and rest
arguments a function has. The .guile.arities section is prefixed by a
length indicating how many entries there are, then all the arity
structures, sorted by pc. Note that one arity may contain another! In
particular for case-lambda clauses you can have one arity for the whole
function, then a number of other ones for the cases.
The case-lambda as a whole would get the is-case-lambda flag. The
arities of the clauses would follow and have their [pc*, pc*+size*]
within the [pc, pc+size] of the case-lambda entry.
I don't know whether to use the nreq/nopt/flags of the "outer" arity for
any purpose or not.
Cheers,
Andy
--
http://wingolog.org/
next prev parent reply other threads:[~2013-05-12 21:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-10 5:07 rtl metadata musings Andy Wingo
2013-05-11 4:48 ` Mark H Weaver
2013-05-12 21:20 ` Andy Wingo [this message]
2013-05-16 21:42 ` Andy Wingo
2013-05-19 21:52 ` Ludovic Courtès
2013-05-20 14:23 ` Andy Wingo
2013-05-20 16:37 ` Ludovic Courtès
2013-05-20 16:48 ` Mike Gran
2013-05-20 18:29 ` Andy Wingo
2013-05-20 19:28 ` Ludovic Courtès
2013-05-20 20:24 ` 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=87obcfopy6.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=guile-devel@gnu.org \
--cc=mhw@netris.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).