> [EMAIL PROTECTED] On Behalf Of neville holmes
...
> And I wrote an interactive von Neumann IAS simulator (complete with an
> assembler) entirely tacit.  But my turning point came when I started to
> write
> a book aimed at introducing tacit J to the great unwashed public, when
> I
> discovered I couldn't write my own operations tacitly.  The first and
> simplest
> was
> 
>   stk =: 1 '] ,: u.'
> 
> (this was back in J3 days).  There were quite a few others.  I asked on
> this
> Forum how to do it tacitly but nobody could tell me.  Can you ?

Raul Miller already answered your specific question.  The pattern can be
extended.  See, for example, the contribution of Dan Bron in
http://www.jsoftware.com/pipermail/programming/2006-July/002658.html  

However, it is not so clear to me how to proceed when u. appears multiple
times in the definition body.  I am confident that any verb can be coded
tacitly but I have never been convinced, to say the least, that any adverb
or conjunction could be coded tacitly using the J tacit facilities provided
for that purpose (not even in the "golden age" as referred by Henry Rich).
Then again, there is always an awkward heretical tacit alternative.

Modifiers operate (generally) on verbs to produce related verbs.  Complex
manipulations of verbs are done, traditionally, via gerunds but tacit verbs
can easily be represented by strings (containing their one-line definitions)
as well.  Thus, a tacit verb can manipulate the string(s) representing the
verb(s) to produce a string that represents the desired resulting tacit
verb.  Finally, the tacit verb represented by the string can be invoked via
apply (128!:2).  A seemingly limitation of this method is that only monadic
verbs can be suitable for execution, but this limitation is irrelevant
because a dyadic verb can be easily recovered (tacitly) from a monadic
counterpart (and vice versa).  (Other cases of adverbs and conjunctions may
be modeled in a similar fashion as well).  

You can find an example of this approach in
http://www.jsoftware.com/pipermail/general/2006-January/026196.html (find
Ackermann close to the end of the message).  

(

By the way, one can see that

     Ack=. (0&({::) {:: 1&({::)) ::(0&({::) ('-&3@:(] ('"_ , ] ,
')&.(-&3)@:]^:(>:@:[)4:)'"_)@:]^:([ - 3:) _1:
{::1&({::))@:(<@(<;._1@('`'&,)@('>:`(2&+&.(3&+))`(2&*&.(3&+))`(2&^&.(3&+))'"
_))1} ])@:('.'&(] , ;:@:[)@:<)@[ 128!:2 ]

is verbose relative to (
http://www.jsoftware.com/jwiki/Essays/Ackermann%27s_Function ), 

    ack=: c1`c1`c2`c3 @. (#.@(,&*))
    c1=: >:@]                        NB. if 0=x, 1+y
    c2=: <:@[ ack 1:                 NB. if 0=y, (x-1) ack 1
    c3=: <:@[ ack [ ack <:@]         NB. else,   (x-1) ack x ack y-1

However, although both might be calculating the same output,

   ack"0 _/~ 0 1 2 3
1  2  3  4
2  3  4  5
3  5  7  9
5 13 29 61
   Ack"0 _/~ 0 1 2 3
1  2  3  4
2  3  4  5
3  5  7  9
5 13 29 61

their methods are quite different,

   ts'ack"0 _/~ 0 1 2 3'
0.0633287192 19776
   ts'Ack"0 _/~ 0 1 2 3'
0.000315403215 4288

   ts'ack"0 _/~ 0 1 2 3 4'
|stack error: c1
   ts'Ack"0 _/~ 0 1 2 3 4'
0.00040088894 9088

   ts'Ack"0 _/~ 0 1 2 3 4 5 6'
4.78145155 20544
   Ack"0 _/~ 0 1 2 3 4 5 6
    1     2  3  4   5   6   7
    2     3  4  5   6   7   8
    3     5  7  9  11  13  15
    5    13 29 61 125 253 509
   13 65533  _  _   _   _   _
65533     _  _  _   _   _   _
    _     _  _  _   _   _   _

)

> 
> I then argued for x. y. u. v. to be sequestered as primitive symbols so
> that
> I could explicate operands.  And this seems to me to be an even more
> reasonable request once "function-level programming" is acknowledged
> because the joy is to be free of arguments and their names, but it
> seems
> reasonable to be able to refer to operands at the function level.  But
> my
> request was given short shrift.
> 
> If I can be told how to code operations like stk tacitly (i.e., without
> all
> that notational encumbrance) then I would like to resume writing my
> book.
> I had an agreement with Wiley for it, and they have already published
> my "Computers and People" (which mentions J on p.60).
> 
> Neville Holmes, P.O.Box 404, Mowbray 7248, Tasmania
> Normal e-mail: [EMAIL PROTECTED]
> 
> Send instant messages to your online friends http://au.messenger.yahoo.com
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm


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

Reply via email to