[Jprogramming] New in beta-r: old stuff
'Pascal Jasmin' via Programming
programming at jsoftware.com
Mon Sep 27 04:42:21 UTC 2021
> When you envision 'even longer modifier trains', you are implicitly
requiring a stack of more than 4 words.
which can be avoided by (auto)parenthesizing outer modifier train, such that there's always at most 4 tokens.
Do I understand the following expression to mean that modifier trains group left to right (somehow)?
@ @ + - @
(@ @ +) - @
@ @ + - @ /
((@ @ +) - @)/
/ @ @ + - @
|syntax error
| /@@ +-@
/ (@ @ + - @)
/((@ @ +) - @)
@ + @ - @
(@ + @) - @
shouldn't it group from the right?
On Sunday, September 26, 2021, 10:46:13 p.m. EDT, Henry Rich <henryhrich at gmail.com> wrote:
Since the goal was to make the old documents still usable, changes would
require strong arguments demonstrating their superiority. You are
pitting yourself against Ken Iverson: may the better man win.
I can assure you that whatever is in your 'templating system' had zero
influence on the design and implementation of {{ }} .
When you envision 'even longer modifier trains', you are implicitly
requiring a stack of more than 4 words.
Henry Rich
On 9/26/2021 10:34 PM, 'Pascal Jasmin' via Programming wrote:
> I've been working on an autoparenthesizing of modifier trains, with interpretations that would seem much more useful than the "old stuff". I don't have a good interpretation for A V train, so I guess it could stay as suggested. The following are what I'd prefer, added after -> ( = means equivalent)
>
>
> V0 V1 C2 conj V0 V1 (u C2 v) -> V0 (V1 C2) = V1 C2 V0
> A0 V1 V2 adv (u A0) V1 V2
> C0 V1 V2 conj (u C0 v) V1 V2 -> (C0 V1) V2 = A V2
> C0 V1 C2 conj (u C0 v) V1 (u C2 v) -> u (C0 V1) (C2 v)
> A0 A1 V2 conj (u A0) (v A1) V2 -> (u A1 A2) V2
> N0 C1 A2 adv N0 C1 (u A2) -> u (N0 C1) A2
> N0 C1 C2 conj N0 C1 (u C2 v) -> u (N0 C1) (C2 v) = ((N0 C1 u) C2 v) = (v (u (N0 C1)) C2) parentheses not needed.
> V0 C1 A2 adv V0 C1 (u A2) -> u (V0 C1) A2
> V0 C1 C2 conj V0 C1 (u C2 v) -> same as N C C
> A0 C1 N2 adv (u A0) C1 N2
> A0 C1 V2 adv (u A0) C1 V2
> A0 C1 A2 conj (u A0) C1 (v A2) -> u A0 (C1 v) A2
> A0 C1 C2 conj (u A0) C1 (u C2 v) -> ((u (A0) (C1 v)) C2) = adverb
> C0 C1 N2 conj (u C0 v) C1 N2 -> v (u C0)(C1 N2) = (u C0 v)(C1 N2)
> C0 C1 V2 conj (u C0 v) C1 V2 -> same as above
> C0 C1 A2 conj (u C0 v) C1 (v A2) -> ((u C0 v) C1) A2 = adverb
> C0 C1 C2 conj (u C0 v) C1 (u C2 v) -> ((u C0 v) C1) C2 = conjunction A C
> A0 C1 adv (u A0) C1 u (adverbial hook) -> (u A0) C1 v
>
> The beauty of the suggested forms is that there is not much to remember, and allows for parenthesless forms.
>
> V0 V1 C2 -> V0 (V1 C2) is just the only valid parenthesization of the left expression.
>
> C0 vn C2... More modifiers -> (C0 vn) C2...M ie. when a nv term is between 2 conjunctions it binds to the left one.
>
> Whenever C vn appears, (C vn) is bound is the only special rule. It binds ahead of other modifiers to right.
>
> To permit even longer modifier trains, while keeping the 4 token stack:
>
> C0 C1 M2 M3 -> C0 C1 (M2 M3)
>
> Reusing parameters in multiple modifiers seems stranger than the still strange inserting them seemingly arbitrarily within a modifier train. If these are useful, they are best made into a purpose modifier rather than as default parsing rules that will confuse.
>
> A cool enhancement would be multiple right bindings to modifier trains that contain multiple conjunctions:
>
> (C0 C1 M) v -> (C0 v) C1 M ie. A conjunction modifier train binds v to the leftmost (unbound) conjunction.
> ((C0 v) C1 M) v2 -> (C0 v) (C1 v2) M = (C0 C1 M) v v2
> u ((C0 v) C1 M) -> ((u C0 v) C1) M ie binding from left or right provides options similar to "old stuff"
>
> templating system that may have formed basis for {{ }}, and allows for rich custome modifier trains: http://www.jsoftware.com/pipermail/programming/2020-September/056558.html
>
>
> On Sunday, September 26, 2021, 12:01:45 p.m. EDT, Henry Rich <henryhrich at gmail.com> wrote:
>
>
>
>
>
> Nostalgic old-timers will be happy to see the return of Modifier Trains,
> such as (@/), which were in early J but were deleted long ago. See
> https://code.jsoftware.com/wiki/Vocabulary/fork#invisiblemodifiers .
>
> These trains were one of Ken Iverson's elegant brilliancies. Few used
> them, and they are not needed, because anything they do can also be done
> with explicit modifiers ({{ u @ v/ }} is equivalent to (@/)). No one
> need rush out and look at them.
>
> We have brought them back because to do so was easier than updating all
> the old J literature that refers to the forms. And because they're cool.
>
> Henry Rich
>
--
This email has been checked for viruses by AVG.
https://www.avg.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list