[Jprogramming] Undocumented(?) feature of @.

Roger Hui rhui000 at shaw.ca
Tue Mar 13 08:00:31 HKT 2007


The usage exploits documented features.  The
interpretation is as follow:

noun conj  is an adverb.  Therefore (+:`*:@.) is
an adverb.  (+:`*:@.) 2 4 6 is  adverb noun  and
is a syntax error.  0 (+:`*:@.) 2 4 6 is interpreted
as (0 (+:`*:@.)) 2 4 6 , wherein  (0 (+:`*:@.)) is 
(+:`*:@.0) and is +:, whence  (0 (+:`*:@.)) 2 4 6
<->  +: 2 4 6  <->  4 8 12 .



----- Original Message -----
From: Ronan Reilly <ronan at cs.nuim.ie>
Date: Monday, March 12, 2007 4:30 pm
Subject: [Jprogramming] Undocumented(?) feature of @.

> Having given my students a simple J assignment that required the 
> use of @.,
> some of them came up with solutions that used what appears to be an
> undocumented feature of the conjunction:
> 
> As you might expect...
> 
>   (+:`*:@.) 2 4 6
> |syntax error
> |       (+:`*:@.)2 4 6
> 
> but...
> 
>   0 (+:`*:@.) 2 4 6
> 4 8 12
> 
>   1 (+:`*:@.) 2 4 6
> 4 16 36
> 
> It appears that [ is assumed if the rhs of the conjunction is 
> omitted.  Is
> this correct or am I missing some subtle J generalisation?


More information about the Programming mailing list