Dave -

as a lightweight, basic documentation convention, I'll typically begin (or
precede, for tacit) a definition with an "NB.*" comment like this:
NB.* length: length of ray from origin to point y.

and end (or follow) with an example like this:
NB.EG 5=length 3 4

Having the special "NB.*" definition line is also good because, once a
script has grown to include numerous definitions, I can grep these
documentation lines from the file and put a copy of the entire block of them
at the start of the script as a sort of table-of-contents.

Regards,

Devon

On Thu, May 13, 2010 at 1:10 PM, David Ward Lambert
<[email protected]>wrote:

> Seldom are my definitions useful as both monads and dyads(*footnote 0).
> Cap documents(*1) intent as in this brief session with vectors in j:
>
>      length=: +/&.:*: : [:
>
>      to =: [: : -~
>
>      normalize =: % length : [:
>
>      c =: [: : (normalize@:to) NB. (*c)
>
>      0 c 3 4
>   0.6 0.8
>
>      0 length 8
>   |domain error: length
>   |   0     length 8
>
>
> TeX markup also facilitates documenting j thus I've started writing
> source in noweb(*3).  
> http://www.cs.tufts.edu/~nr/noweb/<http://www.cs.tufts.edu/%7Enr/noweb/>
>
>
> (*0) valence exception: argument defaults
> (*1) [: documents and enforces
> (*c) homogeneous coordinates: CSE167_03.ppt slide 55
> (*3) where before I had used 0 : 0
>   block nouns   NB. and these notes
> )
>
>
> Finally---a personal status report---I've made sufficient progress to
> answer most of my own questions.  I thank you for your patience.  Dave.
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to