Neville Holmes wrote:
>  The simplest cases (as far as I can remember from
>  about a decade ago) were to bring an operand in to
>  various places in a train.  Easy explicitly, very
>  difficult as tacit is, easy with the [. and ]. of
>  my suggestion - to explain/teach as well as to do.
 
Neville, I'm jumping into this late, and I only glanced over your original
thread lightly.  I will say I understand your desire & sympthize with it. 
I'm a tacit fan myself.  So forgive me if the following has already been
covered.

Perusing the thread, it seems to me that lots of people have indicated your
suggestion is problematic, but no one has said why outright.  In short,
your suggestion would mean more than defining a couple of new primitives,
it would involve some fundamental changes to J.  It might not even be
backwards compatible.

To do what you want,  [.].  couldn't be implemented as standard primitives,
no matter what their definition -- J's grammar itself would have to change
to treat them specially.  The analogy here is to  [:  .  That primitive
itself is nothing special, just a verb with no valid inputs.  But in order
to make  [: f g  work, J had to add a special grammatical rule.  There is
no conceivable definition of  [:  that would make it work as it does now,
without that special treatment.

Similarly, there is no conceivable definition of  [.].  that would make
them work the way we'd want, without special treatment by the parser.  So
you couldn't just add  [.  or  ].  (i.e. drop them into the Vocabulary),
you'd have to change the parse table (section E).  Or at least section F
(trains).

Perhaps an analogy with  [  and  ]  would clarify the situation.  Let's
say, instead of their current definition, we wanted those primitives to
function the way  x  and  y  do in explicit definitions (which is a common
[mis-]assumption new Jers make).  That is, we'd want to be able to express:

         sqrSum =: 4 : '%: x + y'

tacitly, without quoting any code (which both you and I shy from).  Well, a
new J user might be tempted to write:

         sqrSum =: %: [ + ]   NB.  [1]

What they don't realize is that  [ ]  aren't the same as  x y  .  The
latter are nouns, and the former are verbs.  Nouns can "operate" (produce
their value) independently of the context in which they're embedded.  But
verbs cannot.  Here, the  [  refers not to  x  but to  y  .  The verbs  []
 have no way of "jumping out of" their context to see the arguments to the
tacit verb.

The situation would be similar for any definition of  [. ].  .  Assuming
they were defined as conjunctions which just yield their left or right
argument respectively, they would suffer the same "problems" that  [ ] 
do, only to a greater degree (an operator's peripheral vision is even more
limited than a verb's).  That is, embedded in the middle of a tacit
operator, they would refer to the noun or verb immediately adjacent.  Not
to the argument(s) of the tacit operator.

In fact,  [. ].  once had exactly the definition just described.  They were
removed specifically because their use was so limited.  In fact the entire
trains table was removed (aside from hook, fork and adverb trains),
because J's grammar made writing tacit operators so convoluted that
operator trains' limited use didn't warrant their retention.  (If I were
King of J, I might've kept them, but I'm not.)

I'm sorry if you knew all that already, I just hadn't seen anyone say this
in so many words, during my brief perusal of the thread.

-Dan

[1]  I stole this example from  
http://www.jsoftware.com/pipermail/chat/2009-April/001741.html  .  Don
Watson's "S language" has some features (and problems) in common with your
proposal, though at a different levl.  The motivation seems similar, too.


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

Reply via email to