[Jprogramming] Problem with adverbs

2022-07-18 Thread 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 ?

Re: [Jprogramming] Tacit definitions of adverbs and conjunctions ?

2022-07-15 Thread Jacques Bailhache
A2%20%2B%20thendouble%203%0A2%20%2B%20%2B%3AthenA%203%0A2%20%2B%20thenAfter%20%2B%3A%203%0A%0A2%20%2B%20explicitA%20thenAfter%20%2B%3A%203%0A%0A%2B%20explicitA%20thenAfter%20%2B%3A%0A%2B%20%20%2B%3A%20thenA%0A >> >> >> >> On Saturday, July 2, 2022, 06:15:29 a.m. EDT, Jacques B

[Jprogramming] Combinatory logic in J

2022-07-02 Thread Jacques Bailhache
I am trying to implement combinatory logic in J. I succeeded for combinators I and K : ap =: 4 : 'x @.(]@1) y' I =: ]`] I ap 5 5 K =: ]`(3 : ']`(]@y)') (K ap 6) ap 8 6 but I don't see how to implement the combinator S. It must satisfy : ((S ap a) ap b) ap c = (a ap c) ap (b ap c)

[Jprogramming] Problem with < (box) and > (open)

2022-07-02 Thread Jacques Bailhache
According to https://www.jsoftware.com/help/dictionary/d020.htm : Open is the inverse of box, that is, ><]) 123 0 (>(<])) 123 1 How do you explain I get different results ? -- For information about J forums see http://www.jsoft

[Jprogramming] Tacit definitions of adverbs and conjunctions ?

2022-07-02 Thread Jacques Bailhache
If I understood correctly : - A monad applies to a noun and produces a noun - A dyad applies to two nouns and produces a noun - An adverb applies to a verb or a noun and produces a verb - A conjunction applies to two verbs or nouns and produces a verb but does there exist something that produce

[Jprogramming] Problem with @ (Atop)

2022-06-27 Thread Jacques Bailhache
According to https://www.jsoftware.com/help/dictionary/d620.htm : x u@v y ↔ u x v y But : 1 2 3 +/@* 4 5 6 4 10 18 +/ 1 2 3 * 4 5 6 32 Why does it give different results ? -- For information about J forums see http://www.jsof

[Jprogramming] Fork does not work

2022-06-22 Thread Jacques Bailhache
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) yevaluates as(f y) g (h y) I define this dyad : appliedto =: @.(]@1) and this monad : mult =: 3 : ']`(* & y)' Here is an example using these funct