From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_20 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.ada Subject: Re: What is the name of the | symbol? Date: Fri, 25 Mar 2022 19:23:19 +0000 Organization: A noiseless patient Spider Message-ID: <871qyp96qg.fsf@bsb.me.uk> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="3764156ced1518774c33a15cd121a188"; logging-data="30447"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181nWUHbQXNufrEv7ogTdedHtnhvlB9ASw=" Cancel-Lock: sha1:x3EALdj3adjZkxhTkfZm14ey6nk= sha1:h8Rv4W9H2adAZqHOpz9GjSAiw2I= X-BSB-Auth: 1.5dee2ebc8866ab5e554f.20220325192319GMT.871qyp96qg.fsf@bsb.me.uk Xref: reader02.eternal-september.org comp.lang.ada:63641 List-Id: Matt Jaffe writes: > In using it in a named association array aggregate, its semantic are > "and" --- e.g., some_1D_array := (1 | 3 | 7 => 5, others => 10) sets > elements 1 and 3 and 7 to the value 5. In a case statement, its > semantics are "or" --- e.g. when 1 | 3 | 7 => ... any of the values > 1, 3, or 7 for the case expression will select the ... code for > execution. Is there a single name for that symbol (the | ) that seems > to have different semantics depending on context? How about reading it like this (read with a fixed-width font): a := ( 1 | 3 | 7 => 5, others => 10 ) if the index is one or three or seven then five else ten fi Similar syntax appeared in Algol 68. | is frequently used for "alternatives" -- it's just a question of what's being referred to. Here, it's all the alternative indexes that map to a specific value. -- Ben.