Related articles |
---|
[3 earlier articles] |
Re: Alternative C compilers on x86_64 Linux? bc@freeuk.com (BartC) (2016-09-06) |
Re: dead code or otherwise, was Alternative C compilers on x86_64 Linu gneuner2@comcast.net (George Neuner) (2016-09-08) |
Re: dead code or otherwise, was Alternative C compilers on x86_64 Linu 221-501-9011@kylheku.com (Kaz Kylheku) (2016-09-08) |
Re: dead code or otherwise, was Alternative C compilers on x86_64 Linu gneuner2@comcast.net (George Neuner) (2016-09-09) |
Re: dead code or otherwise, was Alternative C compilers on x86_64 Linu 221-501-9011@kylheku.com (Kaz Kylheku) (2016-09-09) |
Re: dead code or otherwise, was Alternative C compilers on x86_64 Linu gneuner2@comcast.net (George Neuner) (2016-09-09) |
Re: dead code or otherwise, was Alternative C compilers on x86_64 Linu 221-501-9011@kylheku.com (Kaz Kylheku) (2016-09-09) |
From: | Kaz Kylheku <221-501-9011@kylheku.com> |
Newsgroups: | comp.compilers |
Date: | Fri, 9 Sep 2016 19:57:14 +0000 (UTC) |
Organization: | Aioe.org NNTP Server |
References: | 16-09-001 16-09-005 16-09-009 16-09-012 16-09-015 16-09-016 16-09-017 16-09-018 16-09-021 |
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 |
On 2016-09-09, George Neuner <gneuner2@comcast.net> 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 <gneuner2@comcast.net> 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.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.