I didn't notice h in the final definition so:

j=: 13 :'0 1 1 1 1 1 1 1 1 0 1 1 1 (#!.''M''^:_1 [: [ 0 1 1 1 1 1 1 1 1 0 1
1 1 #!.''M'' ]) y'
   
   j A
Mouse on Mill
   
   j
0 1 1 1 1 1 1 1 1 0 1 1 1 (#!.'M'^:_1 ([: [ 0 1 1 1 1 1 1 1 1 0 1 1 1 #!.'M'
])) ]
   

 5!:4 <'f'
   5!:4 <'f'
      -- 3                          
-- : -+- ,:' [&.(g=:B&(#!.''M'')) y'
   
   5!:4 <'j'
   5!:4 <'j'
  -- 0 1 1 1 1 1 1 1 1 0 1 1 1

  │                                         -- #

  │                                  -- !. -+- 'M'

  │                           -- ^: -+- _1

  │                           │

  +---------------------------+      -- [:

--+                           │      +- [

  │                           L------+      -- 0 1 1 1 1 1 1 1 1 0 1 1 1

  │                                  │      │                           -- #

  │                                  L------+- !. ----------------------+-
'M'
  │                                         L- ]

  L- ]

   


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Thursday, May 22, 2014 11:15 AM
To: [email protected]
Subject: Re: [Jprogramming] Substitution with under

Hello David,  This took a while but it has no  &  or  &. 

    A=:'house on hill'
   B =: 'h' ~: A
   f=: 13 :' [&.(g=:B&(#!.''M'')) y'
   f A
Mouse on Mill
   
   j=: 13 :'0 1 1 1 1 1 1 1 1 0 1 1 1 (#!.''M''^:_1 [: [ h) y'
   j A
Mouse on Mill
   j
0 1 1 1 1 1 1 1 1 0 1 1 1 (#!.'M'^:_1 ([: [ h)) ]
   


Here's how I got there.   
   g A
ouse on ill
   h=:13 :' (0 1 1 1 1 1 1 1 1 0 1 1 1)(#!.''M'')y'
   h A
ouse on ill
   
   (g-:h)A
1
   
   h b. _1
0 1 1 1 1 1 1 1 1 0 1 1 1&(#!.'M')^:_1
   
   i=: 13 :'(0 1 1 1 1 1 1 1 1 0 1 1 1&(#!.''M'')^:_1) [ h y'
   i A
Mouse on Mill
   
   j=: 13 :'0 1 1 1 1 1 1 1 1 0 1 1 1 (#!.''M''^:_1 [: [ h) y'
   j A
Mouse on Mill

Linda



-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of David Lambert
Sent: Wednesday, May 14, 2014 10:24 AM
To: programming
Subject: [Jprogramming] Substitution with under

    NB. New substitution?  Surely someone can verbalize this.

    A =: 'house on hill'
    B =: 'h' ~: A
    [&.(B&(#!.'M')) A
Mouse on Mill

----------------------------------------------------------------------
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

Reply via email to