W3C home > Mailing lists > Public > public-qa-dev@w3.org > June 2005

Re: [check] strange usage of $File->{Version}

From: Terje Bless <link@pobox.com>
Date: Fri, 3 Jun 2005 03:20:41 +0200
To: Olivier Thereaux <ot@w3.org>
cc: public-qa-dev@w3.org
Message-ID: <d02020003-1041-B60F11A63BAE451DA6D35095423F9AE8@[193.157.66.12]>

Olivier Thereaux <ot@w3.org> wrote:

>I'd appreciate if we could figure out what, in check, $File->{Version}
>actually is. In most cases, it's used as "the best name we have for
>the document type".

«The best info we currently have for what kind of document this is.»


>Except that it also seems to be used to hold the content of the "version"
>attribute of the root element, "sniffed" from the ESIS:

This is a legacy thing, but it’s trying to use the @version to guess in case we
won’t get better information from a DOCTYPE declaration. Basically it’s an
attempt to work around the fact that OpenSP doesn’t report the effective FPI in
its output.


>- is my analysis correct? Did I miss or misunderstand anything?

Essentially, yes.


>- is that a honest mistake, due to some confusion in variable names,
>or is it on purpose?

It’s deliberate. $File->{Version} is where we stash the best info we have about
the document type at any given point in the code. As we find more info the
contents of the variable gets closer to what will eventually be displayed to the
user (i.e. an FPI gets replaced with a PrettyVer).


>* if the former, I think we could use $File->{Version} only for the
>version attribute info, and using a new var for the "Document Type".

The variable is overloaded, yes. More granularity would probably be a good idea
here, but mind we don’t add too many more (essentially global vars) entries in
the $File hash.

The entirety of $File is as a faux “object”; IOW it allows us to not pass a
gazillion variables back and forth between subs, but at the price of essentially
defating Perl’s type and scope checking, and introucing a glkobal variable.

The intent is that it will become an actual object — where object variables are
actual individual variables, local to the object, and with get/set accessor
methods — during M12N.


That said, we might bear to have separate variables for each possible source of
document type info, plus one further var where we keep the aggregate value which
will be displayed to the user.

-- 
"A plague o' both your houses! I am sped." - Mercutio, kinsman to the Prince.
                   See Project Gutenberg <URL:http://promo.net/pg/> for more.
Received on Friday, 3 June 2005 01:20:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 19 August 2010 18:12:45 GMT