Pascal wrote: “I'm not sure it can be made tacit.”
(Beware of wrapping.)
As far as I have known for almost two decades any explicit verb can be
rewritten tacitly. One can rewrite this particular verb as,
'hM' 13 : '((0{::x) ~: y) } ((_1{::x) ,: y)' 'house on hill'
Mouse on Mill
Unfortunately,
13 : '((0{::x) ~: y) } ((_1{::x) ,: y)'
4 : '((0{::x) ~: y) } ((_1{::x) ,: y)'
If one does not mind breaking the rules of engagement; then, there is
a direct method for this kind of situation (see
http://www.jsoftware.com/pipermail/programming/2014-January/034510.html ).
Thus,
an=. <@:((,'0') ,&< ])
'hM' 13 : ' ((an(0{::x) ~: y)) , (<''}'') , (an(_1{::x) ,: y)' f.
'house on hill'
┌─────────────────────────────┬─┬─────────────────┐
│┌─┬─────────────────────────┐│}│┌─┬─────────────┐│
││0│0 1 1 1 1 1 1 1 1 0 1 1 1││ ││0│MMMMMMMMMMMMM││
│└─┴─────────────────────────┘│ ││ │house on hill││
│ │ │└─┴─────────────┘│
└─────────────────────────────┴─┴─────────────────┘
evoke=. (<'`:') (0:`)(,^:)
'hM' 13 : 'evoke&6 ((an(0{::x) ~: y)) , (<''}'') , (an(_1{::x) ,: y)' f.
'house on hill'
Mouse on Mill
13 : 'evoke&6 ((an(0{::x) ~: y)) , (<''}'') , (an(_1{::x) ,: y)' f.
[: ,^:(0:``:)&6 ([: <@:((,'0') ,&< ]) ] ~: 0 {:: [) , (<'}') , [:
<@:((,'0') ,&< ]) ] ,:~ _1 {:: [
Otherwise, one can write tacitly a dyadic verb to replace the functionality
of Item Amend (}); for example,
'hM' 13 : '((0{::x) ~: y) ([ {"0 1 |:@]) ((_1{::x) ,: y)' 'house on hill'
Mouse on Mill
13 : '((0{::x) ~: y) ([ {"0 1 |:@]) ((_1{::x) ,: y)'
(] ~: 0 {:: [) ([ {"0 1 |:@]) ] ,:~ _1 {:: [
I hope it helps.
On Wed, May 14, 2014 at 11:58 AM, 'Pascal Jasmin' via Programming <
[email protected]> wrote:
> Another couple of improvements, as an adverb:
>
> 'h' 'M' 1 : '( ~: (#!. m)inv -.~ )' A
>
> but its probably better as a verb:
>
> 'hM' 4 : '((r ~:]) (#!. w) inv r -.~ ]) y [ ''r w'' =. x' A
> Mouse on Mill
>
> I'm not sure it can be made tacit.
>
> 2 6 (4 : '((r ~:]) (#!. w) inv r -.~ ]) y [ ''r w'' =. x') 3 4 5 2 1 1 2
> 3 4 5 6 1 1 6
>
> (4 : '((r ~:]) (#!. w) inv r -.~ ]) y [ ''r w'' =. x')each/(>@:) 3 6 ;
> 2 6; 3 4 5 2 1 1 2
> 6 4 5 6 1 1 6
>
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm