Re: [Jprogramming] A Different Less?

2016-01-21 Thread Henry Rich
#@> ;: 'a man a plan a canal' 1 3 1 4 1 5 #@:> ;: 'a man a plan a canal' 6 Henry Rich On 1/21/2016 9:50 PM, Linda A Alvord wrote: Jose, I'm looking for amonadic example where @ and @: have different results. I thought your example might work, but I can't figure out how it works: Here's a

Re: [Jprogramming] A Different Less?

2016-01-21 Thread Linda A Alvord
Jose, I'm looking for amonadic example where @ and @: have different results. I thought your example might work, but I can't figure out how it works: Here's a script until an error: Y=:'mississippi' f=: 13 :'/:/:y' g=: 13 :'/:@/:y' h=: 13 :'/:@:/:y' (f Y)-:g Y 1 (f Y)-:h Y 1

Re: [Jprogramming] A Different Less?

2016-01-21 Thread Thomas Costigliola
There could, theoretically, be special code triggered from inside other adverbs and conjunctions that inspect their arguments. If you can image some construction with @: or [:, which by itself has no special code but in some larger context, seen later by the parser, has an optimization.  T

Re: [Jprogramming] A Different Less?

2016-01-21 Thread Jose Mario Quintana
The following confirms and quantifies the effect of triggering special code (in one instance). Y=. $'Mississippi' 11 stp noun define ([: /:/:)Y /: @: /: Y ) ┌──┬──┬──┬──┐ │Sentence │Space │Time │Product │ ├──┼──

Re: [Jprogramming] A Different Less?

2016-01-21 Thread Jose Mario Quintana
Thanks for sharing your analysis Marshall. It seems to explain why the other way around out-performance has not been observed (at least not yet). On Wed, Jan 20, 2016 at 11:27 PM, Marshall Lochbaum wrote: > Short answer: as far as I can tell, this is never the case. > > Special code identificat

Re: [Jprogramming] A Different Less?

2016-01-21 Thread Jose Mario Quintana
Apparently the moral of this little story is that although in theory the dyadic (and also the monadic) forms u @: v~ and u @: (v~) are equivalent, in practice (performance-wise) they might not. In some instances u @: v~ might trigger special code whereas u @: (v~) would not. It seems that

Re: [Jprogramming] A Different Less?

2016-01-21 Thread Henry Rich
Again: ([: u v) is equivalent to u@:vNOT u@v . ([: u v y) is a domain error. Henry Rich On 1/21/2016 4:54 AM, Linda A Alvord wrote: I wasn't considering all special code! ([: u v y) and (u@v y) are supposed to be equivalent. f=: 13 :'u v y' f [: u v g=: 13 :'u@v y' g

Re: [Jprogramming] A Different Less?

2016-01-21 Thread Linda Alvord
f=: 13 :'u v y' f [: u v 5!:4 <'f' ┌─ [: ──┼─ u └─ v g=: 13 :'u@v y' 5!:4 <'g' ┌─ u ── @ ─┴─ v Caution: This is a fake - But since the I think it might be the best of the two choices. 5!:4 <'f' ┌─ u ──┼─ @ └─ v Linda -Original Message- From: Program

Re: [Jprogramming] A Different Less?

2016-01-21 Thread Linda A Alvord
I guess I just figured out my long term strategy for teaching J. Write explicit verbs as simply as you can. Read the J translation of "This is how J says it." Eventually you will speak the best possible J and write it tacitly directly. Linda -Original Message- From: Programming [mailto:p

Re: [Jprogramming] A Different Less?

2016-01-21 Thread Linda A Alvord
Maybe this is how the things could work: F=: 13 :'u v y' U@V And you would say "Aha, this is special code." And then you could look up in NuVoc what that particular special code means. Linda -Original Message- From: Programming [mailto:programming-boun...@forums.jsoftware.com] On Be

Re: [Jprogramming] A Different Less?

2016-01-21 Thread Linda A Alvord
I wasn't considering all special code! ([: u v y) and (u@v y) are supposed to be equivalent. f=: 13 :'u v y' f [: u v g=: 13 :'u@v y' g u@v As Mike suggested "Is there a danger, if g always uses special code, in using that same code for f?" Linda -Original Message- F