Yes, I see.

appliedTo is an adverb, because it's a partially applied conjunction, i.e.
the result of applying conjunction @. to verb (]@1).
When you apply appliedTo to mult, the conjunction is evaluated, i.e. mult
@. (]@1).
This gives you a domain error because @. expects a noun, specifically a
gerund, and not a verb.

   >type <'appliedTo'
adverb

Forks only work for verbs, although recently, modifier trains have been
reintroduced in j903 (
https://code.jsoftware.com/wiki/Vocabulary/ModifierTrains). I wouldn't
exploring modifier trains if you just started using J :).
They are quite mind-bending, and relatively unneeded in general (though the
ones that were already in j902, that is chains of adverbs and "verb
conjunction" and "conjunction verb" do come in handy).

Hope this helps,

Jan-Pieter

On Wed, 22 Jun 2022, 13:36 Jacques Bailhache, <jacques.bailha...@gmail.com>
wrote:

> Hi,
> I am learning J and I don't understand something about forks.
> According to https://www.jsoftware.com/help/primer/fork.htm :
>    (f g h) y    evaluates as    (f y) g (h y)
> I define this dyad :
>    appliedto =: @.(]@1)
> and this monad :
>    mult =: 3 : ']`(* & y)'
> Here is an example using these functions :
>    (mult 10) appliedto (+: 10)
> 200
> Normally it should be equivalent to this fork but it does not work :
>    (mult appliedto +:) 10
> |domain error
> |   (mult     appliedto+:)10
> Do you understand why I get this error ?
>
> Regards,
> Jacques
> ----------------------------------------------------------------------
> 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