It's unnecessarily verbose to write "The function strdup does foo."
instead of "Strdup does foo." everywhere.
The real problem is the impedance mismatch between
the relative case-insensitivity of English convention and the
case-sensitivity of most Unix tools. It occurs when editing
any English text (or text in most other western languages),
not just man pages. Patching the man pages is a kludge.
Russ
it was in his office, when we were talking about the format of man pages
for one of the published unix manuals.
-rob
while you're about it, i've thought for a while it'd be nice to have a
"Lookw" command to look for whole words only, so I can easily search
for single-letter variable names in my programs...
the only current alternative as far as i can see is something like:
:/(^|[^\\0-9a-zA-Z_])e($|[^0-9a-zA-Z_])
to search for "e", which is a bit like hard work.
time delays are not the way forward. they mean you can't get faster
as you get more familiar with the interface.
i wouldn't change the meaning of a right-button click - it's
already overloaded enough. just a new verb would be fine.
that way it's only there if you want it there.
That would stress me a lot. Let's don't overload things a lot.
if you want windows style searches you know where to find them.
hmm. i kind-of agree, but then again i find myself using
grep -i quite a bit, so perhaps there's room for some ambivalence.
:/[bB][oO][yY][dD]
is really quite a hassle to type.
i like the idea of Lookw. I was wondering if it would be nice to have a
search facility which can search an identifier (instead of raw stream of
characters).
Thanks
dharani
well, you'd better write N parsers.
actually it's not an unreasonable idea to have a regular expression
engine that could work on arbitrary alphabets.
you could express it quite nicely with the new limbo
polymorphism stuff:
match[T](c: chan of T, p: ref Regex[T]): int for {
T =>
eq: fn(t: self T, t1: T): int;
eof: fn(t: self T): int;
}
so the alphabet would consist of members of type T, arriving down
channel c, being matched against a previously compiled pattern p.
match would return when it enounters a match, or reads a t such that
t.eof() is true.
then you could write N parsers and just plug 'em in.
i've got something that would allow one to use this kind of stuff
with a shell-like syntax. it's awaiting a bit more of my time...
ahem.
i don't believe there is, until someone gets around to updating the
reference manual.
the syntax does seem reasonably stable now, so that should probably
happen...
it's really quite straightforward though:
a function or adt can be parameterised with one or more type names (in
square brackets). these types can be used in the body of the function
or adt as any other type.
e.g.
reverse[T](x: list of T): list of T;
Table: adt[T] {
items: array of list of (int, T);
new: fn(nslots: int): ref Table[T];
add: fn(t: self ref Table, id: int, x: T): int;
del: fn(t: self ref Table, id: int): int;
find: fn(t: self ref Table, id: int): T;
};
a "for" clause can define operations on the types (by default
there are none save assignment (and possibly equality, although
i think that will be deprecated).
e.g.
sort[T](a: array of T) for {
T =>
cmp: fn (t0, t1: T): int;
};
Env: adt[V]
for {
V =>
discard: fn(v: self V);
}
{
items: array of list of (string, V);
new: fn(nslots: int): ref Env[V];
set: fn(t: self ref Env, id: string, x: V);
get: fn(t: self ref Env, id: string): V;
clear: fn(t: self ref Env);
};
[the last syntax is going to change, i think, so that
the for clause comes *after* the adt declaration, rather
than in the middle as currently.]
when calling a type-parameterised function, the compiler infers the
type parameter from the given arguments (currently it's not possible
to explicitly name the type, although that'll come, once john susses
the grammar).
with a function or adt declared polymorphically, you can use any
"pointer type" (i.e. ref adts, chans, arrays, lists and strings).
for polymorphic types that require member functions, the type has to
be an adt containing at least the required member functions.
so, given the above declaration, you could do:
x := reverse("one" :: "two" :: "three" :: nil);
to get a list containing "three"::"two"::"one"::nil (assuming
reverse() reverses a list!).
following a suggestion of roger's, that for clause might move
to follow the adt declaration, that's one reason the syntax
hasn't been published yet. it doesn't affect functionality.
how large is N? comments and strings and stuff?
Off topic. Dennis is quoted as saying `if you want PL/I you know where
to find it,' when someone asked for a questionable feature. Does anyone
know what that feature was?
Brantley
In truth I have no idea whether I actually said it
as an original aphorism, or in what context.
Dennis
computed gotos?
compiling PL/1 was like dealing with assembler: every error masked the other
10,000 errors, so you got next to no repeat-bug find for each compile/edit pass.
the hubris of PL/1 implying either PL/2 or PL/0 was enormous!
(at least C put itself in the emotional range from A to Z slightly further in!
-and paid homage to BCPL..)
-George
i don't think he understood exactly why we were proposing these features.
-rob
i remember another unix room time when when ken exclaimed:
persistant objects? we've got those. they're called files.
s/C++/C+++++++++++++++++++++++++++++++++/ ?
☺
Hmmm. If the problem is the first capital letter select all the word except the first letter.
It works, is fast and doesn't require a change of the interface.
G.
> Hmmm. If the problem is the first capital letter select all the word except the first letter.
> It works, is fast and doesn't require a change of the interface.
Too easy.
As I said before, I don't think function names get pluralized or hyphenated,
so the solution is really simple.
Anyway, there be dragons. You are the only one who knows what you are looking
for. If not, next you'll want Lookw to understand latex or troff commands, to translate
url escaping... Better keeping things simple and general (working by intersection, not
union).
G.
Function names was just an example, you could be searching for
anything. And i am talking about searching in English texts, not
latex, troff, C... so i don't think i will have to deal with nothing
more than English language.
> Better keeping things simple and general (working by intersection, not
> union).
Yeah, i will try to keep it simple and general, just look for an
english word and derivatives in any english text. Quite useful for
searching in web pages, manual pages or documentation in general.
But i really don't know what do you mean by the intersection/union-thing.
depends what you're interested in.
just the C lexer wouldn't be too hard, and would be useful.
underscore?
> If they are that is a bug, I think that, in English, proper nouns should
not be
> hyphenated.
.nh always being set?
You are trying to add (union) more features:
- search for a word
- search for a derivative
- search for a fortune
- ....
Instead, you could try to see which one is the intersection of all
the cases that's most useful for most of them:
- Look
- Lookw ? (you know, bounded to word limits)
hth
Now i see, gracias nemo, i will think on it.
You are indeed right. man pages are reference works, not the Canterbury
Tales. If their usefulness as references would be impaired by slavish
adherence to formal English syntax then stuff the rules.
you figure that out for 1 human language, perfectly, and you _will_ make a
fortune.
english is easy to learn [500 words] but a nightmare to do perfectly:
i before e, except after c, except ...
the problem is difficult enough for [a-z] based languages. wait till you
hit ideographic based languages [chinese, japanese, ...] ...
which C?
err, .TH?
I would like you to give us the reasons for these features and why you
didn't use C++ and i hope the answer won't start a C vs C++ debate at
9fans :-)
Spyros
like 'surveillance' which probably is an imported french word (rob will
correct me) from verb 'surveiller'.
the story i heard, was that back in '84 or so, that when C++ was just cfront
things would compile and run one day and the next day they wouldn't even
compile. this annoyed people no end and so technology that worked [C] was
stuck to.
i was under the impression that tokenisation in most dialects
of C was more-or-less the same. don't most incompatibilities
arise at the parsing level and above?
http://ars.userfriendly.org/cartoons/?id=19980713
(also: http://ars.userfriendly.org/cartoons/?id=19990213 )
--Joel
as i've said before:
why not revert to morse keys and code?
> as i've said before:
>
> why not revert to morse keys and code?
Carpal^H^H^H^H^H^Hstraight key or dual paddle?
~Jason
--
straight key. only sissies use paddles or auto-keyers.
'73 de VK2BHR/P
> I would like you to give us the reasons for these features and why you
> didn't use C++ and i hope the answer won't start a C vs C++ debate at
> 9fans :-)
if we can start an argument on how to capitalize, well ...
ron
"'I' before 'E', except after 'C' and when sounding like
'A' as in 'neighbor' and 'weigh'" (or surveillance) covers
nearly all cases. I don't think they ever told me the
second part in gradeschool, I learned that from my mom.
Micah
> Neither leisured foreigner seized the heifer while
> eating caffeine and codeine at a weird height with
> a kaleidoscope.
the "ei" does come after "c" in "caffeine" and "codeine".
Do I win $10,000?
Eric
nope, the rule covers words with c being the previous character.
Ok, so I'm stupid. That'll teach me to quote rules I
don't actually use. It does rhyme, though, that should
count for something.
Micah