global nouns all caps.
a trailing capital A or C to a name for a conjunction, or Proper/Camel case for
a modifier. Using lowercase 'is does on' followed by Proper case for a verb
that returns booleans. For a modifier that returns a noun (explicit access to
x and y), use An or Cn as the name suffix. May use M or D as suffix for
monadic/dyadic only functions.
Some of these may be overkill, but don't hurt. Having default parameters can
be a big help in multiparameter functions partly for giving names to each
parameter, but also letting you call it with just a: and get an answer for all
defaults, and so provide a built in example call.
defaults1 =: ([`]@.(0=#@>@[))
defaults =: defaults1"0 0 f.
scalarize =: {.^: ((,1) -: $)
fixlenx =: 1 : (':';'(scalarize (#y) {. x) u y')
a: defaults fixlenx 3;4;'asdf'
┌─┬─┬────┐
│3│4│asdf│
└─┴─┴────┘
(2;a:) defaults fixlenx 3;4;'asdf'
┌─┬─┬────┐
│2│4│asdf│
└─┴─┴────┘
(2;5;6) defaults fixlenx 3;4;'asdf'
┌─┬─┬─┐
│2│5│6│
└─┴─┴─┘
(2;a:,<1) defaults fixlenx 3;4;'asdf'
┌─┬─┬─┐
│2│4│1│
└─┴─┴─┘
----- Original Message -----
From: Erling Hellenäs <[email protected]>
To: [email protected]
Cc:
Sent: Sunday, July 13, 2014 11:25:08 AM
Subject: Re: [Jprogramming] Design goals readability and writeability?
"A tip for readability, applogies for mentioning previously, is to avoid
writing hooks. Use forks instead. Put spaces between the fork elements, and
use a capitalization scheme for nouns and modifiers."
You want to describe the capitalization scheme you use?
Cheers,
Erling Hellenäs
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm