Good point, NB. is a multiletter inflected primitive.  And it is punctuation 
(even if it's in the Vocab), just like control words.

But if we could extend J's vocabulary could be extended by adding letters 
rather than inflections, why do we tend to do the exact opposite (viz {::, &.:, 
p.. etc).


Maybe the rule is that multiletter single accent words are punctuation and 
single letter multi accent are primitives?

I guess none of this matters for syntax highlighting, but it is a fun game.

-Dan



Please excuse typos; composed on a handheld device.

-----Original Message-----
From: "Sherlock, Ric" <[email protected]>
Date: Wed, 13 Jan 2010 16:13:50 
To: Programming forum<[email protected]>
Subject: Re: [Jprogramming] The role of the . in J words

> From: Dan Bron
> 
> 
> My gut says that the role of  .  in control words is different and more
> akin to (A), but I don't know if I could support such an argument.  But
> I do know that if I were writing a J interpreter, I would have separate
> rules for primaries and control words.  In broad strokes, something
> like
> 
>     primitive =: '[:graphic:]|([:graphic:]|[:alphanum:][.:]+)'
>     control_word =:  '[:alpha:]{2,}\.'
> 
> The latter could have been rendered '[:alpha:][:alpha:]+\.' But the key
> thing is that control words have 2 or more chars before the inflexion,
> and anything with a single char and and inflexion is a primary by
> definition (and of course primaries can be uninflected or inflected
> differently (using colon or multiple inflections), and control words
> are only recognized by the explicit interpreter, always end only with a
> single .  , are always lowercase except for user-defined parts of them,
> etc etc etc).  

Note that although there are currently no such primitives, the dictionary 
doesn't preclude primitives from having more than one character before the 
inflection, so I'm not sure that the distinction noted above between control 
words and primitives should be relied upon:

Names (used for pronouns and other surrogates, 
and assigned referents by the copula, as in 
prices=: 4.5 12) begin with a letter and may 
continue with letters, underlines, and digits.

A primary may also be an inflected name, as 
in e. and o. for membership and pi times.

http://www.jsoftware.com/help/dictionary/dict1.htm

In fact by that definition perhaps Control words are just a special case of 
primitive that are treated as punctuation in an explicit definition?

----------------------------------------------------------------------
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