[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-apl] Revisiting the APL 2 empty-array display behavior
From: |
David B. Lamkins |
Subject: |
[Bug-apl] Revisiting the APL 2 empty-array display behavior |
Date: |
Wed, 28 May 2014 11:19:46 -0700 |
Now that I can see how printing '' as CR affects a larger program, I've
gotta say that I'm stumped as to how this behavior can be considered
usable.
Specifically, it's now (unless there's a trick I haven't yet discovered)
difficult (see below) to silently (i.e. without affecting the display)
execute an arbitrary expression that may, depending upon the expression,
return either '' or nothing at all.
I dunno... maybe that's not something that anyone else has ever done.
But here's an extremely common idiom that breaks badly under the new
print behavior:
⍎test/'expression'
This is just a conditional execution of an expression. The problem with
the new print behavior is that this line will print a CR whenever the
test is false. Not OK...
If we're going to stick with this new behavior, I can adapt. I've even
discovered a (rather tortured-looking) solution to the use-case I posed
in the second paragraph:
∇sink v
⍝ Consume value; no display
∇
sink '0' ⎕ea ',⍎l'
On the other hand, it's surprising to me how this new behavior affects
so much else.
- [Bug-apl] Revisiting the APL 2 empty-array display behavior,
David B. Lamkins <=
- Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior, Blake McBride, 2014/05/28
- Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior, David B. Lamkins, 2014/05/28
- Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior, Blake McBride, 2014/05/28
- Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior, David B. Lamkins, 2014/05/28
- Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior, Juergen Sauermann, 2014/05/29
- Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior, Elias Mårtenson, 2014/05/29
- Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior, Juergen Sauermann, 2014/05/31
- Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior, Jay Foad, 2014/05/29
- Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior, Juergen Sauermann, 2014/05/31