Re: APL2 code no longer works

2022-03-22 Thread Dr . Jürgen Sauermann

  
  
Hi Blake,
  
  thanks, see below,
  
  Best Rgeads,
  Jürgen
  

On 3/21/22 8:41 PM, Blake McBride
  wrote:


  
  Greetings,


I wrote the following APL1 code a long time ago.


    ∇
  [0]   r←d Parse v
  [1]  ⍝ Convert vector v into a matrix breaking at delimiter d
  [2]  
  r←(((0≠⍴v)×⍴r),⌈/r)⍴(,r∘.≥⍳⌈/r←¯1+(r,1+⍴v)-0,r←r/⍳⍴v)\(~r←v∈d)/v←,v
      ∇



It worked in 1981 and it works now.


I believe at some point someone on this list re-wrote the
  above in GNU APL (APL2) as follows:


    ∇
  [0]   r←d Parse2 v
  [1]  ⍝ break up vector v according to delimiter d into
  seperate arrays
  [2]   r←1↓1↓¨(1++\r∊d)⊂r←(1↑d),(1↑d),v
      ∇



Interestingly, Parse2 used to work but doesn't anymore.  I
  suppose the APL2 logic in GNU APL has changed.  Two points:


1.  Can someone help me fix this?  (I don't know too much
  about APL2.)


  

Try ⊃Parse2 instead of Parse2:

  8 ⎕CR ',' Parse2
'One,Two,Three,Four'
  ┌→─┐
  │┌→──┐ ┌→──┐ ┌→┐ ┌→───┐│
  ││One│ │Two│ │Three│ │Four││
  │└───┘ └───┘ └─┘ └┘│
  └ϵ─┘
    
    8 ⎕CR ⊃ ',' Parse2 'One,Two,Three,Four'
  ┌→┐
  ↓One  │
  │Two  │
  │Three│
  │Four │
  └─┘
  
  Or change Parse2[2] to:

[2]   r←⊃1↓1↓¨(1++\r∊d)⊂r←(1↑d),(1↑d),v
  

  
2.  How good is APL2 if it can morph like this?  (APL1
  seems much more straightforward and consistent and less open
  to interpretation.)


  

I am pretty sure that this change was caused by a trouble report
followed by a bug fix at some point in time.
The current behaviour of GNU APL looks OK to me (although I am not
really an APL expert). My humble argument
would be that in order to get a not-nested result, the ⊂ in line 2
of Parse2 would require a matching ⊃.

Put differently, the original Parse2 was working around a bug in GNU
APL which was fixed later on.

BTW, for long v, the following is probably more efficient:

[2] r←⊃1↓1↓¨(1++\r∊d)⊂r←(2/↑d),v

  

  
Thanks.


Blake McBride


  


  




Re: APL2 code no longer works

2022-03-22 Thread Blake McBride
That fixes it.  Thank you very much!!

On Tue, Mar 22, 2022 at 7:16 AM Dr. Jürgen Sauermann <
mail@jürgen-sauermann.de> wrote:

> Hi Blake,
>
> thanks, see below,
>
> Best Rgeads,
> Jürgen
>
>
> On 3/21/22 8:41 PM, Blake McBride wrote:
>
> Greetings,
>
> I wrote the following APL1 code a long time ago.
>
> ∇
> [0]   r←d Parse v
> [1]  ⍝ Convert vector v into a matrix breaking at delimiter d
> [2]   r←(((0≠⍴v)×⍴r),⌈/r)⍴(,r∘.≥⍳⌈/r←¯1+(r,1+⍴v)-0,r←r/⍳⍴v)\(~r←v∈d)/v←,v
> ∇
>
> It worked in 1981 and it works now.
>
> I believe at some point someone on this list re-wrote the above in GNU APL
> (APL2) as follows:
>
> ∇
> [0]   r←d Parse2 v
> [1]  ⍝ break up vector v according to delimiter d into seperate arrays
> [2]   r←1↓1↓¨(1++\r∊d)⊂r←(1↑d),(1↑d),v
> ∇
>
> Interestingly, Parse2 used to work but doesn't anymore.  I suppose the
> APL2 logic in GNU APL has changed.  Two points:
>
> 1.  Can someone help me fix this?  (I don't know too much about APL2.)
>
> Try ⊃Parse2 instead of Parse2:
>
> *  8 ⎕CR ',' Parse2 'One,Two,Three,Four'*
> *┌→─┐*
> *│┌→──┐ ┌→──┐ ┌→┐ ┌→───┐│*
> *││One│ │Two│ │Three│ │Four││*
> *│└───┘ └───┘ └─┘ └┘│*
> *└ϵ─┘*
>
> *  8 ⎕CR ⊃ ',' Parse2 'One,Two,Three,Four'*
> *┌→┐*
> *↓One  │*
> *│Two  │*
> *│Three│*
> *│Four │*
> *└─┘*
>
> Or change *Parse2[2] *to:
>
> *[2]   r←⊃1↓1↓¨(1++\r∊d)⊂r←(1↑d),(1↑d),v*
>
> 2.  How good is APL2 if it can morph like this?  (APL1 seems much more
> straightforward and consistent and less open to interpretation.)
>
> I am pretty sure that this change was caused by a trouble report followed
> by a bug fix at some point in time.
> The current behaviour of GNU APL looks OK to me (although I am not really
> an APL expert). My humble argument
> would be that in order to get a not-nested result, the ⊂ in line 2 of
> Parse2 would require a matching ⊃.
>
> Put differently, the original Parse2 was working around a bug in GNU APL
> which was fixed later on.
>
> BTW, for long v, the following is probably more efficient:
>
>
>
> *[2] r←⊃1↓1↓¨(1++\r∊d)⊂r←(2/↑d),v *
>
> Thanks.
>
> Blake McBride
>
>
>


)lib 5 SQL

