Maybe being left handed makes it easy to build definitions from right to
left.

  3}.}.'abc*ef'
ef
   3{.'abc*ef'
abc
   3{'abc*ef'
*   


   m2f=: 13 :'((x{y),x{.y),x}.}.y'
   m2f
({ , {.) , [ }. [: }. ]
   3 m2f 'abc*de'
*abcde

   5 m2f 3 4 5 6 7 2 8 9
2 3 4 5 6 7 8 9

Linda
-----Original Message-----
From: programming-boun...@jsoftware.com
[mailto:programming-boun...@jsoftware.com] On Behalf Of Viktor Cerovski
Sent: Tuesday, January 31, 2012 11:49 AM
To: programming@jsoftware.com
Subject: Re: [Jprogramming] Understanding C. , A.



David Ward Lambert wrote:
> 
> Are there simple versions of swap and of move_to_front that use C. , A.
> or (other)?  My definitions use amend.  Thank you, Dave.
> 
>    1 5 swap 'abcdefgh'
> afcdebgh
>    
>    3 move_to_front 'abc*ef'
> *abcef
> 
> 
>    swap=: ({~ |.)~`[`]}
>    move_to_front=: ((({~ _1&|.)~`[`]})~ i.@:>:)~
> 
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 
> 

   move2front=: { , {. , }.@}.

   3 move2front 'abc*ef'
*abcef

-- 
View this message in context:
http://old.nabble.com/Understanding-C.-%2C-A.-tp33237118s24193p33237585.html
Sent from the J Programming mailing list archive at Nabble.com.

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