comp.lang.ada
 help / color / mirror / Atom feed
* What is the name of the | symbol?
@ 2022-03-25 19:04 Matt Jaffe
  2022-03-25 19:23 ` Ben Bacarisse
  2022-03-25 22:21 ` Jeffrey R.Carter
  0 siblings, 2 replies; 12+ messages in thread
From: Matt Jaffe @ 2022-03-25 19:04 UTC (permalink / raw)


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?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* What is the name of the | symbol?
@ 2022-03-25 19:16 Matt Jaffe
  2022-03-25 20:03 ` Niklas Holsti
  0 siblings, 1 reply; 12+ messages in thread
From: Matt Jaffe @ 2022-03-25 19:16 UTC (permalink / raw)


In using it in a named association array aggregate, its semantics 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 1or 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?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: What is the name of the | symbol?
  2022-03-25 19:04 What is the name of the | symbol? Matt Jaffe
@ 2022-03-25 19:23 ` Ben Bacarisse
  2022-03-25 22:21 ` Jeffrey R.Carter
  1 sibling, 0 replies; 12+ messages in thread
From: Ben Bacarisse @ 2022-03-25 19:23 UTC (permalink / raw)


Matt Jaffe <matt.jaffe@gmail.com> 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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: What is the name of the | symbol?
  2022-03-25 19:16 Matt Jaffe
@ 2022-03-25 20:03 ` Niklas Holsti
  2022-03-26  4:24   ` Paul Rubin
  0 siblings, 1 reply; 12+ messages in thread
From: Niklas Holsti @ 2022-03-25 20:03 UTC (permalink / raw)


On 2022-03-25 21:16, Matt Jaffe wrote:
> In using it in a named association array aggregate, its semantics 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
> 1or 3, or 7 for the case expression will select the ... code for
> execution.


That is a quirk of natural language, where "and" and "or" are used in 
non-mathematical ways. You could as well describe the aggregate as 
saying "if the index is 1 or 3 or 7, the element is 5", and you could 
describe the case statement as saying "this when-branch is executed when 
the case selector is 1 and 3 and 7".

As '|' is used in some logical formalisms for disjunction ("or"), and in 
syntactical notation (BNF) to separate alternatives, I tend to read it 
as "or".


> Is there a single name for that symbol (the | ) that seems
> to have different semantics depending on context?


For the name, see https://en.wikipedia.org/wiki/Vertical_bar, where 
indeed "vertical bar" seems favoured. However, I'm pretty sure that I 
have seen "solidus" used, too, but Wikipedia says that is a synonym for 
"slash" (/). Wiktionary does not recognize "solidus" as a term for any 
punctuation mark.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: What is the name of the | symbol?
  2022-03-25 19:04 What is the name of the | symbol? Matt Jaffe
  2022-03-25 19:23 ` Ben Bacarisse
@ 2022-03-25 22:21 ` Jeffrey R.Carter
  2022-03-25 23:24   ` Chris Townley
  1 sibling, 1 reply; 12+ messages in thread
From: Jeffrey R.Carter @ 2022-03-25 22:21 UTC (permalink / raw)


On 2022-03-25 20:04, Matt Jaffe wrote:
> 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?

