bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Output variants for pick and index operators


From: Dr . Jürgen Sauermann
Subject: Re: Output variants for pick and index operators
Date: Wed, 15 Mar 2023 14:43:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

Hi Hans-Peter,

see below. Note that and give different results
in GNU APL and also in IBM APL2 (PC version).

Best Regards,
Jürgen


On 3/14/23 10:12 PM, Hans-Peter Sorge wrote:
Hi Jürgen,

looks like I have plenty of time,
however, it's being usefully invested:-)

(SVN 1660)

This displays as expected.
    X (8⎕CR  X ←1 2 3 ⊃¨⊂'A' 'CD' 'EF')
 A CD EF   ┌→──────────┐  
           │A ┌→─┐ ┌→─┐│  
           │  │CD│ │EF││  
           │  └──┘ └──┘│  
           └ϵ──────────┘ 

Same in APL2. Note that putting X and (8⎕CR ... on
the same line adds one level of indentation.

A..CD  OK, CD...EF one space more.
     X (8⎕CR  X ←1 2 3 ⌷¨⊂'A' 'CD' 'EF')
 A  CD   EF    ┌→──────────────┐  
               │A ┌────┐ ┌────┐│  
               │  │┌→─┐│ │┌→─┐││  
               │  ││CD││ ││EF│││  
               │  │└──┘│ │└──┘││  
               │  └ϵ───┘ └ϵ───┘│  
               └ϵϵ─────────────┘

Same in APL2.

In Ref to "V" from previous conversations ...

Display for "⊃" and "⌷" differ, the bare outputs are identical.
     X (8⎕CR  X ←1 2 3 ⊃¨⊂V)             
 A  1 2 3 4 5   0 0 0   ┌→────────────────────┐  
                0 0 0   │A ┌→────────┐ ┌→────┐│  
                0 0 0   │  │1 2 3 4 5│ ↓0 0 0││  
                        │  └─────────┘ │0 0 0││  
                        │              │0 0 0││  
                        │              └─────┘│  
                        └ϵ────────────────────┘ 
Same in APL2.
Same layout as before
     X (8⎕CR  X ←1 2 3 ⌷¨⊂V)
 A  1 2 3 4 5   0 0 0    ┌→────────────────────────┐  
                0 0 0    │A ┌───────────┐ ┌───────┐│  
                0 0 0    │  │┌→────────┐│ │┌→────┐││  
                         │  ││1 2 3 4 5││ │↓0 0 0│││  
                         │  │└─────────┘│ ││0 0 0│││  
                         │  └ϵ──────────┘ ││0 0 0│││  
                         │                │└─────┘││  
                         │                └ϵ──────┘│  
                         └ϵϵ───────────────────────┘

Same in APL2.
As a side note.
The output has trailing space(s) included
3 spaces EF...1  OK? Should be 2 spaces?
    X ←1 2 3 ⊃¨⊂'A' 'CD' 'EF'
     X 1
 A CD EF   1 

I get 1 leading and trailing space:

      Q ← ⍕ X ←1 2 3 ⊃¨⊂'A' 'CD' 'EF' ◊ ((' '=ϵQ)/ϵQ)←'∘' ◊ Q
∘A∘CD∘EF∘

4 spaces EF....1 OK? Should be 2 spaces?
      X ←1 2 3 ⌷¨⊂'A' 'CD' 'EF'
     X 1
 A  CD   EF    1

I get2 trailing spaces:

      Q ← ⍕ X ←1 2 3 ⌷¨⊂'A' 'CD' 'EF' ◊ ((' '=ϵQ)/ϵQ)←'∘' ◊ Q
∘A∘∘CD∘∘∘EF∘∘
 
Best Regards
Hans-Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]