unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: guile-devel <guile-devel@gnu.org>
Subject: case-lambda integration
Date: Mon, 12 Oct 2009 22:31:30 +0200	[thread overview]
Message-ID: <m3r5t8uzfh.fsf@pobox.com> (raw)

Hello,

I am climbing out of a case-lambda hole, and am wondering about
integration. If you missed the first part of this, check:

  http://article.gmane.org/gmane.lisp.guile.devel/9436

The deal is that we need case-lambda, and then some kind of
typecase-lambda to get efficient dispatch of the default generic
function protocol into the VM.

OK then, my wip-case-lambda branch is shaping up, with support for
case-lambda at the VM, debugging, assembly, GLIL, and tree-il levels. I
had to adapt psyntax too to make the new tree-il structures.

In order to expose the case-lambda functionality to Scheme though, we
need a way to make lambdas with more than one case; so I think I will
export case-lambda as an identifier by default.

That is probably uncontroversial.

But what might be is that while I was at it, I made allowances for
efficient optional and keyword argument dispatch -- so we can have
keyword arguments without consing, and arguments which are positionally
optional yet can have keywords. This is so lambda* and define* can be
implemented nicely.

There are hooks in <lambda-case> for these, but again the question is
how to expose to Scheme. As I see it there are two options:

   1. Implement lambda* (and define*) in psyntax

   -or-

   2. Make the stock lambda accept #:optional, #:keyword, et al
      arguments (also a hack to psyntax)

I'm kindof leaning towards (2) actually. But I could go either way. Both
ways expose lambda* capability in the default environment -- because
psyntax boots before modules have booted, and these things need access
to psyntax internals.

Perhaps we should do (1) in the interest of interoperability; but you
still have to know you want to code portable Scheme in order to code
portable Scheme. Dunno.

Anyways, input appreciated.

Ciao,

Andy
-- 
http://wingolog.org/




             reply	other threads:[~2009-10-12 20:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-12 20:31 Andy Wingo [this message]
2009-10-13 20:35 ` case-lambda integration Ludovic Courtès
2009-10-19 19:10   ` Andy Wingo
2009-10-21 22:00     ` Ludovic Courtès
2009-10-22  7:41       ` Andy Wingo
2009-10-22 21:15         ` Ludovic Courtès

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=m3r5t8uzfh.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.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).