• What is the name of the | symbol?

    From Matt Jaffe@21:1/5 to All on Fri Mar 25 12:04:57 2022
    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Matt Jaffe@21:1/5 to All on Fri Mar 25 12:16:04 2022
    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Bacarisse@21:1/5 to Matt Jaffe on Fri Mar 25 19:23:19 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Niklas Holsti@21:1/5 to Matt Jaffe on Fri Mar 25 22:03:08 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeffrey R.Carter@21:1/5 to Matt Jaffe on Fri Mar 25 23:21:37 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Townley@21:1/5 to Jeffrey R.Carter on Fri Mar 25 23:24:45 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luke A. Guest@21:1/5 to Chris Townley on Sat Mar 26 00:58:53 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Townley@21:1/5 to Luke A. Guest on Sat Mar 26 02:01:38 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Niklas Holsti on Fri Mar 25 21:24:32 2022
    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 /.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Leake@21:1/5 to Luke A. Guest on Sat Mar 26 17:38:59 2022
    "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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Matt Jaffe@21:1/5 to Chris Townley on Sun Mar 27 11:57:48 2022
    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 ;-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Matt Jaffe@21:1/5 to Stephen Leake on Sun Mar 27 12:01:05 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)