Sure, here's one example:
s0=: 1 :'m"_^:((<''0:'')=])"0 L:1'
s1=: 1 :'m"_^:((<''1:'')=])"0 L:1'
template=: 0:&.>/\.&.(,&1:)&.|.&.(<"_1) a0
t0=:1 :0
tC0 m
)
tC0=:2 :0
:
((<(0;1;0){::(<x)&,`'') s1 ({.u`'') s0 n)`:6 y
)
(i.2 2) +/ template t0 i.3
0 1
2 3
1 2
3 4
3 4
5 6
Hopefully this shows possibilities for other examples. In particular:
I could handle the 1: substitution differently. I do not like that t0
is doing the boxing of that argument (since that operation is specific
to this particular template), but I also do not like requiring that
value to be boxed for the derived adverb.
Unfortunately, we do not have anything like a left& or right& - I
could, of course write one, but I am not sure that that extra
complexity would help illustrate the concept I am trying to show here.
So... hopefully this quick sketch conveys the basic idea?
Thanks,
--
Raul
On Wed, Oct 25, 2017 at 5:12 PM, Jose Mario Quintana
<[email protected]> wrote:
> "
> Consider, for example, using the 0: and 1: verbs as placeholders in a
> gerund and substituting in a verb for the 0: argument and a boxed copy
> of a noun for the 1: argument in this gerund template:
> 0:&.>/\.&.(,&1:)&.|.&.(<"_1) a0
>
> hg gives us a way of defining these transformations as verbs, but we
> still need to define those verbs...
> "
> I am not quite sure what you mean by the above. Can you show some examples
> of the adverb, say t0, in action? Can you show its explicit definition?
>
> By the way, I am not arguing that hg is always easy to use; personally, I
> produce adverbs by other noncompliant means. I have been using hg mostly
> for producing examples for the forum. ;)
>
>
>
>
> On Wed, Oct 25, 2017 at 1:25 PM, Raul Miller <[email protected]> wrote:
>
>> On Wed, Oct 25, 2017 at 12:23 PM, Jose Mario Quintana
>> <[email protected]> wrote:
>> > RM> That said, describing the purpose of hg (and why one would want to
>> use
>> > RM> hg instead of av) is eluding me at the moment. Maybe when I wake up
>> > RM> some more I would be better prepared to address this.
>> >
>> > The hg specification states that the argument for the workhorse verb is
>> the
>> > atomic representation (ar) of hg's argument (which can be a verb or a
>> noun).
>>
>> (rest of message trimmed, so I can focus on this issue.)
>>
>> Yes, this is true. And the result of that verb is expected to be
>> (roughly speaking) an atomic representation of the result of the hg
>> derived adverb.
>>
>> But ... thinking this through... for this to be useful we should also
>> have some mechanism for replacing-at-depth, and we also need to be
>> able to chain in other operations.
>>
>> Consider, for example, using the 0: and 1: verbs as placeholders in a
>> gerund and substituting in a verb for the 0: argument and a boxed copy
>> of a noun for the 1: argument in this gerund template:
>> 0:&.>/\.&.(,&1:)&.|.&.(<"_1) a0
>>
>> hg gives us a way of defining these transformations as verbs, but we
>> still need to define those verbs...
>>
>> Thanks,
>>
>> --
>> Raul
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm