Since J501, trains of adverb-verb-verb are no longer permitted. Hence, the only way to write CPA is, as bob noted, explicitly:
CPA =: 1 :'u@Ei %. ^/~@Ei'
In the same book, a bit above, Iverson introduces another adverb S =: (+/@:)(@Ei)"0
which works fine.
Let's define each part of CPA
and S
:
cpa1 =: @Ei
cpa2 =: %.
cpa3 =: ^/~@Ei
s1 =: +/@:
s2 =: @Ei
so
list {~ class ;:'cpa1 cpa2 cpa3'
┌──────┬────┬────┐
│adverb│verb│verb│
└──────┴────┴────┘
list {~ class ;:'s1 s2'
┌──────┬──────┐
│adverb│adverb│
└──────┴──────┘
we see that CPA
is a train of adverb-verb-verb, which is not permitted in J501 and above, but S
is an adverb-adverb hook, which is permitted in J501 and above.
defs:
list =: ;:'noun adverb conjuction verb'
class =: 4!:0