[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] line label branching style

From: Nick Lobachevsky
Subject: Re: [Bug-apl] line label branching style
Date: Tue, 14 Jul 2015 19:13:03 +0200

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

Also part of this family of branch styles was

→(I=M) ↓ L270

where if the condition were true, the branch would not be taken.  (The
branch target should be a scalar or one element matrix, otherwise it
would branch to the second element)

This example


was sometimes coded as

→L260 IF M≥J←J+1

where the IF function would encapsulate the  ×⍳.  Needless to say, for
the performance conscious, this was not acceptable as the IF function
used extra CPU units, function call and all.

> On a slightly different note, the author seemed to be using an APL that would 
> coerce a numeric matrix of size 1 × 1 to a vector/scalar so that these lines 
> would evaluate without error.

The STSC family of interpreters did this, "singletons", as they were
called, were treated like scalars.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]