There is no simple way to "@:/" because a conjunction cannot be an adverb's
argument...  Unless one cheats and cloaks the conjunction (@:) as a verb
(at), at least in j807.

Personally, I prefer a multiple adverb (At) faking strand notation together
with a guard ([:) instead of using a gerund because it looks cleaner, see
[0] near the bottom; for example,

   [: alpha beta gamma delta At
alpha@:beta@:gamma@:delta

   [: echo # ucp At
echo@:#@:ucp

The definition of At in [1],

At=. train o (at~&:>/) o |. f.sb  NB. (Curried adv)

is essentially implementing "@:/" operating on an illegal list of boxed
verbs produced by the adverb sb (it is a little more complicated than
expected to be able to handle the anomalous case of a single verb and to
take in account that a conjunction, @: in this case, associate the other
way around vs a verb).

I cannot see any reason, apart from being a somewhat tedious exercise, why
At could not be implemented explicitly or even tacitly in an orthodox
manner.

I only use At sporadically; what I use regularly is a convenient double
adverb taking multiple lines, a watered-down single adverb version (is) can
be found in [2]

   9!:14''
j901/j64/windows/release-e/commercial/www.jsoftware.com/2020-01-29T11:13:46

test is
  echo  NB. A standard library monadic verb
  #
  ucp   NB. Another standard library verb
)

   test
ucp@:#@:echo

The adverb is is wicked; yet, again, I see no reason why it could not be
implemented explicitly or even tacitly in an orthodox manner.

References

[0] [Jprogramming] Verb pipelines
    http://www.jsoftware.com/pipermail/programming/2010-June/019756.html

[1] [Jprogramming] tacit
    http://www.jsoftware.com/pipermail/programming/2020-June/056075.html

[2] Dining philosophers
    https://rosettacode.org/wiki/Dining_philosophers#J


On Thu, Jul 9, 2020 at 5:26 AM Hauke Rehr <hauke.r...@uni-jena.de> wrote:
>
> Hello everybody,
>
> I wonder if there’s a simple way to “@:/“ a sequence of steps:
> say I want to apply verbs a,b,c,d,e in turn, I could say
> sequence =: 3 : 0
>    e d c b a y
> )
> turning sequence tacit
> sequence =: e@:d@:c@:b@:a
> or
> sequence =: [: e [: d [: c [: b a
> (this is 13:’s suggestion)
>
> I’d rather have a kind of “/” working for conjunctions.
> (I’m quite sure one could do it on the ar level somehow
>   crossing the function/data representation border twice
>   but I’m not used to playing around with that)
> Maybe there is a way I don’t know of?
> Or a good reason to not have this kind of thing in J?
>
> --
> ----------------------
> mail written using NEO
> neo-layout.org
>
> ----------------------------------------------------------------------
> 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