2 ms·
The .end() occurs because the approach taken procedural construction via a "linear" path. And that's because that maps nicely to the chained.function().syntax()
by kazinator 6y ago
The .end() occurs because the approach taken procedural construction via a "linear" path. And that's because that maps nicely to the chained.function().syntax(). That gets ugly if the terms have multiple arguments.
(S (NP (N DOG))
(VP (V KICKS))
(NP (N MAN)))
becomes:
(S DOG.N().NP()
KICKS.V().VP()
MAN.N().NP())
so far not bad, but now we deal with S, that now becomes a method of DOG.(N).(NP).
DOG.N().NP().S(KICKS.V().VP(),
MAN.N().NP())
The main connective S is now buried in the middle. We start with DOG, a fourth-level leaf element, make a N out of it, the NP, and now we start a sentence construction, where we bring in other parts. The structure reveals the evaluation order, not the actual structure.
BTW, the TXR Lisp version of this syntax is a tad more readable:
DOG.(N).(N).(S KICKS.(V).(VP)
MAN.(N).(N))
Even when we have obj.fun(arg) as a given, we should at least move the parenthesis before the function: obj.(fun arg).