Answers:
1. Emphatically yes
2. Emphatically no - you'd better know the valence of your verb
3. Maybe. Tacit is sometimes faster, sometimes not. I think for short
verbs it's a little faster. My own rule is that if I have a very clear
spec, and it'll never change, I'll write a tacit verb if it's short.
The reason to learn tacit IMO is not for writing tacit verbs, but for
writing tacit fragments as parts of sentences. For example: my J class
is looking at the text of Hamlet, counting the number of syllables in
each line. We have developed a dictionary that has each word and the
number of syllables. Given a boxed list of words, you can count the
number of syllables with
+/ syllcounts {~ words i. boxedlistofwords
but how do you apply that to the whole text of Hamlet, which consists of
each line boxed, and each speech (a list of lines) boxed?
Answer: you want to apply the counting verb at boxing level 1. So you
need a verb to apply at level 1. If you know tacit code, you come up with
([: +/ syllcounts {~ words&i.) L:1 textofhamlet
If you don't, you come up with
countsylls =: 3 : 0 L:1
+/ syllcounts {~ words i. y
)
countsylls textofhamlet
There's nothing wrong with the explicit form, except the verbosity.
And, in this case, the tacit form is 100 times faster (that's unusual).
Henry Rich
On 3/17/2012 8:45 PM, David Ward Lambert wrote:
> In this experiment the tacit expression runs faster in less space than
> the explicit verb.
>
> Question, Is 13 :
> 1) an educational tool?
> 2) lazy way to not bother choosing 3 : or 4 : ?
> 3) or is there a performance benefit to tacit expression?
>
>
> ts=: 6!:2, 7!:2@] NB. time space
>
> implicit=: 13 :'x +/ y * x + x * y - 3'
> explicit=: 4 :'x +/ y * x + x * y - 3'
>
> 999 ts '34 explicit 8'
> 1.35355e_5 5632
> 999 ts '34 implicit 8'
> 8.58358e_6 2176
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm