Dan writes:
"
In other words, we're quoting and executing code just to avoid ... quoting
and executing code.
"

However, the tacit sentence is not being executed within an explicit
environment and that could have some benefits; for example, the visibility
of the names n, m, u, v, x or y which could be, admittedly to a very few of
us, priceless (not to mention "Constrained writing can be a source of great
beauty").

 ;)


   x=. @[
   y=. @]

   kidnap=. (0:`)(,^:)

   agenda=. (<'@.') kidnap NB. Cooking with your very own ingredient

   ( UpToTheSea=. (((]`'') , <x) agenda 0 agenda~ <y)&>/ f. ) u`v
]`[email protected]

   ( UpToTheSea <`(0 = L.) ) 2
┌─┐
│2│
└─┘
   ( UpToTheSea <`(0 = L.) ) <2
┌─┐
│2│
└─┘

   UpToTheSea
(((,<,']') , <@[) ,^:(0:`@.) 0 ,^:(0:`@.)~ <@])&>/


Ah, that exhilarating feeling of driving well above the speed limit (famous
last words before the crash?)!




On Mon, Oct 7, 2013 at 8:50 PM, Dan Bron <[email protected]> wrote:

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