2022-03-22 Thread Blake McBride
Greetings,

When I do:

  )lib 5
APLComponentFiles/  iso-apl-cf/ FILE_IO FILE_IO1HTMLSQL
  )lib 5 SQL
APLComponentFiles/  iso-apl-cf/ FILE_IO FILE_IO1HTMLSQL

How do I see and load what is in the SQL directory?

Thanks!

Blake McBride


Re: )lib 5 SQL

2022-03-22 Thread Blake McBride
Sorry.  I see SQL is not a directory.  It is a workspace.


On Tue, Mar 22, 2022 at 7:47 AM Blake McBride  wrote:

> Greetings,
>
> When I do:
>
>   )lib 5
> APLComponentFiles/  iso-apl-cf/ FILE_IO FILE_IO1HTMLSQL
>   )lib 5 SQL
> APLComponentFiles/  iso-apl-cf/ FILE_IO FILE_IO1HTMLSQL
>
> How do I see and load what is in the SQL directory?
>
> Thanks!
>
> Blake McBride
>
>


Re: )lib 5 SQL

2022-03-22 Thread Dr . Jürgen Sauermann

  
  
Hi Blake,
  
  you can use )LIB with an absolute path to a (sub-)directory
  containing workspaces, e.g.
  
    )LIB
  /usr/local/lib/apl/wslib5/APLComponentFiles
  ComponentFiles


The easiest way to determine the absolute path is command )LIBS.

Best Regards,
Jürgen


On 3/22/22 1:47 PM, Blake McBride
  wrote:


  
  Greetings,


When I do:


      )lib 5
  APLComponentFiles/  iso-apl-cf/     FILE_IO     FILE_IO1  
   HTML    SQL
        )lib 5 SQL
  APLComponentFiles/  iso-apl-cf/     FILE_IO     FILE_IO1  
   HTML    SQL



How do I see and load what is in the SQL directory?


Thanks!


Blake McBride


  


  




Re: )lib 5 SQL

2022-03-22 Thread Blake McBride
Thank you, Jürgen.

On Tue, Mar 22, 2022 at 8:15 AM Dr. Jürgen Sauermann <
mail@jürgen-sauermann.de> wrote:

> Hi Blake,
>
> you can use )LIB with an absolute path to a (sub-)directory containing
> workspaces, e.g.
>
>
>
> *  )LIB /usr/local/lib/apl/wslib5/APLComponentFiles ComponentFiles *
>
> The easiest way to determine the absolute path is command *)LIBS*.
>
> Best Regards,
> Jürgen
>
>
> On 3/22/22 1:47 PM, Blake McBride wrote:
>
> Greetings,
>
> When I do:
>
>   )lib 5
> APLComponentFiles/  iso-apl-cf/ FILE_IO FILE_IO1HTMLSQL
>   )lib 5 SQL
> APLComponentFiles/  iso-apl-cf/ FILE_IO FILE_IO1HTMLSQL
>
> How do I see and load what is in the SQL directory?
>
> Thanks!
>
> Blake McBride
>
>
>


Build error for SVN 1543 on Mac OS X

2022-03-22 Thread Louis Chretien via Bugs and suggestions for GNU APL
Version 1543 cleared a whole bunch of warnings from the two headers, but a new 
one popped up:

g++ -DHAVE_CONFIG_H -I. -I..-Wall -I sql -I /Users/admin/Subversion/apl 
 -g -O2 -I /Users/admin/Subversion/apl -MT apl-Bif_F12_PARTITION_PICK.o -MD 
-MP -MF .deps/apl-Bif_F12_PARTITION_PICK.Tpo -c -o apl-Bif_F12_PARTITION_PICK.o 
`test -f 'Bif_F12_PARTITION_PICK.cc' || echo './'`Bif_F12_PARTITION_PICK.cc
Bif_F12_PARTITION_PICK.cc:192:8: warning: template argument uses local type 
'partition' [-Wlocal-type-template-args]
vector partitions;   // all partions on the B-axis
   ^
1 warning generated.


---
Louis Chrétien
lchret...@mac.com