Path: csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Kaz Kylheku <221-501-9011@kylheku.com> Newsgroups: comp.compilers Subject: Re: dead code or otherwise, was Alternative C compilers on x86_64 Linux? Date: Fri, 9 Sep 2016 19:57:14 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 30 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <16-09-022@comp.compilers> References: <16-09-001@comp.compilers> <16-09-005@comp.compilers> <16-09-009@comp.compilers> <16-09-012@comp.compilers> <16-09-015@comp.compilers> <16-09-016@comp.compilers> <16-09-017@comp.compilers> <16-09-018@comp.compilers> <16-09-021@comp.compilers> Injection-Info: miucha.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="98642"; mail-complaints-to="abuse@iecc.com" Keywords: C, Lisp Posted-Date: 09 Sep 2016 16:21:14 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1761 On 2016-09-09, George Neuner wrote: > On Fri, 9 Sep 2016 06:05:44 +0000 (UTC), Kaz Kylheku ><221-501-9011@kylheku.com> wrote: > >>On 2016-09-09, George Neuner wrote: >>> But like any good Usenet discussion, it (d)evolved into something more >>> general. >>> >>> Not every language with a CASE like construct has C's limitations on >>> specifying the alternatives. Lisp certainly doesn't. >> >>Yes, it does, in fact. The labels in Lisp case are literals that are >>embedded in the CASE syntax itself, and not evaluated. They are >>compared to the input value using EQL equality. Duplicate cases >>are a bug, which is not required to be diagnosed. > > Lisp does not restrict CASE "labels" to integers like C. They can be > any of [at least] symbols, characters, integers or booleans. > And unlike C where booleans and characters are subsets of integer, in > Lisp they are discrete types. Additionally symbols are a reference > type - a pointer to a structure. At the low level it's fairly similar because EQL compares most of those types as machine words, with the exception of integers (two distinct bignum objects denoting the same integer are EQL). If none of the case labels are bignums (case's usual case), then EQ can be used, and then boils down to a switch on machine words. All the same tricks can be used: jump table, tree-search.