Ian, Raul's reply has the key information here. As you are interested in examples, I'd like to provide at least the following simple one.
I've had need to pad the ends of a numeric vector (to eliminate corner-conditions). The most straightforward tacit way to write this is: (0: , ] , 0:) The recent support for n v v form allows us to write this using plain zero instead of zero-colon, in any of several variations: (0 , ] , 0:) (0 ,~ 0 , ]) (0 , 0 ,~ ]) The first of these three is what I naturally choose, and I suspect this phrasing would be favored by most J coders. But I think the closest competitor is the old-school (0: , ] , 0:) There isn't a difference in meaning between them, as Raul said, but for emphasis we might make overt the verbal nature of the leftmost name by using 0: in both places. The last two examples listed involve going out of our way to avoid using 0: and these phrases I don't like as well; I find they aren't as visually suggestive. Tracy On Sun, Feb 14, 2010 at 9:43 AM, Ian Clark <[email protected]>wrote: > Does anyone have a really good example of using a constant function > (e.g. 0: 1: ...) where it is actually necessary? > Gene McDonnell uses a lot of them in At Play With J, but in the > examples I've tried, 0 works just as well as 0: ...and so on. > > I think the example I've used in > http://www.jsoftware.com/jwiki/Vocabulary/zeroco is weak, and won't > convince a novice they're of any serious use. > > Ian > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
