If this counter existed, it would need to be internal to ;:

Or, if the parsing algorithm were to be implemented in J, this part of
the algorithm might be expressed using +/\.

But there's a potential interaction between quote handling and comment
handling and dd brace handling and line end handling -- for example,
this is a valid direct definition: {{'{{'}}, and so is this:

{{ {{)n
'
}}
}}

So a forth based parser might actually be convenient here.

Or, a native J parser might be most conveniently expressed as an
explicit definition with one (or maybe more) explicit loop(s)...

Thanks,


--
Raul


On Wed, Nov 4, 2020 at 12:32 PM Hauke Rehr <[email protected]> wrote:
>
> I don’t quite understand.
> Do you mean instead of pushing to the stack,
> you increment the counter,
> and instead of popping from the stack,
> you decrement the counter?
> So the counter needs to be part of the respective
> locale’s (namespace’s) name, right?
>
> (stack based evaluation always reminds me of FORTH, sigh)
>
> Am 04.11.20 um 18:24 schrieb Raul Miller:
> > I am not sure what you mean here.
> >
> > In the current 902 beta-k, I get an error and not a tokenization with
> > an unbalanced quote:
> >
> >   ;:'asf''asdf'
> > |open quote
> >
> > If you are talking about the {{ }} nesting -- the implementation
> > doesn't actually use the ;: monad for that. Instead, it uses a
> > technique where the entire nested {{...}} structure is essentially
> > handled as a single token.
> >
> > You can't do that with the ;: dyad, because nesting requires
> > stack-like behavior (though, since there's only one kind of nesting, a
> > numeric counter could serve as the "stack structure").
> >
> > (I hope I'm making sense?)
> >
> > Thanks,
> >
>
> --
> ----------------------
> mail written using NEO
> neo-layout.org
>
> ----------------------------------------------------------------------
> 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