Clark C . Evans [mailto:cce@...] wrote:
> Not to throw more fuel into the fire, but I
> was thinking that it may be consistent to use
> the / as the hierarchical indicator.
Actually there's a detailed description in the URI spec on the *recommended*
way to do hierarchies. If we followed it we should write:
Likewise we'd have to write !//java/com/sun/jini/admin|... etc.
> The reason why I propose this is that I think that :: is
> reserved for use only as the scheme separator in URIs,
> thus "pkg:perl/Top::Middle" would be an invliad uri -- but
> I could be reading the spec wrong.
Hmmm... A URI *always* start with a "scheme:". So anything following is OK,
including ':'. Look at appendix A. Actually it is '/' which is not valid
unless you follow their strict rules about hierarchy...
At any rate, using //lang/data/type is "more compatible" with "normal" URIs,
and I can guess Brian's reaction :-) To his questions:
> WTF are we using 'type' instead of 'yaml'
> for the scheme?
We had this notion that this scheme would be universally useful... Being
able to say "I'm in namespace X of language Y" is useful beyond YAML. Hence
the use of 'type:' (which is confusing), or 'pkg:' (which is also confusing)
or 'ns:' (which isn't). Of course we could use 'yaml:', that would probably
generate less pushback...
> > ... I'm uneasy about the Perl example. Isn't 'Net' a "package name"?
> > It seems to me that it would be better to write:
> > !perl/Net|%Ftp
> What part of "Ack!!" don't you understand?
> "Net" is not a package name in this case. "Net::FTP" is the package. Perl
> packages do not nest.
This is exactly the point! A Perl package is (can be) a type - just like a
Java class name. You can create objects of that type. 'Net' is a
*namespace*; it is like a Java package. You can't create an instance of a
Java package. So:
Java: "java.lang" is not a class (it is a package)
Perl: "Net" is not a package name (it is a namespace)
Java: "java.lang.Integer" is the class
Perl: "Net::Ftp" is the package
Java: Classes and packages do not nest.
Perl: Packages and namespaces do not nest.
Perl uses the word "package" rather differently than most other languages.
In every other language "package" means "bunch of related stuff". In Perl it
can mean that... but it also means "an object data type".
Let's use the words "data type" and "namespace" as language independent
terms. If you are saying "Net is not a data type" I agree. If you are saying
"Net is not a namespace" I disagree. What is it then?
So I still think the "correct" way is !perl/Net|%Ftp.
Perhaps Clark's idea: !//perl/Net|%Ftp isn't that bad after all. It divorces
the names from the language specific syntax...
<duck for cover>.