Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [9fans] first capital letter in function names at man pages, why?

76 views
Skip to first unread message

Russ Cox

unread,
May 20, 2004, 12:45:21 PM5/20/04
to
> I think the real way to help the reader is "to capitalize the letter at
> the beginning of a sentence" and "to avoid beginning sentences with
> function names". What really hit me is why some man pages do only
> half the work.

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

Rob Pike

unread,
May 20, 2004, 1:02:38 PM5/20/04
to
> was your talk with
> Doug on 9fans?

it was in his office, when we were talking about the format of man pages
for one of the published unix manuals.

-rob

r...@vitanuova.com

unread,
May 20, 2004, 1:25:49 PM5/20/04
to
> i will modify the Look command to be case-insensitive on the first
> letter of the word, and use it just for fun during a test period.

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.

r...@vitanuova.com

unread,
May 20, 2004, 1:47:13 PM5/20/04
to
> 1 right button click: meaning-search
> 2 quick right button clicks: Look
> 3 very quick right button clicks: Lookw

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.

Fco.J.Ballesteros

unread,
May 20, 2004, 1:50:43 PM5/20/04
to
> 1 right button click: meaning-search
> 2 quick right button clicks: Look
> 3 very quick right button clicks: Lookw
>
> it is homogeneous, you express your required precision, with the
> harsh you show on the care of the mouse, quite human thinking.

That would stress me a lot. Let's don't overload things a lot.


boyd, rounin

unread,
May 20, 2004, 2:11:30 PM5/20/04
to
> i will modify the Look command to be case-insensitive on the first letter
of the word

if you want windows style searches you know where to find them.

r...@vitanuova.com

unread,
May 20, 2004, 2:14:16 PM5/20/04
to
> 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.

vdha...@infernopark.com

unread,
May 20, 2004, 2:17:57 PM5/20/04
to

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

boyd, rounin

unread,
May 20, 2004, 2:23:03 PM5/20/04
to
> 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).

well, you'd better write N parsers.

r...@vitanuova.com

unread,
May 20, 2004, 2:36:18 PM5/20/04
to
> 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...

Scott Schwartz

unread,
May 20, 2004, 3:21:59 PM5/20/04
to
| you could express it quite nicely with the new limbo
| polymorphism stuff:

Is there a good reference to look at for that?

r...@vitanuova.com

unread,
May 20, 2004, 3:45:47 PM5/20/04
to
>| you could express it quite nicely with the new limbo
>| polymorphism stuff:
>
>Is there a good reference to look at for that?

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!).

Charles Forsyth

unread,
May 20, 2004, 4:10:58 PM5/20/04
to
Env: adt[V]
for {
V =>
discard: fn(v: self V);
}
{

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.

boyd, rounin

unread,
May 20, 2004, 4:11:35 PM5/20/04
to
> then you could write N parsers and just plug 'em in.

how large is N? comments and strings and stuff?

Brantley Coile

unread,
May 20, 2004, 7:42:22 PM5/20/04
to
> if you want windows style searches you know where to find them.

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

d...@plan9.bell-labs.com

unread,
May 20, 2004, 8:36:49 PM5/20/04
to
> ... 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?

In truth I have no idea whether I actually said it
as an original aphorism, or in what context.

Dennis

George Michaelson

unread,
May 20, 2004, 8:50:14 PM5/20/04
to


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

Rob Pike

unread,
May 20, 2004, 9:00:01 PM5/20/04
to
when ken and i described the new features we were proposing for plan 9 C,
including inherited structure elements, to bjarne stroustrup, he said, "if you
want C++ you know where to find it." and stormed from the room.

i don't think he understood exactly why we were proposing these features.

-rob

boyd, rounin

unread,
May 20, 2004, 10:16:45 PM5/20/04
to
> when ken and i described the new features we were proposing for plan 9 C
...

i remember another unix room time when when ken exclaimed:

persistant objects? we've got those. they're called files.

Taj Khattra

unread,
May 21, 2004, 1:30:34 AM5/21/04
to
> he said, "if you want C++ you know where to find it." and stormed from the room.

s/C++/C+++++++++++++++++++++++++++++++++/ ?

Gorka Guardiola M, zquiz

unread,
May 21, 2004, 6:29:09 AM5/21/04
to

> That would be nice, sure i can make a new command for "meaning-search"
> too, but i am more interested in how to integrate it with the "right button
> click" interface.
>
> Maybe:

>
> 1 right button click: meaning-search
> 2 quick right button clicks: Look
> 3 very quick right button clicks: Lookw
>
> it is homogeneous, you express your required precision, with the
> harsh you show on the care of the mouse, quite human thinking.


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.

Dave Lukes

unread,
May 21, 2004, 6:33:18 AM5/21/04
to
Gorka Guardiola Múzquiz wrote:

> 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.

Gorka Guardiola M, zquiz

unread,
May 21, 2004, 8:31:30 AM5/21/04
to
> When i am looking for where in a man page is the function "foobar"
> explained, i don't want to care about if it is written with the first
> letter in capitals, or if it has been sliced in half by an hyphenation
> or if it has been pluralised... the computer should deal with these
> problems, not me.

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.

Alberto Cortes

unread,
May 21, 2004, 8:49:05 AM5/21/04
to
On Fri, 21 May 2004 14:30:55 +0000, Gorka Guardiola Muzquíz wrote:
> 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...

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.

--
url: http://montoya.aig.uc3m.es/~acortes/index.html

r...@vitanuova.com

unread,
May 21, 2004, 9:59:14 AM5/21/04
to
> how large is N? comments and strings and stuff?

depends what you're interested in.
just the C lexer wouldn't be too hard, and would be useful.

boyd, rounin

unread,
May 21, 2004, 10:25:19 AM5/21/04
to
> For me it works. I don't think functions are hyphenated.

underscore?

> If they are that is a bug, I think that, in English, proper nouns should
not be
> hyphenated.

.nh always being set?

Fco.J.Ballesteros

unread,
May 21, 2004, 10:25:42 AM5/21/04
to
> But i really don't know what do you mean by the intersection/union-thing.

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

Fco.J.Ballesteros

unread,
May 21, 2004, 10:27:28 AM5/21/04
to
BTW, from what has been said, I think that using the function name
as-is (no caps) in the manual page would suffice to keep all of us happy.
Am I right? Or someone already discarded this fix?

Alberto Cortes

unread,
May 21, 2004, 10:34:46 AM5/21/04
to
On Fri, 21 May 2004 16:25:16 +0000, nemo wrote:
> 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.

--
url: http://montoya.aig.uc3m.es/~acortes/index.html

spl...@purdue.edu

unread,
May 21, 2004, 10:44:48 AM5/21/04
to

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.

boyd, rounin

unread,
May 21, 2004, 10:54:01 AM5/21/04
to
> When i am looking for where in a man page is the function "foobar"
> explained, i don't want to care about if it is written with the first
> letter in capitals, or if it has been sliced in half by an hyphenation
> or if it has been pluralised... the computer should deal with these
> problems, not me.

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, ...] ...


