tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: jot: producing too much output?
>>> I'd do it myself except I don't know where to find an authoritative
>>> spec for jot.
>> I'd tend to assume it is the code.
Well, then, there never can be any such thing as a bug in jot.
I find that...dubious.
> Remark from the peanut gallery, after (again) reading this in jot(1):
> | The name jot derives in part from iota, a function in APL.
> Maybe somebody(tm) should look that up. Or ask John A. Kunze.
I know enough APL to make some sense of that, and it's not very
informative here.
Caveat: my APL knowledge is relatively old. But I suspect the jot
name's derivation is comparably old. So, as I understand APL....
There's an operator - pronounced "iota", because the usual glyph for it
is the lowercase Greek letter ι - which takes a scalar, let's call it
N, and returns a 1D array from 0 through N-1. There is an APL
character which I'm not sure of the location of in non-APL-specific
fonts; it looks roughly like a degree sign moved down so its centre is
approximately where a centered-dot's centre would be. It is pronounced
"jot". I don't see how to get to jot(1)'s functionality from APL's
jot, but it is in some respects like APL's iota.
However, that doesn't help much here because APL's ι operator doesn't
have the issues under discussion here. It takes exactly one argument;
in jot(1) terms, start is 0, step is 1, and the argument is reps, with
end being implicit in the other three. If you want anything else, you
have to construct it from the vector ι returns. For example, if you
want the vector 2.4 2.5 2.6 2.7 2.8 2.9, you would probably do
something like...well, I'm not sure I'm going to get the MIME right,
but I think 2.4+.1
×
ι6 is what you'd want.
APL ι does have dyadic semantics as well, but they're even less
relevant. (Most briefly, XιY returns an array of the same shape as Y,
indicating where in X the elements of Y are first found. If X is not
1D, I'm not sure what happens; I suspect it actually operates on ,X
instead of X as given, though it seems to me the most philosophically
APLish thing would be to add another dimension ρρX to the result and
return entire subscript vectors.)
I don't see any help in APL for figuring out what jot(1) should do.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse%rodents-montreal.org@localhost
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
Home |
Main Index |
Thread Index |
Old Index