First, I feel I owe you an explanation of why referring to the arguments of
verbs (from within an adverb or conjunction) is related to producing a
tacit version of {{ y `:6 }}.  What follows are annotated sessions and it
is assumed that the hg script, which I have posted a few times before, has
been run previously.  One, say, wants to implement a version of the rank
conjunction u"v which some wish it had been done, namely x u rank v y  <->
 x u "(x v y) y.  Let us start with j903,

   NB. xhgy...

   args=. (&,) (@:(,&:(an f.))) NB. (adv)

   a7=. ((an , (;:'&') , (,(`''))c)f.hg) 'args'f.

   xhgy=. ((ar'a7') , < o (] ,(<'@:')c))hg

   d=. (xx=. 1&{) (yy=. 2&{)
   d=. (uu=. < o ((0;1;0)&{::)) (vv=. < o ((0;1;1)&{::))

   train=.  {{ y (`:6) }}

   rank=. ` (train o (xx , uu , (<'"') , < o (xx , vv , yy) , yy) f.xhgy)
   1 <@] rank [ i.2 3 4
┌───────────┬───────────┬───────────┐
│0 1 2 3    │4 5 6 7    │8 9 10 11  │
├───────────┼───────────┼───────────┤
│12 13 14 15│16 17 18 19│20 21 22 23│
└───────────┴───────────┴───────────┘
   2 <@] rank [ i.2 3 4
┌─────────┬───────────┐
│0 1  2  3│12 13 14 15│
│4 5  6  7│16 17 18 19│
│8 9 10 11│20 21 22 23│
└─────────┴───────────┘

Everything is tacit (and fixed) with the exception of 3 : 'y (`:6) ',

   _66 [\ (5!:5)<'rank'
`((((("(62))((`('')) (&((<@:((,'0') ,&:< ]) , (,<,'&') , (,<,',')"
_)@:(<@:((0;1;0)&({::)))@:[)) ((`(<(,'0');_))(`:6))))(`:6))((&,)(@
:(,&:(<@:((,'0') ,&:< ]))))))(3 : 'y (`:6) '@:(1&({ ) , <@:((0;1;0
)&({::)) , (<'"') , <@:(1&({ ) , <@:((0;1;1)&({::)) , 2&({ )) , 2&
({ ))@:))

In other words, if we can make a tacit version of {{ y `: }} then the
problem of referring tacitly to the arguments x and y is solved.  However,
making a tacit version of the verb train is far from trivial as far as I
can see.

Now, let us continue with an old j8xx interpreter, say j807, and proceed as
before but defining train and rank as,

   train=.  (<'`:') (0:`)(,^:)&6

   rank=. train o (xx , uu , (<'"') , < o (xx , vv , yy) , yy) f.xhgy

The rank conjunction cannot be defined because the form (c a) is missing in
j807 and one would have to settle with an adverb,

   1 (<@])`[ rank i.2 3 4
┌───────────┬───────────┬───────────┐
│0 1 2 3    │4 5 6 7    │8 9 10 11  │
├───────────┼───────────┼───────────┤
│12 13 14 15│16 17 18 19│20 21 22 23│
└───────────┴───────────┴───────────┘
   2 (<@])`[ rank i.2 3 4
┌─────────┬───────────┐
│0 1  2  3│12 13 14 15│
│4 5  6  7│16 17 18 19│
│8 9 10 11│20 21 22 23│
└─────────┴───────────┘

However, now everything is tacit,

   _66 [\ (5!:5)<'rank'
(((("62)(((`'')(&((<@:((,'0') ,&:< ]) , (,<,'&') , (,<,',')"_)@:(<
@:((0;1;0)&({::)))@:[)))((`_)(`:6))))(`:6))((&,)(@:(,&:(<@:((,'0')
 ,&:< ]))))))(,^:(0:``:)&6@:(1&{ , <@:((0;1;0)&({::)) , (<'"') , <
@:(1&{ , <@:((0;1;1)&({::)) , 2&{) , 2&{)@:)

Finally, a Jx interpreter has had the (c a) restored for many years; so,
one can define the rank conjunction as before,

   rank=. ` (train o (xx , uu , (<'"') , < o (xx , vv , yy) , yy) f.xhgy)
   1 <@] rank [ i.2 3 4
┌───────────┬───────────┬───────────┐
│0 1 2 3    │4 5 6 7    │8 9 10 11  │
├───────────┼───────────┼───────────┤
│12 13 14 15│16 17 18 19│20 21 22 23│
└───────────┴───────────┴───────────┘
   2 <@] rank [ i.2 3 4
┌─────────┬───────────┐
│0 1  2  3│12 13 14 15│
│4 5  6  7│16 17 18 19│
│8 9 10 11│20 21 22 23│
└─────────┴───────────┘

   _66 [\ (5!:5)<'rank'
` ((((("62)(((`'')(&((<@:((,'0') ,&:< ]) , (,<,'&') , (,<,',')"_)@
:(<@:((0;1;0)&({::)))@:[)))((`_)(`:6))))(`:6))((&,)(@:(,&:(<@:((,'
0') ,&:< ]))))))(,^:(0:``:)&6@:(1&{ , <@:((0;1;0)&({::)) , (<'"')
, <@:(1&{ , <@:((0;1;1)&({::)) , 2&{) , 2&{)@:))

( One can also define train as the Jx primitive ".. .)

Then again, there are a lot easier ways to define rank in Jx, one is to
custom made it following the pattern I outlined in my previous post; the
easiest way is to produce it automatically using a couple of utilities (xi
and xconjy), these are similar to (xi and xadvy) which appear in the wicked
tacit toolkit which I have posted a few times before.  This is how it works,

   rank=. ([: u v X Y 'X u " (X v Y) Y' xi) o (> o {. , }.) f.xconjy

   1 <@] rank [ i.2 3 4
┌───────────┬───────────┬───────────┐
│0 1 2 3    │4 5 6 7    │8 9 10 11  │
├───────────┼───────────┼───────────┤
│12 13 14 15│16 17 18 19│20 21 22 23│
└───────────┴───────────┴───────────┘
   2 <@] rank [ i.2 3 4
┌─────────┬───────────┐
│0 1  2  3│12 13 14 15│
│4 5  6  7│16 17 18 19│
│8 9 10 11│20 21 22 23│
└─────────┴───────────┘

   _66 [\ (5!:5)<'rank'
(1?:(<(,'0');<)) ` (1?:(<(,'0');<)) (((1?:(<(,'0');<))(&(((<<1 4 0
 5),(<<;._1 ' X u " ( v Y )'),(<(<0),(<1),(<2),(<0;4;5),<5),<1 1 1
 1)&((1&({::) (?:(<'@.')) 2&({::))@:(<@:((0 (0 {:: ])`(<@:(1 {:: ]
))`(2 {:: ])} ])@:(4 0 1&{)) 1} ])@:((<@:(3&({::) # 4&({::)) 4} ])
^:(0 e. 3&({::)))@:(, <))@:("..^:_1&.>)@:(>@:{. , }.)@:,)))(@:(,&<
)))

It might not be as concise as a custom-made version but it is tacit and
fixed which means that it would be happily minding its own business without
bothering or being bothered by other entities.

Not that this is out of the way...

> > 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

Have you tried,

https://app.element.io/#/room/#bqn:matrix.org

?  I guess Marshall and others would like to know about any issues and try
to help.  Although Marshall is still active in the programming forum I
suspect he does not subscribe to the chat forum and probably has not seen
these posts.

> (It seems like your [: ]: are a form of quoting; and I expect they do
> not compose?)

[: is just the verb cap and used as a delimiter, ]: is a curried adverb
that takes a variable number of arguments and emulates strand notation (it
is similar to ]sb also from the wicked tacit toolkit).

   [: ^ - *~ ]: NB. Boxed list of verbs
┌─┬─┬──┐
│^│-│*~│
└─┴─┴──┘

   [: 1 2 3 +/ (\<) (<adv@:) ]:  NB. Boxed list of a noun, verb, adverb,
and a conjunction
┌─────┬──┬─┬──┐
│1 2 3│+/│\│@:│
└─────┴──┴─┴──┘

Since ]: is an adverb it can compose.  The xi adverb shown earlier has the
form (]: a).

> 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.)

Mind you, I do not have an academic computer science background.  I have no
idea what a term-rewriter is but I will look it up.

> 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

Touché :)  Actually, originally I had written,

   (?:(<adv@:)) &>/ [: ^ - *~ ]:
^@:(-@:(*~))

But I decided to keep it simple :D


On Mon, Dec 27, 2021 at 12:17 AM Elijah Stone <[email protected]> wrote:
>
> 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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to