The proposal would be an improvement over the workaround in that in the
derived adverb, a monadic rather than ambivalent function could be provided.
But the workaround solves the problem of forcing a dyadic call even when x
would not be used at all. An alternative would be to use this version for
monadic, and simpler (fewer ~) with dyadic (joined with :), but it makes the
result longer.
On Monday, September 17, 2018, 1:54:30 p.m. EDT, Raul Miller
<[email protected]> wrote:
v0 v1 and v2 must all be dyadic.
I thought the point of your proposal was to allow v0 v1 and v2 in
v0`v1`v2} y to be monadic?
(Re-reading your original post in this thread, I see that I might be
mistaken. But if you're proposing that they must be dyadic, I don't
think the proposal would be worth bothering with - you're only saving
a single character if you go that route, rather than actively
simplifying expressions which don't benefit from the dyadic context.)
Thanks,
--
Raul
On Mon, Sep 17, 2018 at 1:43 PM 'Pascal Jasmin' via Programming
<[email protected]> wrote:
>
>
>
> a workaround solution to making v0`v1`v2} monadic append is to append ~ to }.
> For example a function that fills in a default value:
>
> dfltT =: 1 : '(<@)~(`(m"_))(`[)}~(^:('''' -: m {:: ]))'
>
>
> (0 +:@:{:: ]) 1 dfltT
>
> <@(0 +:@:({::) ])~`(1"_)`[}~^:('' -: 1 {:: ])
> (0 +:@:{:: ]) 1 dfltT 2 ; ''
>
> ┌─┬─┐
>
> │2│4│
>
> └─┴─┘
>
> (0 +:@:{:: ]) 1 dfltT 2 ; 3
>
> ┌─┬─┐
>
> │2│3│
>
> └─┴─┘
> the v0 function can/must be dyadic, and accesses full x and y in the normal
> locations ([]).
>
>
>
>
>
> On Monday, September 17, 2018, 11:36:17 a.m. EDT, 'Pascal Jasmin' via
> Programming <[email protected]> wrote:
>
>
>
>
>
> Not that I've seen the implementation code, but the thought is that none of
> the optimizations would be affected if at a high level
> v0`v1`v2} is always amend (regardless of valence)
> v0`v1} is always composite item.
> My proposal was/is to allow the composite item version to be ambivalent (for
> definitional simplicity and convenience), but its not what I care about. Its
> just the first version that has no current use monadically.
> The pattern where monadic amend is useful is when y is a boxed record
> structure where data in one field can help update another field. Or
> simplicity when the update value is a function of the data.
>
>
>
> ----------------------------------------------------------------------
> 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