From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aibo.runbox.com (aibo.runbox.com [91.220.196.211]) by sourceware.org (Postfix) with ESMTPS id E74233858D38 for ; Thu, 16 Jul 2020 05:24:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E74233858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bothner.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=per@bothner.com Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1jvwNP-0006uM-8x for kawa@sourceware.org; Thu, 16 Jul 2020 07:24:11 +0200 Received: by submission02.runbox with esmtpsa [Authenticated alias (524175)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1jvwNG-0006AL-O9 for kawa@sourceware.org; Thu, 16 Jul 2020 07:24:03 +0200 Subject: Re: Extending functional call syntax for Sequences to include Maps To: kawa@sourceware.org References: From: Per Bothner Message-ID: <31607c53-66ce-895e-4fc9-73471c8e51bc@bothner.com> Date: Wed, 15 Jul 2020 22:24:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jul 2020 05:24:14 -0000 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/