Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.c Subject: Re: When Is A High/Low-Level Language Not A High/Low-Level Language? Date: Sat, 17 Aug 2024 22:11:33 -0000 (UTC) Organization: A noiseless patient Spider Lines: 24 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 18 Aug 2024 00:11:34 +0200 (CEST) Injection-Info: dont-email.me; posting-host="777ed5111cfc3eff7ef4f95b77dfec54"; logging-data="2171185"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+nxMVpRavX3q/W1bXfWP4V" User-Agent: Pan/0.159 (Vovchansk; ) Cancel-Lock: sha1:jMGgrSJ09RG32mli9fuFooEb5z4= Bytes: 1937 On Sat, 17 Aug 2024 11:19:30 +0100, Bart wrote: > ... what does this have to do with C, or anything at all? C is supposed to be the epitome of the low-level language that can do bit- fiddling and unsafe type conversions and the like. This is an example of an unsafe type conversion (offering a typesafe interface to the caller, of course) done dynamically, in a language which is generally considered to be “higher-level” than C. In sum: types as first-class objects + low-level bit-fiddling = a combination unavailable in traditional “low-level” languages like C. > Apart from being an apallingly bit of code. How would you it less “apallingly”? (This sentence no verb. Also speling.) > However I can't see the switch-expression; there is a Dict constructor, > where all elements are evaluated, not just the one selected. That is not > how 'switch' works. How does a switch-expression work, then? Can you give us an example?