Wed, 04 Apr 2007

>                                 The iota operator is fairly useless (I
> think) applied to non-scalars, but it is defined so that its useful
> scalar behavior is just a special case of its more general behavior
> when fed vectors of any length ...

I can't think of definite examples off the top of my head, so the vector  
behavior isn't that useful, but it is useful -- I distinctly remember  
writing code (more than once) that's ravel'ed and reshape'd to produce the  
same effect:

     i. 3
0 1 2
     i. 2 3
0 1 2
3 4 5

(and Numeric's indices() generates an isomorph of the same information)

> Along the same lines, APL's representation of booleans as 0 and 1
> allows you to use +/ to count the number of times something is true...

It seems fitting that the eponym of the "Iverson Bracket" would allow  
mathmatical manipulation of booleans.

What I find more impressive is that APL (judging from the complaints of  
people moving to modern variants which, not being as memory limited, don't  
go to this extreme) would actually store large boolean arrays, not as 0  
and 1 words, but bitwise.

> These aspects of its design are designed to remove redundancy from
> your program, making it shorter and more likely to mean something when
> you screw it up, so it gives the wrong answer rather than simply raise
> an exception.  In general, I do not like this tendency to err quietly.

Part of this may lie in how it was used.  I've been going through  
"Notation as a Tool of Thought", and in general, Iverson builds up his  
functionality in the mathematicians' style: as a sequence of short  
definitions.  Often, after defining a function, he demonstrates how it  
works on sample data -- a very informal variant on unit testing.  So I'd  
expect that the redudancy wouldn't be a big issue if one were to use the  
language as he did; it would be discovered fairly quickly that, although  
the line you'd just typed meant something, it didn't mean what you wanted.

(something else to consider is that he was presumably originally working  
on paper TTYs, as witnessed by the overstruck characters.  When one works  
at a few hundred baud, one makes different tradeoffs on the terse/verbose  
spectrum than when one has multi-megapixel displays.  When one lacks  
full-screen editors, it almost forces coding in very small steps, and  
testing after every step is an easy habit to acquire, especially should  
one be subject to the occasional line-noise*)

-Dave

:: :: ::

* For our younger readers:
I read a blog entry recently where someone pointed out how obsolete the  
RJ-11 modem port on his laptop was.  In those days, modems didn't even  
plug directly into the phone lines.  Everything up to the handset was Bell  
property and not to be tampered with, so you'd take a plain voice  
telephone, then mash the handset into little rubber cups on the modem,  
with actual air pressure waves mediating the data transfer.

see a teletype (with holes on the upper right where its modem was):
http://www.pdp8.net/asr33/pics/med/old_front.jpg

and an acoustic coupler (the modem here is from a decade later, so it's  
probably smaller and three times as fast as what was in the ASR33):
http://williambader.com/museum/modem300/13modem300baudinsideclose.jpg