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

Accepted abbreviations

7 views
Skip to first unread message

Juerd

unread,
Apr 22, 2005, 7:46:26 AM4/22/05
to perl6-l...@perl.org
Can we together compile a list of accepted abbreviations, so they can be
consistently applied?

I'll begin with the most basic ones:

aref array reference
bool boolean
const constant
elem element
err error
fh filehandle
func function
href hash reference
int integer
kv key/value
num number
obj object
op operator, operation
r read(able)
ref reference
regex regular expression
rw read/write
str string
sub subroutine
w write(able)

Some may be source of discussion, in which case I think it's better to
pick one -perhaps against someone's preference- than to use a dozen
abbreviations for the same thing. One such example is "regex", which
used to be spelled by most as "regexp". (Yes, I know we're using rules
now... :).)


Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html

Juerd

unread,
Apr 22, 2005, 10:18:16 AM4/22/05
to Juerd, Aaron Sherman, Perl6 Language List
Juerd skribis 2005-04-22 16:11 (+0200):
> Those are for identifiers, so we don't end up with one function using :r
> and another using :read. That'd be inconsistent.

Although readline should not be made rline, and I still think both :r
and :read should work!

Bool +$read is short<r>

or preferrably with even simpler syntax:

Bool +$read|r

Aaron Sherman

unread,
Apr 22, 2005, 10:00:03 AM4/22/05
to Juerd, Perl6 Language List
On Fri, 2005-04-22 at 07:46, Juerd wrote:
> Can we together compile a list of accepted abbreviations, so they can be
> consistently applied?

Are you suggesting that these are accepted by the compiler or by us (for
discussion)?

> Some may be source of discussion, in which case I think it's better to
> pick one -perhaps against someone's preference- than to use a dozen
> abbreviations for the same thing. One such example is "regex", which
> used to be spelled by most as "regexp". (Yes, I know we're using rules
> now... :).)

This makes it sound like you mean us, not the compiler. I'll work with
that assumption.

You can decide to use whatever you like, but if you're honestly
expecting that people participating in this mailing list are going to
use your favorite abbreviations, you're the kind of person I think we
should have more of in the world: optimists (opmst for short). ;-)

Seriously, do any of us have a hard time making out what someone means
if they say "regexp" vs "regex"?

What's more, I'd rather you didn't w comments with single-letter
abbreviations, as it would make it much harder for me to r.

--
Aaron Sherman <a...@ajs.com>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback


Juerd

unread,
Apr 22, 2005, 10:11:55 AM4/22/05
to Aaron Sherman, Perl6 Language List
Aaron Sherman skribis 2005-04-22 10:00 (-0400):

> On Fri, 2005-04-22 at 07:46, Juerd wrote:
> > Can we together compile a list of accepted abbreviations, so they can be
> > consistently applied?
> Are you suggesting that these are accepted by the compiler or by us (for
> discussion)?

By us. Mostly for the purpose of choosing identifiers (str, and thus
substr, not substring), but also for discussion (we talk about subs, not
subroutines) and perhaps documentation.

See below for further clarification.

> You can decide to use whatever you like, but if you're honestly
> expecting that people participating in this mailing list are going to
> use your favorite abbreviations, you're the kind of person I think we
> should have more of in the world: optimists (opmst for short). ;-)

No, it's not to change the world. But whatever ends up in the official
thing, should be consistent throughout. And for that, we need consensus.

Because it can take a long time before people agree, I think we should
begin as early as possible.

Using identifiers consistently also helps when reading example code. For
example, $fh is immediately clear, as are $dbh and $sth. But when
someone uses $handle, $connection and $statement for these, it gets a
bit harder.

Learning something is easiest when in the explanation of one thing, you
recognise parts of something you've already seen. And for that, you need
consistent documentation, along with consistent usage in the language
itself.

To provide one example: a few years ago I had a very hard time trying to
figure out what 'ary' stood for, simply because in the lots of Perl
documentation and code, I had not seen it before.

Things that come naturally for experienced programmers can be very
intimidating for beginners, and wherever we can, I think we should
provide consistency.

Of course I'm NOT saying that we should start considering one of regex
and regexp wrong. When it comes to reading, both are equally good and
recogniseable to everyone subscribed to this mailinglist. But many
beginners wonder what the p in regexp stands for!

> What's more, I'd rather you didn't w comments with single-letter
> abbreviations, as it would make it much harder for me to r.

Those are for identifiers, so we don't end up with one function using :r


and another using :read. That'd be inconsistent.

I should have been clearer when I sent the initial list. I'm not trying
to change the world. Sorry about that.

Konovalo

unread,
Apr 24, 2005, 2:24:42 AM4/24/05
to Juerd, perl6-l...@perl.org

> aref array reference
> bool boolean
> const constant
> elem element
> err error
> fh filehandle
> func function
> href hash reference
> int integer
>
>

interp interpreter
i iterator?

> kv key/value
> num number
> obj object
> op operator, operation
> r read(able)
> ref reference
> regex regular expression
>
>

expr expression

> rw read/write
>
>
ro read-only

> str string
> sub subroutine
> w write(able)
>
>

in input
out output
io input/output
mem memory
os operating system
anon anonymous

interestingly, among references there are aref and href, but scalar and
subroutine references are not presented.

Vadim

Juerd

unread,
Apr 24, 2005, 5:21:13 AM4/24/05
to konovalo, perl6-l...@perl.org
konovalo skribis 2005-04-24 10:24 (+0400):
> interp interpreter

I don't recall having seen that used.

> i iterator?

Used as such, but I think discouraging i in favour of iter is a better
idea, because i is also often used as index.

> anon anonymous

Is this used?

> interestingly, among references there are aref and href, but scalar and
> subroutine references are not presented.

Because I have never seen them used as <singleletter>ref yet. Probably
because sref would be highly ambiguous.

0 new messages