Good point, colorization.  I never thought about that.

The big difference between Fast Functions and 3 : functions is that Fast Functions are recognized when a script is loaded, instead of when the 3 : is executed.  It is the fact that 3 : is executed like any other conjunction that prevents nesting of multiline verbs: the nested verb can't be defined until it is executed, and by then its definition is long gone.

The innermost (. ).  is analyzed and replaced by (m : string). The process continues for all nesting levels.  This completes the prepass.

The generated verbs - (m : string) forms - are handled as they are now, when the : is executed.  That means nested verbs are not processed until they are encountered during execution.

Linear representation is used to make the (3 : string) form atomic.

Yes, you would need to balance (. .

Henry Rich

On 9/26/2017 4:02 PM, Raul Miller wrote:
Prepass means essentially that this happens after word formation but
before parsing. That does eliminate some problems, but creates new
ones. It also suggests that you would be supporting explicit control
words. But it also means that you need to put a lot more thought into
how these would be represented (and stored) - there's no inherent
point to using linear representation to "unparse" here.

(Do inner (. ). definitions get reparsed every time the outer
expression gets evaluated? That might be the simplest approach, but
does require significant changes in explicit handling.)

Multiline means that you get into behavior somewhat like you get when
m :0 appears on a line. But getting out of that might be more
complicated than it is now (because you might not know if you need ).
or a sequence of them or ) to end it - for example after pasting
something big into your session).

The complexities introduced by multi-line probably means that
interactive environments would want to colorize (. ). definitions
(especially incomplete definitions while being entered) based on the
presence/absence of mnuvxy seen so far (probably not the current line
though).

Thanks,


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to