ns_func_cleanup branch, notes

Andrew Whitworth wknight8111 at gmail.com
Fri May 28 01:20:00 UTC 2010


I started the ns_func_cleanup branch the other night because I was
getting angry at the crap inside src/global.c, so I decided to fix it.

First part of the branch is renaming functions to follow proper naming
conventions, and in some cases to be more accurate/descriptive about
what they do:
Parrot_get_namespace_keyed* -> Parrot_ns_get_namespace_keyed*
Parrot_make_namespace_keyed* -> Parrot_ns_make_namespace_keyed*
Parrot_make_namespace_autobase -> Parrot_ns_make_namespace_autobase
Parrot_[get|set]_global -> Parrot_ns_[get|set]_global
Parrot_find_global_curr -> Parrot_ns_find_current_namespace_global
Parrot_store_global_s -> Parrot_ns_store_global
Parrot_find_global_op -> Parrot_ns_find_global_from_op
Parrot_store_sub_in_namespace -> Parrot_ns_store_sub
Parrot_find_name_op -> Parrot_ns_find_named_item

Next part, I renamed files to be more accurate:
src/global.c -> src/namespace.h
include/parrot/global.h -> include/parrot/namespace.h

Finally, I've been scrolling back and forth through the file, cleaning
things up. In some cases I improved short-circuiting of some
operations, but I doubt there is any measurable improvement from that.

I've found two functions that are completely unused in the repo, so I
created TT #1660 to suggest deprecation. I have not renamed those
functions in this branch, because I don't want to confuse the issue.
If we decide to keep those two functions, I will give them better
names.

TT #1223 should be very fixable, but I need some kind of test case
that I can follow to make sure I know what the appropriate fix is. If
somebody can write such a test case, I will provide the fix.

Several other tickets are referenced in TODO notes in this file, some
of which are very cryptic. I would like to get some eyes on TT #1219,
#1220, #1221, #1222, #1223, #1224, and #1225. I'll fix any and all of
these tickets if I can get some clarification on what is needed. If
these tickets turn out to be bogus (and some are so old, I don't doubt
that they will), we can close them.

I'm not in any huge hurry, but if we can get these issues looked at we
can get them fixed and then get this branch merged. And there will be
much rejoicing.

--Andrew Whitworth


More information about the parrot-dev mailing list