I agree with the idea of using explicit definitions for beginners. Names can be very helpful things.
But I would, most of the time, not forbid [: nor @ -- instead, I would not mention them. If someone brings them up, they are an advanced user, and it's ok if advanced people are interested in a beginner class, as long as they let other people learn. If I wanted to "eliminate" them, I would instead set an alternate goal. For example: "give meaningful names to [all] intermediate results." (But, here, I would limit this to "intermediate results which arise from the use of primitives" -- I would not be interested in internal state used in the implementation of those primitives.) -- Raul On Thu, Feb 2, 2012 at 10:18 PM, Linda Alvord <lindaalv...@verizon.net> wrote: > I moved this response to a new thread. > > > > I am rethinking my concern with @ and [: and am leaning toward using > explicit definitions as a way of teaching J to beginners as a natural > mathematical language. > > > > Some of the programmers responding to the forum think in idioms and use @ > happily. > > > > f > > <:@-@[ C.&.|. ] > > i > > -@#@[ |. C. > > k > > <@i.@-@>:@[ C. ] > > > > 0thers favor the tacit approach with lots of [: > > > > g > > ] C.&.|.~ [: <: [: - [ > > h > > [: |. ([: <: [: - [) C. [: |. ] > > j > > C. |.~ [: - [: # [ > > > > > > Both styles are appropriate and I should not suggest one way or the other. > Many of you have suggested this. > > > > > > We are looking for a simple way to introduce J to beginners. In my opinion > we would introduce J as a mathematical language for solving problem. > > > > > > I am suggest starting with expressions that produce desired results. > > Developing from right to left may come naturally. > > > > (<:-3 6)C.&.|.'abc*ef*g' > > **abcefg > > > > The next step is making explicit functions indicating if the intended use is > monadic or dyadic. There is no use of @ or [: allowed at this point. > > g=: 13 :'(<:-x)C.&.|.y' > > h=: 13 :'|.(<:-x)C.|.y' > > j=: 13 :'(-#x)|.x C.y' > > > > Now exploring the tacit definitions would be appropriate in some > environments and can be explored an studied in terms of forks and hooks. > > At this special code and common idioms can be explored and timing of > expressions can be compared. In the end all roads lead to Rome. > > > > 3 6 f 'abc*ef*g' > > **abcefg > > 3 6 g 'abc*ef*g' > > **abcefg > > 3 6 h 'abc*ef*g't > > **abcefg > > 3 6 i 'abc*ef*g' > > **abcefg > > 3 6 j 'abc*ef*g' > > **abcefg > > > > So all roads lead to Rome. > > > > Beginning with Challenge 6 I will not exclude @ . Instead I will try some > other suggestion to keep J simple. Please respond with any concerns or > suggestions. > > > > In the future I hope to accept @ and [: gracefully. > > > > Linda > > > > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm