Yes, sorry, I pasted the wrong excerpt from my J session (you can see the 
example I executed had the adverb named yyy before I pun-ified it).

It's also worth pointing out that this particular "tacit adverb" is just a 
painfully convoluted way of writing 2 : ']`[email protected]' so we don't have to use : and 
named arguments. 

In other words, we're quoting and executing code just to avoid ... quoting and 
executing code.

-Dan

Please excuse typos; composed on a handheld device.

On Oct 7, 2013, at 6:09 PM, Jose Mario Quintana <[email protected]> 
wrote:

>   shanghai=.(`]) (`(;:'`@.')) (@.(0 2 1 3))
>   (0=L.) < shanghai 2
> 2
>   (0=L.) < shanghai <2
> ┌───┐
> │┌─┐│
> ││2││
> │└─┘│
> └───┘
> 
>   Shanghai=. (]`) (`(;:'`@.')) (@.(0 2 1 3))
>   (0=L.) < Shanghai 2
> ┌─┐
> │2│
> └─┘
>   (0=L.) < Shanghai <2
> ┌─┐
> │2│
> └─┘
> 
>   :)
> 
> 
> 
> On Mon, Oct 7, 2013 at 4:23 PM, Dan Bron <[email protected]> wrote:
> 
>> Pascal asked:
>>> How to make this conjunction tacit
>>> coerce =: 2 : ']`[email protected]'
>> 
>> 
>>           coerce =: ^:
>> 
>>           < coerce (0=L.) 2
>>        +-+
>>        |2|
>>        +-+
>>           < coerce (0=L.) <2
>>        +-+
>>        |2|
>>        +-+
>> 
>> This particular coercion is also available as a ready-made utility in the
>> standard library as "boxopen" and its cousin "boxxopen" (which is the same
>> except it leaves empty arguments unboxed).
>> 
>> Note that it was trivial to write coerce tacitly because we have a
>> primitive conjunction that fits the bill (obviating the need for a
>> user-defined conjunction). In the general case, it is not possible to write
>> tacit conjunctions.  To understand why, read through section §II.F in the
>> DoJ, and note that while there are rules for producing tacit verbs (e.g.
>> "fork" for +/ # %) and adverbs (e.g. "adverb train" for /\) there are no
>> rules which produce conjunctions.
>> 
>> That said, it may be possible to synthesize or simulate a tacit
>> conjunction through a series of tacit adverbs, e.g.:
>> 
>>           shanghai=.(`]) (`(;:'`@.')) (@.(0 2 1 3))
>> 
>>           (0=L.) < yyy
>>        <`]@.(0 = L.)
>> 
>> But these tend to be very convoluted, difficult to both write and
>> understand, and will commonly involve some degree of quoted code anyway, so
>> it is just as well (actually, better) to write them explicitly in the first
>> place.
>> 
>> One more note: depending on your needs, you might prefer (0<L.) to (0=L.)
>> . The former boxes only unboxed nouns; the latter boxes unboxed nouns as
>> well as anything with a depth _greater_ than one (e.g. try <<2, <<<2, etc).
>> 
>> -Dan
>> 
>> PS: In the good old days, §II.F contained a long and rich table of
>> interpretations for various trains (i.e. sequences of words/word-classes)
>> which made it possible, among other things, to write conjunctions tacitly.
>> 
>> Again,
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to