You may already be aware that J's tokenizer keeps . and :'s ending a token as 
part of that token

   ;: 'name. 3 4 name::fd' 
┌─────┬───┬──────┬──┐ 
│name.│3 4│name::│fd│ 
└─────┴───┴──────┴──┘ 

we could take advantage of this tokenizing by invoking special parsing rules 
based on the presence of such a suffix.

Two important specific suggestions:

definedname. would apply to the dyadic or modifier definedname the left 
argument quoted to either the beginning of the line or until a token of [: ( or 
 preferably ]:) or =: is reached.  ex.

2 ]: +: @+/ myadv. 3  would be equivalent to:
2 '+: @+/' myadv 3

The need for this is mainly for deferring parsing to an adverb's locale, and 
avoiding nested quotes.  It would also enable a holistic strand notation.  It 
also allows for "line adverbs" that I call macros

it would also be possible to nest some of these.  example: 
+ ]: insert assign. / eval. 1 2 3 
would be equivalent to: 
+ '''insert'' assign /' eval 1 2 3 
(6) 

if definedname. is a noun, then one option is error, but another is appending 
the quoted left expression to 
' definedname'

The other suggestion is:

name: would invoke name with an implied a: right argument (or '').  This would 
allow any verb to be used as a noun, and so simplify "lazy noun" evaluations, 
or just let the verb use default parameters.

so 
coname: f y
would be equivalent to:
(coname@:] '')  f y

though its possible to intend for a verb to have a dyadic left argument with 
null right argument, this is extremely unusual, and so probably doesn't need 
support.

f@mynoun: g y

would be equivalent to:  (if mynoun is a noun)
(f@] mynoun) g y

the benefit of this proposal would be to allow verbs that behave as nouns, and 
also nouns that act as constant verbs.  The : suffix makes it consistent with 
0: and 1: verbs.  A benefit of the interchangeability is that a "lazy noun" 
(verb that evaluates without parameters but from external state) might "fix 
itself" (redefine self to a static noun) either after it is first called or 
under some other condition, and so calling code can benefit from uniform 
verb/noun calling semantics.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to