From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112515 invoked by alias); 17 Jan 2017 15:57:26 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 112499 invoked by uid 89); 17 Jan 2017 15:57:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=HX-HELO:sk:mail.th, sk:www.the, Meanwhile, sk:wwwthe X-HELO: mail.theptrgroup.com Received: from mail.theptrgroup.com (HELO mail.theptrgroup.com) (71.178.251.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Jan 2017 15:57:15 +0000 Received: from [10.11.21.86] (unknown [10.11.21.86]) by mail.theptrgroup.com (Postfix) with ESMTPS id 506E6402A7 for ; Tue, 17 Jan 2017 10:57:13 -0500 (EST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: behavior of CASE with strings PART 2 From: Jamison Hope In-Reply-To: Date: Tue, 17 Jan 2017 15:57:00 -0000 Content-Transfer-Encoding: 7bit Message-Id: References: <201701171107.25991.Damien.Mattei@unice.fr> To: kawa@sourceware.org X-IsSubscribed: yes X-SW-Source: 2017-q1/txt/msg00020.txt.bz2 On Jan 17, 2017, at 8:23 AM, Per Bothner wrote: > CASE *cannot* meaningfully be used with strings. Indeed. Meanwhile, this sort of categorization of strings can be useful, as evidenced by the addition of String switches to Java 7. The portable Scheme way to do this would be to use symbols instead of strings, since ordinarily symbols are interned and thereby eqv?, but I could see a place for Kawa-specific syntax that compiles to the equivalent of a Java String switch block (which uses hash codes and a lookupswitch to avoid doing every string comparison in a big if-else chain). I'm not sure what we would call the macro, though -- string-case makes me think of uppercase vs lowercase. -- Jamison Hope The PTR Group www.theptrgroup.com