ARM 2.1(15/3) 
(http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-2-1.html#I1201) says its 
name in Ada is "vertical line".

-- 
Jeff Carter
"Alms for an ex-leper!"
Monty Python's Life of Brian
75

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: What is the name of the | symbol?
  2022-03-25 22:21 ` Jeffrey R.Carter
@ 2022-03-25 23:24   ` Chris Townley
  2022-03-26  0:58     ` Luke A. Guest
  2022-03-27 18:57     ` Matt Jaffe
  0 siblings, 2 replies; 12+ messages in thread
From: Chris Townley @ 2022-03-25 23:24 UTC (permalink / raw)


On 25/03/2022 22:21, Jeffrey R.Carter wrote:
> On 2022-03-25 20:04, Matt Jaffe wrote:
>> 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?
> 
> ARM 2.1(15/3) 
> (http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-2-1.html#I1201) 
> says its name in Ada is "vertical line".
> 

Probably wrong, but for a Unix user since the last century, I call it 'pipe'


-- 
Chris

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: What is the name of the | symbol?
  2022-03-25 23:24   ` Chris Townley
@ 2022-03-26  0:58     ` Luke A. Guest
  2022-03-26  2:01       ` Chris Townley
  2022-03-27  0:38       ` Stephen Leake
  2022-03-27 18:57     ` Matt Jaffe
  1 sibling, 2 replies; 12+ messages in thread
From: Luke A. Guest @ 2022-03-26  0:58 UTC (permalink / raw)


On 25/03/2022 23:24, Chris Townley wrote:

> Probably wrong, but for a Unix user since the last century, I call it 
> 'pipe'

Or bar.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: What is the name of the | symbol?
  2022-03-26  0:58     ` Luke A. Guest
@ 2022-03-26  2:01       ` Chris Townley
  2022-03-27  0:38       ` Stephen Leake
  1 sibling, 0 replies; 12+ messages in thread
From: Chris Townley @ 2022-03-26  2:01 UTC (permalink / raw)


On 26/03/2022 00:58, Luke A. Guest wrote:
> On 25/03/2022 23:24, Chris Townley wrote:
> 
>> Probably wrong, but for a Unix user since the last century, I call it 
>> 'pipe'
> 
> Or bar.
> 

No that is for after work ;)


-- 
Chris

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: What is the name of the | symbol?
  2022-03-25 20:03 ` Niklas Holsti
@ 2022-03-26  4:24   ` Paul Rubin
  0 siblings, 0 replies; 12+ messages in thread
From: Paul Rubin @ 2022-03-26  4:24 UTC (permalink / raw)


Niklas Holsti <niklas.holsti@tidorum.invalid> writes:
> For the name, see https://en.wikipedia.org/wiki/Vertical_bar

The Unicode name is U+007C VERTICAL LINE, alias name vertical bar.

/ is U+002F SOLIDUS, alias names slash and virgule.  I haven't heard of
the name "solidus" used for symbols other than /.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: What is the name of the | symbol?
  2022-03-26  0:58     ` Luke A. Guest
  2022-03-26  2:01       ` Chris Townley
@ 2022-03-27  0:38       ` Stephen Leake
  2022-03-27 19:01         ` Matt Jaffe
  1 sibling, 1 reply; 12+ messages in thread
From: Stephen Leake @ 2022-03-27  0:38 UTC (permalink / raw)


"Luke A. Guest" <laguest@archeia.com> writes:

> On 25/03/2022 23:24, Chris Townley wrote:
>
>> Probably wrong, but for a Unix user since the last century, I call
>> it 'pipe'
>
> Or bar.

Emacs ada-mode grammar calls it BAR.

-- 
-- Stephe

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: What is the name of the | symbol?
  2022-03-25 23:24   ` Chris Townley
  2022-03-26  0:58     ` Luke A. Guest
@ 2022-03-27 18:57     ` Matt Jaffe
  1 sibling, 0 replies; 12+ messages in thread
From: Matt Jaffe @ 2022-03-27 18:57 UTC (permalink / raw)


On Friday, March 25, 2022 at 4:24:49 PM UTC-7, Chris Townley wrote:
> On 25/03/2022 22:21, Jeffrey R.Carter wrote: 
> > On 2022-03-25 20:04, Matt Jaffe wrote: 
> >> 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? 
> > 
> > ARM 2.1(15/3) 
> > (http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-2-1.html#I1201) 
> > says its name in Ada is "vertical line". 
> >
> Probably wrong, but for a Unix user since the last century, I call it 'pipe' 
> 
> 
> -- 
> Chris

Well, non-judgmental type that I am, I'm not going to say you're "wrong", but pipe is the name and usage for that symbol when programming a Unix shell.  It's semantics in Ada are quite different, so I don't think calling it pipe quite fits.  (So I guess I'm not a pipe-fitter either ;-)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: What is the name of the | symbol?
  2022-03-27  0:38       ` Stephen Leake
@ 2022-03-27 19:01         ` Matt Jaffe
  0 siblings, 0 replies; 12+ messages in thread
From: Matt Jaffe @ 2022-03-27 19:01 UTC (permalink / raw)


On Saturday, March 26, 2022 at 5:39:07 PM UTC-7, Stephen Leake wrote:
> "Luke A. Guest" <lag...@archeia.com> writes: 
> 
> > On 25/03/2022 23:24, Chris Townley wrote: 
> > 
> >> Probably wrong, but for a Unix user since the last century, I call 
> >> it 'pipe' 
> > 
> > Or bar.
> Emacs ada-mode grammar calls it BAR. 
> 
> -- 
> -- Stephe

"Bar" sounds like the best alternative so far; I think that's what I'll use when talking to my students.

Thanks.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-03-27 19:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-25 19:04 What is the name of the | symbol? Matt Jaffe
2022-03-25 19:23 ` Ben Bacarisse
2022-03-25 22:21 ` Jeffrey R.Carter
2022-03-25 23:24   ` Chris Townley
2022-03-26  0:58     ` Luke A. Guest
2022-03-26  2:01       ` Chris Townley
2022-03-27  0:38       ` Stephen Leake
2022-03-27 19:01         ` Matt Jaffe
2022-03-27 18:57     ` Matt Jaffe
  -- strict thread matches above, loose matches on Subject: below --
2022-03-25 19:16 Matt Jaffe
2022-03-25 20:03 ` Niklas Holsti
2022-03-26  4:24   ` Paul Rubin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox