[Bug-apl] Patch for ]usercmd

2014-05-27 Thread David B. Lamkins
Jürgen, I submitted this patch in a slightly different form once before; it didn't make it into GNU APL. After having lived with the patch for a while on my own system, I've updated it to the current form. The gist of the patch is to acknowledge redefinition of a ]usercmd with *identical* argume

Re: [Bug-apl] quote-quote should display a blank line

2014-05-27 Thread David B. Lamkins
NOTE: Only in the case of empty arrays, of course. The rank of ' ' is zero; we certainly need to print a blank followed by a CR... On Tue, 2014-05-27 at 19:28 -0700, David Lamkins wrote: > Not the last dimension, but the rank. > > > On Tue, May 27, 2014 at 7:24 PM, Elias Mårtenson > wrote: >

Re: [Bug-apl] )COPY problem

2014-05-27 Thread Blake McBride
I just updated to the latest GNU APL. The problem is significantly worse. Now )LOAD doesn't work either. The following loaded just fine with an older GNU APL: )LOAD Editor loading )DUMP file /home/blake/workspaces/Editor.apl... Offending token at UserFunction.cc:257 is: ⎕IO Workspace::mor

Re: [Bug-apl] )COPY problem

2014-05-27 Thread Blake McBride
Dear David, I haven't updated in about a day. I am waiting for all of my reports to be addressed so that I can re-test everything. Has the ⎕IO bug you refer to been fixed? Thanks. Blake On Tue, May 27, 2014 at 9:32 PM, David B. Lamkins wrote: > ⎕IO was inadvertently dropped from the list

Re: [Bug-apl] )COPY problem

2014-05-27 Thread David B. Lamkins
⎕IO was inadvertently dropped from the list of localizable system variables in the last push. On Tue, 2014-05-27 at 21:23 -0500, Blake McBride wrote: > )LOAD Editor > loading )DUMP file /home/blake/workspaces/Editor.apl... > )SI > )LOAD Devices > SAVED 2014-5-27 2:53:43 (GMT-5)

Re: [Bug-apl] quote-quote should display a blank line

2014-05-27 Thread David Lamkins
Not the last dimension, but the rank. On Tue, May 27, 2014 at 7:24 PM, Elias Mårtenson wrote: > Perhaps the number of lines displayed is equal to the size of the last > dimension? > > > -- "The secret to creativity is knowing how to hide your sources." Albert Einstein http://soundcloud.com

Re: [Bug-apl] quote-quote should display a blank line

2014-05-27 Thread Elias Mårtenson
Perhaps the number of lines displayed is equal to the size of the last dimension? Regards, Elias On 28 May 2014 10:23, David B. Lamkins wrote: > Clearly, I can use something like this: > > ∇sink v > ⍝ Consume value; no display > ∇ > > ... which I'll gladly use in place of 0⍴. > > However, I f

[Bug-apl] )COPY problem

2014-05-27 Thread Blake McBride
)LOAD Editor loading )DUMP file /home/blake/workspaces/Editor.apl... )SI )LOAD Devices SAVED 2014-5-27 2:53:43 (GMT-5) )SI )COPY Editor loading )DUMP file /home/blake/workspaces/Editor.apl... DEFN ERROR+ ∇Edit fun;Mat;qq;fn;bv;orig;Cms;Pad;⎕IO

Re: [Bug-apl] quote-quote should display a blank line

2014-05-27 Thread David B. Lamkins
Clearly, I can use something like this: ∇sink v ⍝ Consume value; no display ∇ ... which I'll gladly use in place of 0⍴. However, I found this in IBM's "An Introduction to APL 2": "24. The display of an empty array having rank greater than one may use zero lines, or may extend to multiple lines

Re: [Bug-apl] Is there a way to clear the screen?

2014-05-27 Thread Elias Mårtenson
That's because control-l is a readline feature. Regards, Elias On 28 May 2014 00:40, "Juergen Sauermann" wrote: > Hi, > > in immediate execution mode you can do: > > * )HOST tput clear* > > which is rather portable. In programs, you can do the same: > > * 'lib_file_io.so' ⎕FX 'FILE_IO

Re: [Bug-apl] quote-quote should display a blank line

2014-05-27 Thread Blake McBride
I just downloaded and installed IBM APL2 on my Windows box. '' prints a blank line as I have been stating. On Tue, May 27, 2014 at 3:32 PM, Blake McBride wrote: > I don't know why it would be hard to rationalize. Here is your algorithm: > > if (printable value) { > print value > prin

Re: [Bug-apl] quote-quote should display a blank line

2014-05-27 Thread David B. Lamkins
On Tue, 2014-05-27 at 15:19 -0500, Blake McBride wrote: > Dear David, > > > First, I assure you, this is how it works. I'm certainly not arguing the fact that this is the behavior you've seen in other implementations. I'm simply trying to reconcile the behavior you describe in light of my long

Re: [Bug-apl] quote-quote should display a blank line

2014-05-27 Thread Blake McBride
I don't know why it would be hard to rationalize. Here is your algorithm: if (printable value) { print value print cr } Here is the algorithm used by all APL's I've used: if (printable value) { print value } Print cr The advantage of the second algorithm is that if you are printin

Re: [Bug-apl] quote-quote should display a blank line

2014-05-27 Thread Blake McBride
Dear David, First, I assure you, this is how it works. I do know of a 0⍴ idiom for branching and for nullifying a prior value in a subsequent assignment. I am unaware of any need for that idiom to prevent printing. Can you give me one example in a function? Thanks. Blake On Tue, May 27, 20

Re: [Bug-apl] quote-quote should display a blank line

2014-05-27 Thread David B. Lamkins
I find this confusing and counterintuitive. If displaying an empty vector causes the interpreter to emit a CR, what then becomes of the 0⍴ idiom commonly used to suppress display of ? Wouldn't your output be littered with spurious CRs every time your program executed such a line? I spent a half-h

Re: [Bug-apl] Restrictions on localization of system variables?

2014-05-27 Thread David B. Lamkins
Thanks. One more thing: quad-IO should be on that list. See UserFunction.cc, around line 252. On Tue, 2014-05-27 at 18:06 +0200, Juergen Sauermann wrote: > Hi, > > thanks, should be fixed in SVN 294. > > Note that there are some subtle differences between IBM APL2 and GNU APL > when localizing

Re: [Bug-apl] quote-quote should display a blank line

2014-05-27 Thread Blake McBride
a. Neither an empty vector nor a vector of multiple elements has a CR in it. The system prints the vector, and then prints a CR. CR gets printed either way. b. I found all these errors while porting my production code which ran consistently over IBM APL and several other APL's. They all print

Re: [Bug-apl] quote-quote should display a blank line

2014-05-27 Thread David B. Lamkins
How is that so? '' is an empty vector. On Mon, 2014-05-26 at 20:30 -0500, Blake McBride wrote: > ∇test > [1] '1' > [2] ' ' > [3] '2' > [4] '' > [5] '3' > [6] ∇ > test > 1 > > 2 > 3 > > > > > There should be a blank line between 2 and 3. > > > Thanks. > > > Blake > >

Re: [Bug-apl] Quad-IO localization problem

2014-05-27 Thread Juergen Sauermann
Hi Blake, thanks, fixed in SVN 294. /// Jürgen On 05/27/2014 04:59 AM, Blake McBride wrote: )CLEAR CLEAR WS ⎕IO 1 'abc'⍳'a' 1 ∇test;⎕IO [1] ⎕IO←0 [2] ∇ test ⎕IO 1 'abc'⍳'a' 0 Although ⎕IO seems to be correct, the iota lookup shows that the wrong ⎕I

Re: [Bug-apl] Is there a way to clear the screen?

2014-05-27 Thread Juergen Sauermann
Hi, in immediate execution mode you can do: * )HOST tput clear* which is rather portable. In programs, you can do the same: *'lib_file_io.so' ⎕FX 'FILE_IO' ◊ FILE_IO[25] FILE_IO[24] 'tput clear > /dev/tty'* Interestingly the ^L (aka ⎕AV[13]) is printed:: *eedjsa@server64:~/projects/j

Re: [Bug-apl] Restrictions on localization of system variables?

2014-05-27 Thread Kacper Gutowski
On 2014-05-27 18:06:06, Juergen Sauermann wrote: > Note that there are some subtle differences between IBM APL2 and GNU APL > when localizing ⎕-vars. In IBM APL2 they are undefined after localizing > them. > In GNU APL they are pre-initialized with their respective default values. > This > gives si

Re: [Bug-apl] Loading a dumped file doesn't execute the Latent Expression

2014-05-27 Thread Juergen Sauermann
Hi Blake, thanks, fixed in SVN 294. /// Jürgen On 05/26/2014 11:04 PM, Blake McBride wrote: The title says it all. I understand why a dumped file would not keep the SI. That makes sense. But it doesn't make sense for it not to execute ⎕LX. Blake

Re: [Bug-apl] Restrictions on localization of system variables?

2014-05-27 Thread Juergen Sauermann
Hi, thanks, should be fixed in SVN 294. Note that there are some subtle differences between IBM APL2 and GNU APL when localizing ⎕-vars. In IBM APL2 they are undefined after localizing them. In GNU APL they are pre-initialized with their respective default values. This gives simpler (and there

Re: [Bug-apl] APL code indentation

2014-05-27 Thread Elias Mårtenson
I'd like to follow up a little on my previous email. The documentation for 'tab-always-indent' says this: *This variable can be used to customize the behavior of the (indent-for-tab-command) command. If the value is t (the default), the command normally just indents the current line. If the value

Re: [Bug-apl] APL code indentation

2014-05-27 Thread Elias Mårtenson
You can use both. Just map TAM to normal tab insertion, and map a different key to 'completion-at-point '. What probably messes things up for you is that my implementation of the indentation function only works

Re: [Bug-apl] APL code indentation

2014-05-27 Thread Blake McBride
When you edit an existing function, it would be nice if the initial display of the function had the indentation applied. The enter key working for me - sort of. It indents EVERY line by one character. When I hit Enter at the end of the line, shouldn't it fix the line? When editing a new functio

Re: [Bug-apl] APL code indentation

2014-05-27 Thread Elias Mårtenson
You are supposed to press TAB to indent. There is also electric indentation, which I normally have disabled, but it will automatically indent when you press RET. Regards, Elias On 27 May 2014 18:03, Blake McBride wrote: > Greetings, > > I looked at the comments in your function. Not only are

Re: [Bug-apl] APL code indentation

2014-05-27 Thread Blake McBride
Greetings, I looked at the comments in your function. Not only are labels typically moved one character to the left, but lines beginning with a comment are too. I did a git pull. When I edit a function, there is no indenting added at all. Am I doing something wrong, or is there some other plac

[Bug-apl] APL code indentation

2014-05-27 Thread Elias Mårtenson
I've just implemented "intelligent" indentation support in gnu-apl-mode. I'm using quotes there because the rules are in fact very simple. Could you guys share with me how you indent code, so that I can add the necessary configuration options to support whatever style you're using? If anyone is i