On Sun, 26 Dec 2021, Jose Mario Quintana wrote:
So, what is the deeper issue? An initiate using j8xx interpreters could
easily refer tacitly to [x] and y from within tacit adverbs (and
conjunctions when using forks of j8xx interpreters) and write a version of
{{ y `:6 }} with a vengeance (illegally, of course); however, in J there is
an official obsession (in my opinion) restricting verbs to return nouns,
only nouns, and nothing but nouns. I have no idea about k, but
DyalogAPL at least allows the verb execute to return verbs,
(â'+/') 1 2 3 4
10
Only execute, though; user-defined verbs cannot do that.
BQN is going all in and grants all functions first-class citizenship
Sort of. I have a half-edited page somewhere of gripes with BQN, and
the half-assed approach it takes here is one. One can control the
syntactic class of a name irrespectively of its semantic class; but one
cannot do this for other terms. For example, here is some code which is
invalid in BQN, for no very good reason:
Fâ{đŠâ+}
3 (2 F 5) 4
I have vague ideas about a better scheme, but am not sure of them. For
instance, one could use different types of brackets to control syntactic
class; but it is impossible to abstract over such a mechanism. It would
also be nice to have lisp-like quoting; but how to make such an approach
uniform, especially in the face of syntactic class which is not fixed at
read time?
(It seems like your [: ]: are a form of quoting; and I expect they do
not compose?)
Once (tacit) verbs are allowed to take and produce any type of entity the
full power of tacit verbal programming is unleashed in the context of tacit
adverbial and conjunctional programming.
I will argue that, while it is good for functions to be first-class, we
can also do better than gerunds. Parent/sibling vectors (cf Hsu) are
interesting here. I wrote most of a pattern matcher for them once, and
found it fairly natural. (Still need to finish it and extend it to a
term-rewriter, but.)
The two complement each other. AR are somewhat orthogonal, as gerunds
represent structure; in this respect, arrays of verbs are not _that_
different from arrays of AR. But I notice you do not get away from AR
either, needing to say <,'@:'. The gain comes almost solely (IMO) from
being able to produce verbs as results (and from being able to use
conjunctions as verb). Going the other way around is just gravy.
-E
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm