June Kim wrote:
> 
> 
>    cyclef=:( (@{.) (`(,~)) (`}.) ) (`: 6)
>    *: cyclef i.5
> 1 2 3 4 0
>    *: cyclef 10 20 30 40
> 20 30 40 100
> 
> 
cycle can be written shorter by omitting parenthesis:

cyclef1=: @{. (`(,~)) (`}.) (`: 6)

or, if we use anti-cycling, as:

acyclef=: @{: (`,) (`}:)  (`: 6)


   *: cyclef1 10 20 30 40
20 30 40 100
   *: acyclef 10 20 30 40
1600 10 20 30
   *: acyclef ^:# 10 20 30 40
100 400 900 1600
   *: cyclef1 ^:# 10 20 30 40
100 400 900 1600



-- 
View this message in context: 
http://www.nabble.com/Tacit-Adverb-of-cyclef-tp22281921s24193p22311694.html
Sent from the J Programming mailing list archive at Nabble.com.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to