My fault, I should have gone through the steps.
(Beware that gmail will mutilate the display of the results I am going
to show here. A lot of people got paid a lot of money for that design
and those design decisions, and for managing those people, so this
design flaw is probably not going to go be going away. I do have the
option of imposing a font description which would override that for
you, but the list software will [justifiably] strip that out. Anyways,
to work around this user interface feature, select the "Message text
garbled?" option from the upper right dropdown menu, and try to ignore
the irrelevant message about encoding.)
So...
Let's say that u v w ... will be + - * %. We want them in a list of
gerunds, and we also want [ and ] in the list, for x and y. We're
going to manipulate the list, though, so let's first just get them out
there:
[`+`-`*`%`]
┌─┬─┬─┬─┬─┬─┐
│[│+│-│*│%│]│
└─┴─┴─┴─┴─┴─┘
Next we want to replicate the x argument for each of our verbs. This
is not perfect, but we are getting closer to what we need:
({.,.}.) [`+`-`*`%`]
┌─┬─┐
│[│+│
├─┼─┤
│[│-│
├─┼─┤
│[│*│
├─┼─┤
│[│%│
├─┼─┤
│[│]│
└─┴─┘
Next, let's ravel that so we're back to a flat list:
({.,@,.}.) [`+`-`*`%`]
┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
│[│+│[│-│[│*│[│%│[│]│
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
Now, we just need to get rid of the rightmost [ in that list. We can
select the second to last element of a list using _2 { list. And, we
can delete from a list based on indexing by triple boxing our index:
((<<<_2){ {.,@,.}.) [`+`-`*`%`]
┌─┬─┬─┬─┬─┬─┬─┬─┬─┐
│[│+│[│-│[│*│[│%│]│
└─┴─┴─┴─┴─┴─┴─┴─┴─┘
By the way, any expression which gets us this list could be
substituted here. For example, here's a minor variation:
1|.1}.,@({.,.}.) [`]`+`-`*
┌─┬─┬─┬─┬─┬─┬─┐
│[│+│[│-│[│*│]│
└─┴─┴─┴─┴─┴─┴─┘
Anyways, now we just need to convert that into a verb train:
(((<<<_2){ {.,@,.}.) [`+`-`*`%`])`:6
[ + [ - [ * [ % ]
and we can apply it to some sample arguments:
10 ((((<<<_2){ {.,@,.}.) [`+`-`*`%`])`:6) 20
15
Is that correct? Easy enough to test:
10 + 10 - 10 * 10 % 20
15
I hope this helps,
--
Raul
On Tue, Jul 12, 2016 at 9:19 AM, dahn oak <[email protected]> wrote:
> Thank you, Raul. It's quite complicated for understanding yet, but I
> appreciate it!
>
> Tue, 12 Jul 2016 09:04:01 -0400
> Raul Miller <[email protected]>:
>> No, but you can make one.
>>
>> For example:
>>
>> x(((<<<_2){{.,@,.}.)[`u`v`w`...`])y
>>
>> I hope this helps.
>>
>> --
>> Raul
>>
>>
>> On Tue, Jul 12, 2016 at 8:38 AM, dahn oak <[email protected]> wrote:
>> > Hello, is there any language cunstruction that is equivalent to:
>> > x u x v x w ... y
>> > where x and y are the arguments of the construction and u,v,w,... is a
>> > sequence of dyadic verbs?
>> >
>> > I just don't want to duplicate my x argument many times. Specifically, I
>> > want to do something like 10,~10,.~10,10,.y where y is a scalar matrix to
>> > make a "border" for it (number 10).
>> >
>> > dahn oak - [email protected]
>> > ----------------------------------------------------------------------
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
> dahn oak - [email protected]
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm