|
Chapter 15: Tacit From ExplicitIn this chapter we look at how a tacit function can be generated from an explicit function. This chapter was written using J version 4.03a. 15.1 Generated Tacit VerbsSuppose that e is a verb, defined explicitly as follows: e =: 3 : '(+/ y.) % # y.' The right argument of the colon conjunction we can call the "body". Then a tacit verb, t say, equivalent to e, can be produced by writing 13 : instead of 3 : with the same body. t =: 13 : '(+/ y.) % # y.'
Here now is an example of an explicit dyad. ed =: 4 : 'y. % x.' The equivalent tacit dyad can be generated by writing 13 : rather than 4 : with the same body. td =: 13 : 'y. % x.'
We can conclude that if we write 13 : body, and body contains y. (but not x.) then the result is a tacit verb of which the monadic case is equivalent to 3 : body. On the other hand, if body contains both x. and y. then the result is a tacit verb of which the dyadic case is equivalent to 4 : body. For the purpose of generating tacit functions, the body is restricted to being a single string or one line. Recall that with 3 : body, the body is not evaluated when the definition is entered. However, with 13 : body, then in effect the body is evaluated. For example:
We see that p is defined in terms of k while q is not. While p and q are at present equivalent, any subsequent change in the value of k will render them no longer equivalent.
A name with no assigned value is assumed to denote a verb. In the following example, note that f is unassigned, C is a predefined conjunction and g is a predefined verb. C =: @: g =: %:
15.2 Generated Tacit OperatorsRecall from Chapter 12 that an adverb may be defined explicitly with an expression of the form 1 : body. Here is an example, an adverb R which applies its argument-verb separately to each row of a table.
A tacit adverb, T say, equivalent to R can be generated by writing 11 : rather than 1 : with the same body.
Recall from Chapter 14 the problem of writing a conjunction to generate a hook in the form ((x C y) V). Here C and V are to be fixed in advance, and x and y are to be verbs given as arguments to the conjunction. An explicit version of such a conjunction, EC say, could be:
An equivalent tacit version could be produced by writing 12 : instead of 2 :, thus:
The tacit conjunction TC is of the form: conjunction, adverb, adverb, that is, a trident of the pattern CAA. What 12 : has done for us is to generate an instance of trident CAA.. This brings us to the end of Chapter 15. |
Copyright © Roger Stokes 2000. This material may be freely reproduced, provided that this copyright notice and provision is also reproduced.
last updated 26Feb00