Recently I got an email from an old friend and APL/J
colleague, Walter Spunde.  Part of it set some thoughts
running in my mind.

Walter's Complaint (verbatim with his permission)

At the moment I'm writing a workbook to go along with a (low level)
course in discrete maths and what's annoying with J is the
documentation
side of it.  I guess I've taught Matlab for a number of years to
engineering and science students and rather like the fact that comments
written at the start of a function file can be recovered with "help
fn_name". In these comments I want students to make clear the
function's
syntax, its inputs and outputs and the relationship between them.
If a student writes something incomprehensible like:
sample=3D: (({. + {: * i.@(>.@((1&{ - {.) % {:))) , 1&{)@(3&{.@(({.~ (#
+
_3&*@(1: =3D #))) , %&100@(-~/@(_2&{.)))) :([EMAIL PROTECTED] ([EMAIL 
PROTECTED] + ((1&[EMAIL PROTECTED] -
[EMAIL PROTECTED]) %
[) * i.@(1: + [)) (>@(2&>@#) |. 2&{.)@])
which is just Iverson's "steps" with several defaults built in, how can
I get him to record these options and the syntax for the function.  If
  (steps 2 3 4),(4 sample 2 3),: (sample 2 3 0.25)
all produce the same result how is a user to find out?  In fact,
finding
what "steps" does and its correct syntax (it loads with the Plot
functions) is a challenge in itself without introducing user defined
functions.  If you write

   sum =3D: [: +/ ]  NB.   sum y   gives the sum of the items of y ;  x
sum y   ignores x

then ask for definition of sum, you see that J has helpfully stripped
the comment out.
Maybe I've got a bit of a bee in my bonnet about this but it causes an
annoying buzz in my brain every time I think about it.

There's a lot I don't like about Matlab but I do like it's "help"
function.  Can it be true that no one has written something to work in
J
in a similar fashion?

My thoughts on Comments

I don't know whether anything helpful has been written, but it seems
to me that n b. 2 could usefully return the NB. appended to the line
in which any name, whether noun verb adverb or conjunction, was
last given a value.

That done, two extensions would seem potentially useful:

* Brief documentation could be returned if n in n b. 2 were primitive,
and

* NBB. or NC. could append to a preceding NB. rather than replacing it.
  




Neville Holmes, P.O.Box 404, Mowbray 7248, Tasmania
Normal e-mail: [EMAIL PROTECTED]


      Make the switch to the world's best email. Get the new Yahoo!7 Mail now. 
www.yahoo7.com.au/worldsbestemail


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

Reply via email to