Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Rich H.J for C programmers.2006.pdf
Скачиваний:
19
Добавлен:
23.08.2013
Размер:
1.79 Mб
Скачать

2 (13 : '+:^:x. y.') 3

12

This verb applies monad +: to y., x. times. Knowing about u^:v, you might find the tacit equivalent +:@]^:[ :

2 (+:@]^:[) 3

12

Special Verb-Forms Used in Tacit Definitions

It is impossible for a tacitly-defined verb to route one of its operands to an operand of a modifier inside the verb. For example, if we want a verb to set element x of y to 0, we can try

13 : '0 x.} y.'

4 : '0 x.}y.'

but we see that the converter was unable to find a tacit form.

Some modifiers have exotic forms that circumvent this problem. One such is the adverb } which supports the form x value`selector`operand} y . This produces the same result as (x value y) (x selector y)} (x operand y) so we could write

a =. 13 : 'x. 0:`[`]} y.' a

0:`[`]}

3 a 9 7 5 3 1

9 7 5 0 1

Other such forms are x m&v y and x u&n y which are equivalent to m&v^:x y and u&n^:x y respectively.

240