public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: kawa@sourceware.org
Subject: Re: Extending functional call syntax for Sequences to include Maps
Date: Wed, 15 Jul 2020 22:24:00 -0700	[thread overview]
Message-ID: <31607c53-66ce-895e-4fc9-73471c8e51bc@bothner.com> (raw)
In-Reply-To: <CA+ghDQ8z=DeykLszLY3LeoSmXvKZ+VpWDU7UKWAOf4YCPNEATQ@mail.gmail.com>

On 7/15/20 11:44 AM, Jamison Hope wrote:
> I suspect you're remembering this conversation we had five (!) years ago:
> https://sourceware.org/pipermail/kawa/2015q1/006284.html

Only five? I see ChangeLog entries with your name going back to 2009 ....

> You were leaning toward throwing an exception on no-default, and I was
> leaning toward returning #!null for simplicity/consistency with Java,
> and also because #!null is treated as false, which is like what
> assq/assv/assoc and memq/memv/member return for an absent key.

I still feel more comfortable with throwing an exception if KEY is invalid
in the (HMAP KEY) case.  I think passing a default argument
doesn't really need a keyword - (HMAP KEY DEFAULT) looks good to me.

I don't expect I'll be implementing this feature anytime soon - perhaps
an interesting project for someone?  It's not completely trivial
because of the compile-time handling of "ApplyToArgs".

You also mentioned hash literals.  I'm not as keen on a syntax
that only works for literal maps - I'd like an elegant syntax that
works for keys and values that are expressions evaluated at run-time.
Conceptually similar to the sequence syntax:
   [E0 E1 ... ELAST]

One approach is to use quasi-quotation, though I think that's a bit ugly.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

      reply	other threads:[~2020-07-16  5:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 21:24 Duncan Mak
2020-07-03 22:05 ` Per Bothner
2020-07-04  4:07   ` Duncan Mak
2020-07-15 18:44   ` Jamison Hope
2020-07-16  5:24     ` Per Bothner [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31607c53-66ce-895e-4fc9-73471c8e51bc@bothner.com \
    --to=per@bothner.com \
    --cc=kawa@sourceware.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).