Let us assume, for the sake of the argument, that the dictionary explicitly
forbids the construction of the verb (agenda=. ]^:(1:`(<'@.'))).

So, we are entering a forbidden world...

Let us solve the long-standing problem of how to pass tacitly x and y into
modifiers (see,
http://www.jsoftware.com/pipermail/programming/2010-November/021090.html,
http://www.jsoftware.com/pipermail/programming/2010-November/021108.html and
http://www.jsoftware.com/pipermail/programming/2010-November/021185.html)
by implementing the dynamic rank adverb:

x (u`v) rank y ↔ x u " (x v y) y,

pw=. (<@:((,'0') ,&< ])&.>@:(2 3&{) 2 3} ])@:(,&(<'"')@:,)
  NB. preparing the words u v x y " for the agenda

as=. &((<2),(<0),(<4),(<<2 1 3),<3) NB. the agenda structure of x u " (x v
y) y

ea=. agenda as @: pw NB. executing the agenda

rank=. (& (ea f.)) (@:(,&<)) NB. wrapping the execution of the agenda

   1 ((<@])`[) rank i.2 3 4
┌───────────┬───────────┬───────────┐
│0 1 2 3    │4 5 6 7    │8 9 10 11  │
├───────────┼───────────┼───────────┤
│12 13 14 15│16 17 18 19│20 21 22 23│
└───────────┴───────────┴───────────┘
   2 ((<@])`[) rank i.2 3 4
┌─────────┬───────────┐
│0 1  2  3│12 13 14 15│
│4 5  6  7│16 17 18 19│
│8 9 10 11│20 21 22 23│
└─────────┴───────────┘

Notice that in this framework (agenda) returns a noun; at least it is not
purposely designed to return anything else in this instance. Can one
re-write rank without (agenda)?  Sure, one could just re-write (tacitly)
the verb (agenda). :) Can one write tacitly (rank) as a conjunction? I do
not think so, although one could bring back (see,
http://www.jsoftware.com/pipermail/programming/2012-February/027337.html)
the old train (conj adv) and just write the conjunction as (`rank);
never mind, adverbs are as powerful as conjunctions .

"O wonder! How many goodly creatures are there here!"



On Mon, Jan 28, 2013 at 11:27 AM, Jose Mario Quintana <
[email protected]> wrote:

>
> Did anybody mention disaster? Yes! ;)
>
> j602/2008-03-03/16:45
>
>    3!:1 @: < @: (]^:(1:`(<'@.'))&0 @: <) '.'
>
> On Sat, Jan 26, 2013 at 5:25 PM, Henry Rich <[email protected]> wrote:
>
>> This whole idea of verbs returning any part of speech seems like a
>> disaster.  Perhaps after reflection it will be workable, but I would start
>> by assuming that Ken and Roger weren't just thoughtless in restricting the
>> range of verbs.
>>
>> It is pretty basic that every name must have a part of speech; otherwise
>> how can you parse?  And if verbs are unrestricted, if I see
>>
>> q =: V1 V2 V3
>>
>> what part of speech can I assign to q?
>>
>> I think it's a bug and should be fixed.
>>
>> I do wish I had the old tacit language back, though.
>>
>> Henry Rich
>>
>>
>>
>> On 1/26/2013 5:03 PM, Marshall Lochbaum wrote:
>>
>>> First, let me say: wow. Using a (or the more general dont from Dan's
>>> post, which I will use and call d), we can PUT ANY J OBJECT IN A BOX.
>>> This means it can be passed around as a noun and invoked in an explicit
>>> context.
>>>
>>>     d =. (]^:(1:`(<'@.')) nest2Box)@:gTxt
>>>     ]infix =: <@d '/'
>>> ┌─┐
>>> │/│
>>> └─┘
>>>     + (>infix) 3 4 5
>>> 12
>>>
>>> As long as we are inside the same tacit verb where d was called, its
>>> output will be treated as a noun, despite the fact that it isn't:
>>>
>>>     d@> '@&'
>>> @
>>>     ([: $ d@>) '@&'
>>> 2
>>>     ([: |. d@>) '@&'
>>> &
>>>     ([: (<"0) 3 3 $ d@>) '@&'
>>> ┌─┬─┬─┐
>>> │@│&│@│
>>> ├─┼─┼─┤
>>> │&│@│&│
>>> ├─┼─┼─┤
>>> │@│&│@│
>>> └─┴─┴─┘
>>>
>>> Note that this clearly shows that the output of d@> '@$' is still a
>>> list, even though it's displayed and treated as a single conjunction.
>>> Once we exit the verb into an explicit context, the parser figures out
>>> that it is dealing with a non-noun and starts treating it like one.
>>>
>>>     use =: 3 : 'y 2 3 4'
>>>     use@:d '+/'
>>> 9
>>>
>>> I don't think it's possible to use the result of d in a tacit context,
>>> but I could be wrong. Of course explicit helper verbs that take boxed
>>> things and apply them to other boxed things could be used, and they
>>> could even be made polymorphic using 3!:0 .
>>>
>>> This is, of course, a bug. I can't find anywhere in the dictionary where
>>> it says a verb must return a noun, but it's assumed throughout, and
>>> explicit verbs are specifically made to throw a domain error rather than
>>> return something that's not a noun. However, it's really cool and quite
>>> possible useful--passing arbitrary J objects through verbs without the
>>> overhead of gerunds or the hassle of names is very cool.
>>>
>>> Marshall
>>>
>>> On Sat, Jan 26, 2013 at 07:58:49AM -0500, Raul Miller wrote:
>>>
>>>> On Sat, Jan 26, 2013 at 1:38 AM, Jose Mario Quintana
>>>> <[email protected]**> wrote:
>>>>
>>>>> I guess this is the final proof that given J and a sufficiently
>>>>>> POWERful
>>>>>> AGENDA, you can DO anything!
>>>>>>
>>>>>
>>>>>     agenda=. ]^:(1:`(<'@.'))
>>>>>     (atop=. (<'@') agenda 0)
>>>>>
>>>>
>>>> Or:
>>>>
>>>>     a=: ]^:(1:`(<'@.'))&0@<
>>>>     atop=: a '@'
>>>>     type 'a'
>>>> +----+
>>>> |verb|
>>>> +----+
>>>>     type 'atop'
>>>> +-----------+
>>>> |conjunction|
>>>> +-----------+
>>>>
>>>> The pun is different, of course.
>>>>
>>>> Of course, the results are not necessarily consistent:
>>>>
>>>>     a&.> '@&'
>>>> +-+-+
>>>> |@|&|
>>>> +-+-+
>>>>     a&> '@&'
>>>> @
>>>>
>>>> But I suppose that since we already have inconsistent behavior for
>>>> displaying complex objects, maybe that's ok?
>>>>
>>>> --
>>>> Raul
>>>> ------------------------------**------------------------------**
>>>> ----------
>>>> For information about J forums see http://www.jsoftware.com/**
>>>> forums.htm <http://www.jsoftware.com/forums.htm>
>>>>
>>> ------------------------------**------------------------------**
>>> ----------
>>> For information about J forums see 
>>> http://www.jsoftware.com/**forums.htm<http://www.jsoftware.com/forums.htm>
>>>
>>>  ------------------------------**------------------------------**
>> ----------
>> For information about J forums see 
>> http://www.jsoftware.com/**forums.htm<http://www.jsoftware.com/forums.htm>
>>
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to