Re: [Bug-apl] 8⎕CR on empty string array prints strange result

2014-01-29 Thread Nick Lobachevsky
The difference is that a is an empty nested array and that b is an empty simple array. The depths would be different. I tried this example on Dyalog and ≡a is 2, one level of nesting, while ≡b is 1, a simple vector. Also see http://www.sudleyplace.com/APL/Prototype%20Functions.pdf On 1/29/14, E

Re: [Bug-apl] Importing large arrays into GNU APL runtime

2014-02-11 Thread Nick Lobachevsky
I would try to import the matrix in pieces. Try something like mat←951192 10⍴ '' '' '' '' '' '' '' '' 0 0 then import the columns separately, i.e. mat[;1]←(↓col1)~¨' ' mat[;2]←(↓col2)~¨' ' where col1, col2, and friends are simple character matrices containing data for those c

Re: [Bug-apl] External tools acting on interpreter commands (nabla and )ED)

2014-02-12 Thread Nick Lobachevsky
Function definition mode (typing ∇ followed by a symbol name) is an artifact of the kind of terminal hardware supported by APL (the IBM 2741 with its iconic typeballs) in the 1960s. As such, nearly 50 years later, it may be worth rethinking some of these things to take advantage of newer editor a

Re: [Bug-apl] Dyadic / (replicate) does not work with ¨ (each)

2014-02-14 Thread Nick Lobachevsky
The / and \ symbols (and their first coordinate versions ⌿ and ⍀) were overloaded from the start. Not enough characters on the 2741 typeball or something. Symbol pressure. First, they are the compression and expansion functions. 1 0 1 / 1 2 3 Second, they are the reduction and scan operators. +/1

Re: [Bug-apl] Questions about GNU APL

2014-04-01 Thread Nick Lobachevsky
As for file systems, I did something like this years ago for a client who (A) refused to have his data tied up in a proprietary format, and (B) wanted to share data across Dyalog APL and APL2000. This dates back to the Windows 8.3 FAT file system days, this could be far better (or worse) with the

[Bug-apl] IBM AP127

2014-04-12 Thread Nick Lobachevsky
Have a look at IBM's AP127 documentation http://www-01.ibm.com/software/awdtools/apl/library.html See APL2 Programming: Using Structured Query Language (PDF) SH21-1057-07, it's the 4th from the bottom. I wouldn't recommend building anything like this today, but it would be possibly instructive t

Re: [Bug-apl] Trouble with Unicomp keyboard

2014-04-14 Thread Nick Lobachevsky
Just an idea. Has anyone any experience with some of the input method editors for Asian languages, notably Japanese? I think I have seen something where you would type ordinary Roman letters and the input handler would translate them first to Hiragana or Katakana (parallel phonetic alphabets), th

Re: [Bug-apl] line label branching style

2015-07-14 Thread Nick Lobachevsky
Back in the mainframe days, branching style was a big deal. almost religion, as some forms were slightly faster than others. The following were the standard branch and were all interchangeable, except that maybe rho was faster than slash or something. →(I=M) / L270 →(I=M) ⍴ L270 →(I=M) ↑ L270 Al

Re: [Bug-apl] What do Quad-slash and Quad-Backslash do?

2015-07-20 Thread Nick Lobachevsky
Generally every APL vendor added extra features into their version of the language, sometimes to accommodate new hardware or environments, sometimes to enhance their competitive advantage. Burroughs and one or another DEC APL used cute quad-something glyphs, mostly for their file system operations

Re: [Bug-apl] Parsing Numbers

2015-08-28 Thread Nick Lobachevsky
Before the parsing comes the lexical analysis Have a look at the ancient Unix lex (or flex) utility for some insight as to how GNU APL might recognise numbers. Also, have a look at the APL.LEX definition file from Timothy Budd's APLc compiler project, see http://home.earthlink.net/~swsirlin/a

Re: [Bug-apl] A better way to insert characters into a character vector?

2015-08-28 Thread Nick Lobachevsky
I use the following idiom for string insertion. It works reasonably well when the integer width is small, 1 or 2 bytes. But first, let's change the problem slightly get rid of the "e", then insert "www" after the "l" in "alx". This solution is for origin 1. a←'alx' b←'www' (a,

Re: [Bug-apl] Prime Performance

2015-08-28 Thread Nick Lobachevsky
Something is missing here, most probably a relational function [2] L1:→((⍴B)P←B⍳1)/L2 probably should be more like [2] L1:→((⍴B) < P←B⍳1)/L2

Re: [Bug-apl] general APL related chat/mailing list?

2015-09-01 Thread Nick Lobachevsky
Another place where there is some APL message traffic is stackoverflow.com. Look for the APL tag. You will need to enroll. Although this site is very much social media and its motives are, as usual, not entirely clear, it is a great source for answers in many different computer languages and tec

Re: [Bug-apl] IOTA

2016-03-02 Thread Nick Lobachevsky
There is at least one other degenerate case, namely the "legacy" singleton, or one element vector. With a scalar argument, monadic iota returns a result depth one. With a vector argument, iota returns a result depth two. Except when there is only one element. ≡⍳⍳0 ⍝ can't find zilde 2

Re: [Bug-apl] Invalid value in binomial

2016-12-16 Thread Nick Lobachevsky
Wouldn't this really be a domain error, the maximum argument value for ! being around 170? !170 7.257415615307994E306 !171 DOMAIN ERROR !171 (example on dyalog) On 12/16/16, Kacper Gutowski wrote: > Hello, > Binomial returns malformed result when called with some non-integer >

Re: [Bug-apl] Invalid value in binomial

2016-12-16 Thread Nick Lobachevsky
Interesting. On Dyalog, the domain of 0!x are the small integers -32768 to 32767.

Re: [Bug-apl] Performance problems when constructing large(ish) arrays

2017-01-17 Thread Nick Lobachevsky
Elias, In just about any language, iterative string catenation is a real performance killer owing to the repeated growing memory allocation which just gets bigger with every iteration. I would restructure the algorithm to work more like this: (sorry, on a Windoze box and no APL, so metacode only

Re: [Bug-apl] inner product

2017-03-17 Thread Nick Lobachevsky
The key to understanding inner product is that the inner dimensions of the arguments have to be the same. The inner dimension here is 3. a←2 3⍴⍳6 b←3 4⍴⍳12 a 0 1 2 3 4 5 b 0 1 2 3 4 5 6 7 8 9 10 11 a+.×b 20 23 26 29 56 68 80 92 To solve this, first transpose th

Re: [Bug-apl] inner product

2017-03-17 Thread Nick Lobachevsky
Thank you. Forgot to mention scalar extension. When a scalar is supplied as an argument, it's lengthened to match the inner dimension of the other argument. (3 4⍴'cattrattfatt') +.= 't' 2 2 2 (3 4⍴'cattrattfatt') +.= '' 2 2 2 'a' +.= 3 4⍴'catratfatbat' 1 1 1 1 'aaa' +.