boyd, rounin

unread,
May 21, 2004, 11:16:03 AM5/21/04
to
> just the C lexer wouldn't be too hard, and would be useful.

which C?

boyd, rounin

unread,
May 21, 2004, 11:28:01 AM5/21/04
to
> BTW, from what has been said, I think that using the function name
> as-is (no caps) in the manual page would suffice to keep all of us happy.
> Am I right? Or someone already discarded this fix?

err, .TH?

Fco. J. Ballesteros

unread,
May 21, 2004, 11:29:57 AM5/21/04
to
Ok, Ok, I meant: using the object name as it is found in the code,
with no natural language rules obeyed for the object name on its own.
:-)

Anastasopoulos S

unread,
May 21, 2004, 11:35:19 AM5/21/04
to

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

boyd, rounin

unread,
May 21, 2004, 12:01:01 PM5/21/04
to
> i before e, except after c, except ...

like 'surveillance' which probably is an imported french word (rob will
correct me) from verb 'surveiller'.

boyd, rounin

unread,
May 21, 2004, 12:05:45 PM5/21/04
to
> I would like you to give us the reasons for these features and why you
> didn't use C++ ...

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.

r...@vitanuova.com

unread,
May 21, 2004, 12:19:17 PM5/21/04
to
> > just the C lexer wouldn't be too hard, and would be useful.
>
> which C?

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?

Joel Salomon

unread,
May 21, 2004, 1:34:53 PM5/21/04
to
> 1 right button click: meaning-search
> 2 quick right button clicks: Look
> 3 very quick right button clicks: Lookw

http://ars.userfriendly.org/cartoons/?id=19980713
(also: http://ars.userfriendly.org/cartoons/?id=19990213 )

--Joel

boyd, rounin

unread,
May 21, 2004, 1:50:41 PM5/21/04
to
> 1 right button click: meaning-search
> 2 quick right button clicks: Look
> 3 very quick right button clicks: Lookw

as i've said before:

why not revert to morse keys and code?

Jason Gurtz

unread,
May 21, 2004, 2:11:27 PM5/21/04
to
On 5/21/2004 13:46, boyd, rounin wrote:

> 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

--

boyd, rounin

unread,
May 21, 2004, 2:26:09 PM5/21/04
to
> Carpal^H^H^H^H^H^Hstraight key or dual paddle?

straight key. only sissies use paddles or auto-keyers.

'73 de VK2BHR/P

ron minnich

unread,
May 21, 2004, 8:57:55 PM5/21/04
to
On Fri, 21 May 2004, Anastasopoulos S wrote:

> 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

Micah Stetson

unread,
May 23, 2004, 10:10:21 PM5/23/04
to
> > i before e, except after c, except ...
>
> like 'surveillance' which probably is an imported french word (rob will
> correct me) from verb 'surveiller'.

"'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

Greg Pavelcak

unread,
May 23, 2004, 10:40:32 PM5/23/04
to
Neither leisured foreigner seized the heifer while
eating caffeine and codeine at a weird height with
a kaleidoscope.

Eric KD5UWL

unread,
May 24, 2004, 2:01:22 AM5/24/04
to

Well, technically,

> 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

boyd, rounin

unread,
May 24, 2004, 11:50:57 AM5/24/04
to
> the "ei" does come after "c" in "caffeine" and "codeine".
>
> Do I win $10,000?

nope, the rule covers words with c being the previous character.

Micah Stetson

unread,
May 24, 2004, 6:34:18 PM5/24/04
to
> Neither leisured foreigner seized the heifer while
> eating caffeine and codeine at a weird height with
> a kaleidoscope.

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

0 new messages