Kartik Agaram
Mariano Guerra
Doug Moen
12/02/2019, 1:23 PMEdward de Jong / Beads Project
12/03/2019, 2:44 AMMariano Guerra
Mariano Guerra
Edward de Jong / Beads Project
12/03/2019, 9:25 PMDoug Moen
12/04/2019, 12:32 AMthe idea of having adverbs was really interesting to me"verb" and "adverb" are just non-standard terminology for standard concepts. In functional programming, a verb is a function, and an adverb is a combinator (a function that takes a function as an argument, and returns another function as a result. For example, in functional languages, "map" is a combinator, which is exactly equivalent to the "each" adverb in APL. But if you look at the actual syntax of APL (or K), you see something interesting, which might relate to natural language. I don't think that left-to-right vs right-to-left evaluation order is a big deal. Almost every language has right-associative infix operators, APL just has more of them. What I find more interesting is that identifiers and operator symbols are treated the same way: they can be interpreted either as infix operators, or as arguments to an adverb. I don't see that in any other language family. APL classifies each named object as a noun, verb or adverb, and that classification affects how expressions are parsed. An adverb takes one or two verbs as arguments, and a verb takes one or two nouns as arguments. And that's interesting.
Kartik Agaram
Doug Moen
12/04/2019, 1:01 AMDoug Moen
12/04/2019, 1:32 AMh(g(f(x)))
In languages from the APL family, you use exactly the same notation, but the parentheses are optional, so you can also write:
h g f x
If you really believe that the problem with the above notation is that it is read right to left, then you should change Beads to have left-to-right function call notation.Doug Moen
12/04/2019, 2:05 AMx >> f >> g >> h is the same as h(g(f(x))
In practice, programs written in this style feel just like pipelines in the Unix shell. It's nice. Many other functional languages also have a left-to-right pipeline operator.