I wrote (Dec 26):

> I would be very interested to know what those internal
> conflicts were. . . .

Raul Miller wrote (Dec 26):

> Basically non-trivial tacit functions do not simply
> define one function, they define many functions.

Well, maybe.  I would rather say that a tacit expression
defines a single function (or an operation) in terms of
other functions, or of nouns or operations, but maybe
we are saying the same thing.

> For example, let's take the classic:
>   +/%#

> This simple sequence of four characters includes
> two different tacit functions.  First you define sum,
> and then you define average.

Again, I would say "express" rather than "define" but
I doubt if that affects your description.  Let's see . . .

> Picking an example at random,
>    trjoin=: ":&.>@] ;@}:@,@,. [EMAIL PROTECTED]

> Here, the tacitly defined functions are
>    [EMAIL PROTECTED]
>    ;@}:
>    ;@}:@,
>    ;@}:@,@,.
>    ":&.>
>    ":&.>@]
> and, of course, the fork which combines the first,
> fourth and sixth verbs from my list.

Again, I would say "expressed" rather than "defined".
I'm solemnly picking nits here so that if I run off
track you or I have a better chance of seeing why.

> That said, note that adverbs are also functions, but
> we did not actually tacitly define any adverbs in the
> above.
 
Again, as a matter of terminology, to me a function
(= verb) which returns a value (noun) must always
be contrasted to an operation (adverb or conjunction)
which returns a function.

> Now... it occurs to me that perhaps you mean for
> [. and ]. to follow the pattern set by $. -- I do not
> remember if we discussed this or not.  If this was
> your meaning, you could have [. and ]. be analogous
> to [ and ] but finding the left and right arguments to
> the largest containing function (instead of the left
> and right arguments of the current function).

I presume you mean $: and not $. and in any case
I did not have either in mind.   What I have in mind is
to have [. and ]. analogous to [ and ] but for them to
find the operands to the defined operation rather
than the arguments of the resulting function.

For example, as things are:
   f =. 1 : '] ,: u'
   a =. 9?10 [ b=. 9?10
   a * f b
0 1  8 2  6  7  9 4  5
0 6 64 2 42 63 18 0 20
   g =. 1 : '[ , ] ,: u'
   a * g b
3 6  8 1  7  9  2 0  4
0 1  8 2  6  7  9 4  5
0 6 64 2 42 63 18 0 20

(These don't line up for me as Yahoo gives me
proportional spacing, but you'd see what I mean.)

What I would like is for
   f =. ] ,: [.'
   g =. [ , ] ,: [.'
to have the same effect.

I'm afraid I must be misunderstanding something
because I don't see the internal conflict you tell me
is present, and I'm afraid that I don't see the relevance
of your explanation above.

Note that I'm not claiming any excellence of my examples,
nor that they can't be done some other (perhaps even
simpler) way.   But what I was looking for was something
that is simple to explain to students.  For this, I need to be
able to leave off the n : prefix and the enclosing apostrophes
which have a very arbitrary flavor, and place the operand(s)
freely (within the syntactic rules for operands) and even
repeatedly.

Another simple example:

   h =. 2 : 'u~ v u'   
   a ^ h >. b
1 6 1.67772e7 2 279936 4.03536e7 512 1 1024
   a ^ h <. b
0 1 1.67772e7 1 117649 4.78297e6 81 0 625

where I would like

   h =. [.~ ]. [.

to work the same way.

Would you please explain what the internal conflict
is in these examples, or, if a more complex example
is necessary to bring the conflict about, give such an
example with explanation.

Jose Mario Quintana wrote (Dec 26):

> In a few words, one can show that any computing task can be written
tacitly
> because, if worst come to worst, one can write tacitly a Turing
machine
> emulator ( as I did in
> http://www.jsoftware.com/pipermail/general/1999-December/002736.html
) or any
> other emulator . . .

Your emulator is very interesting, but irrelevant to my
objective, which is to provide beginners with a simple
way to do simple things.  For example, compare the
two versions of h above.

> The approach that I follow, outlined in the tailing email, can be
> illustrated with one of your examples in your email cited above,

>    stk=. 1 : '] ,: u.'
>    sumstk=. +/ stk
>    sumstk i.3
> 0 1 2
> 3 3 3

> Can you do that tacitly?

>    stk0=. &(('] ,:('"_ , ] , ')'"_)@[ (apply f.) ])
>    stk0
> &(('] ,:('"_ , ] , ')'"_)@[ 128!:2 ])
>    sumstk0=. '+/' stk0
>    sumstk0 i.3
> 0 1 2
> 3 3 3
 
Again, it's not at issue for me whether it can be
done tacitly or not, but whether it can be done
tacitly and simply enough to be able to explain
to veriest beginners in a few sentences.  If I could
use [. and ]. as in the examples above than a few
sentences should suffice to explain.

Incidentally, in my book I need the Stk operation
(adverb) so that readers can stack an argument
over the result given by the application of a function
(verb) to its argument.  I want them to be able to use
Stk with whatever function they might want to play
with.   It would not be always applied to the same
function, in your example +/.

> The disadvantages are that arguments are strings representations
(e.g. '+/')
> and dyadic verbs require a little more effort; also, the method is an
> overkill for your simple example but I hope the point is made.  The
> advantages are that arguments can be string representations of verbs,
> adverbs, conjunctions or even any code fragment) and code can be
generated,
> stored and/or executed easily in real time.

I have/had the hope of introducing tacit J to beginners,
to schoolchildren, to people who are ordinarily averse
to dealing with numbers.  String representations would
be a disadvantage in these circumstances, not an
advantage.

Incidentally, Raul Miller showed me in an earlier email
that Stk could be done simply by

   *:^:0 1 a
3  6  8 1  7  9 2 0  4
9 36 64 1 49 81 4 0 16

but the problem here is that the method is not general.
To do the other examples I gave above would require
searching for a way to do each of them, whereas my
suggested [. and ]. provide a general way to do all
manner of useful arithmetic.

> So, what I was suggesting to you is to write a verb <compile> that,
in this
> particular case, would convert the above 3-line script into the
equivalent
> script, 

>    sumstk1=. ] ,: (+/)
>    sumstk1 i.3
> 0 1 2
> 3 3 3

> Further, you could modify jijs.ijs and facilitate the process (for
example,
> add a <Compile> entry to the <tool/selection> menu that compiles and
> executes a code selection).

> I hope this helps.

Well. it would if I were as expert as you (I know
nothing about jijs.ijs, for instance, but of course
I could learn) and if I were not trying to get naive
learners to use tacit J.  But thanks very much
for trying to help me.

Neville Holmes, P.O.Box 404, Mowbray 7248, Tasmania
Normal e-mail: [EMAIL PROTECTED]


      Make the switch to the world's best email. Get the new Yahoo!7 Mail now. 
www.yahoo7.com.au/worldsbestemail


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

Reply via email to