Sure, in principle, there is always an overhead when "apply" is applied and it 
is in disadvantage relative to the native $:; what I meant is that sometimes 
depending on the circumstances “apply”’s under-performance might be negligible 
(by the way, alternative implementations of the Y combinator based on 
representations such as gerunds, or even numbers, that do not rely on "apply," 
are feasible but they would be relatively handicapped as well):
 
      Y=. (,~ ?.@:$ ])500
      st
7!:2 ; 6!:2
   
      st'%. Y'
┌────────┬───────────┐
│14681344│0.290202526│
└────────┴───────────┘
   
      st'''%.'' apply Y'
┌────────┬───────────┐
│14682176│0.290490272│
└────────┴───────────┘
Regarding adverbial programming, I meant the same thing but in the context of 
(tacit) adverbial programming vs. verb programming.  It seems now obvious that 
for any given verb there is an equivalent adverb that would perform, albeit 
typically at a disadvantage, any transformation on any noun that the verb can 
perform and since (tacit) verb programming is (Turing) complete then adverbial 
programming is also complete.  Of course, from the J programming point of view, 
adverbs are more useful in the sense that, unlike verbs (". included), they can 
also return directly adverbs or conjunctions.
 
In other words, I do not think I disagree with your statements. 
 
 


Jose Mario Quintana wrote:
> 
> [...], there is a way to write fully fixable recursive code in J; see
> http://rosettacode.org/wiki/Y_combinator#J . 
> The method implies heavy overhead and it is typically relatively
> slow;[...]
> 
Not typically but intrinsically slow because interpreter first has to
tokenize
expressions before it can parse them every time apply is applied. 
Furthermore:


> [...]but adverbial programming [...] is not about efficiency
> 
I disagree: the use of tacit adverbs, in contradistinction to the use of
apply, 
can make code run faster.

-- 
View this message in context: 
http://www.nabble.com/Recursive-nesting%2C-avoiding-recursion-tp25122502s24193p25127150.html
Sent from the J Programming mailing list archive at Nabble.com.

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

________________________________

From: Viktor Cerovski <[email protected]>
To: [email protected]
Sent: Monday, August 24, 2009 11:03:13 PM
Subject: Re: [Jprogramming] Re cursive nesting, avoiding recursion
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to