An adverb only evaluates once it is given a noun/verb left argument.
(adverb adverb) is a form of speech that doesn’t get evaluated,
just like verbal trains (verb verb verb)

Put another way: what shall 'u' be in advsuc when you say
'advsuc applyto1'? 'u' always comes in from the left
but there is nothing to the left of advsuc.
If there were anything to its left, however, how would '1 u' work?
if u is a noun, that’s bogus: there is no sane interpretation for
the form (noun noun) in J.
If u is a verb, it needs a right argument but there isn’t any.

A third approach:
you want advsuc to take a noun and produce a noun
(so it could be a verb)
but the way you wrote it, it looks like it wants to take
a verb left argument, and the result gets noun arguments,
e.g.
   7 8 9 +: advsuc 4
0 1 1
(are 7 8 9 greater than or equal to `>:` the doubled `+:` value of 4?)
you want applyto1 to take some 'u' from the left and produce what?
you say 'advsuc applyto1', so 'u' is an adverb. There is no way
to take an adverb as an operand (but there are ways to make nouns
from adverbs and you can manipulate them if you’re into that).

There is a quite nonsensical way to make it work:
first of all, applyto1 should actually apply something to 1
   applyto1 =: 1 : 'u 1'
and now you may say
   ] applyto1 advsuc
2
where ] can be replaced by anything with fixed point 1, e.g. the verb *:
   *: applyto1 advsuc
2



Why do you define computations that should obviously be verbs
as adverbs?

If you want to use an adverb here, take that new applyto1
and say
   >: applyto1
2

That’s about the best I can come up with solving this “problem”
using an adverb.

I hope all of this is comprehensible and making some sense to you.

Am 18.07.22 um 10:03 schrieb Jacques Bailhache:
I define an adverb which gives the successor of its argument :

    advsuc =: 1 : '>: u'
    1 advsuc
2

Then I define an adverb which applies its argument to 1 :

    applyto1 =: 1 : '1 u'

Then I apply it to the adverbial successor :

    advsuc applyto1
advsuc applyto1

Why isn't it evaluated to 2 ?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

--
----------------------
mail written using NEO
neo-layout.org
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to