Vocabulary/graveco

From J Wiki
Jump to navigation Jump to search

>> <<   Back to: Vocabulary Thru to: Dictionary

[x] m`:n y Evoke Gerund Conjunction

Rank Infinity -- operates on x and y as a whole -- WHY IS THIS IMPORTANT?



If m is a gerund,  m`:n creates a verb based on m.

Operand n is an integer (0, 3 or 6) specifying what the verb should do

See below: More Information

   gerund =: +&2`''   NB. create a gerund
   gerund             NB. Display it.  (It is a deeply boxed noun)
+-------------+
|+-+---------+|
||&|+-+-----+||
|| ||+|+-+-+|||
|| || ||0|2||||
|| || |+-+-+|||
|| |+-+-----+||
|+-+---------+|
+-------------+
   gerund `:6         NB. Turn the gerund into a verb
+&2
   (gerund `:6) 8     NB. The verb will actually run
10

Common Uses

1. To turn a gerund representing a single verb into the actual verb, as above.


More Information

1. n must have the value 0, 3, or 6.

2.  [x] m`:0 y applies the verb described by each atom of m separately, and collects the results, using the shape of m as the frame, into an array which becomes the result of  m`:n .

The verbs are executed monadically or dyadically depending on the invocation of  m`:n

   ((+:`*:) `:0) i. 3
0 2 4
0 1 4
   $ (({. +:`*:) `:0) i. 3   NB. m here is an atom, so the result has no leading axis
3

3.  m`:3 y is equivalent to  m/ y .

Verb  m`:3 cannot be used dyadically.

4.  [x] m`:6 y converts the individual atoms of gerund m to verbs, and applies a verb train of the resulting verbs.

Details

1. m`:6 more generally produces the entity that results from evaluation of the single word or word sequence described by atom or list m of atomic representations.

   [i10=: i.`('0'<@,&<10)   NB. (AR of i.)`(AR of 10)
┌──┬──────┐
│i.│┌─┬──┐│
│  ││0│10││
│  │└─┴──┘│
└──┴──────┘
   i10`:6                      NB. evaluate (AR of i.)`(AR of 10).  Equivalent to i. 10 or ". 'i. 10' 
0 1 2 3 4 5 6 7 8 9
   i.`(<'&')`:6                NB. evaluate (AR of i.)`(AR of &)
i.&

2. m`: gives a domain error if m is boxed and is not a valid atomic representation.