From: neville holmes <[EMAIL PROTECTED]>
...
> 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.

If the question had been “how to do it tacitly?” I think it would have been 
relevant because it illustrates general patterns (see below).

> 
> > 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.

Thanks for clarifying.  Apparently, the question has changed since our original 
exchange in   
http://www.jsoftware.com/pipermail/programming/2007-February/005340.html  
"...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 ? "

> 
…
> 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
> 

I know, that is why I did not feel the need to reply to your original question, 
quoted above, at the time.

> but the problem here is that the method is not general.

I sensed that as well in out recent exchange, that is the reason why a provided 
you with an illustration of a general pattern.

> To do the other examples I gave above would require
> searching for a way to do each of them, whereas my

I, of course, disagree with your conclusion but ultimately it does not matter 
(see my ending comment).

> 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 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 entry to the 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.
> 

You are welcome.  Incidentally, I do not consider myself an expert, no even 
close (to put it mildly), in GUI explicit programming which is the way jijs.ijs 
is written,.  However, I program by looking at patterns and modifying them to 
get what I want and I have added items to the jijs.ijs menu with very little 
effort.  Look at jijs.ijs; you might be pleasantly surprised.
  
Writing the compiling verb might be another matter depending on what your 
proposal ‘really’ means.  It seems to me that when you talk about a “simple way 
to do simple things” you actually mean some way very similar, if not exactly, 
to the enhancements that you have proposed.  I whish you plenty of luck waiting 
for the mountain to come to you, so to speak (if you decide to do so); I am 
afraid you will need it, partly because I (as Raul) also think that they do not 
seem to conform to the J framework properly.  Hence my suggestion to try to 
implement them instead by preprocessing chunks code.   Again, I would be 
interested to see them in action.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to