RE: namespace rules for functions and variables still confusing

>
>
>The user should also be free to declare
>the local function namespace as default function namespace, thus allowing
>the use of unqualified user functions.
>
>  
>
I think it is possible, but it is pretty ugly:

declare default function namespace "http://www.w3.org/2003/11/xquery-local-functions"

Indeed, local: prefixes everywhere make the code difficult to read
and can even be misleading. I couldnt find a better prefix,
both neutral and meaningful, so my preferred solution would be to
declare local as default NS, at the cost of adding fn: in front of all calls
to predefined functions.

** Suggestion: change the URI of the "local" namespace to something
   simple and meaningful like ... "local": 

declare default function namespace "local"

After all, there is no point to use a "*Universal* Resource Identifier" (URI)
since it is by definition local.

|
|

>>   - it sounds odd that "All variable names declared in a
>> library module *must be
>>     explicitly* qualified by the namespace prefix of the
>> module's target namespace."
>>
>>     Wouldn't it be simpler to force this namespace if no
>> prefix is specified ?
>>     This is a common practice in most programming languages.
>>     that is, in the following example the variable $v would
>> be automatically in
>>     namespace X:
>>
>> 	module namespace x = "X";
>> 	declare variable $v { ... }
>
>In many programming languages, and in XMLSchema as well, declared symbols
>automatically belong to the module (namespace, package, ...) in which they
>are declared, without requiring further qualification. Qualification is only
>required when refering to those symbols. It seems to me that library
>functions and variables names should not need to be qualified during their
>declarations. This would automatically enforce the rule that the namespace
>of variables and functions must necessarily match the namespace of the
>module in which they are declared.
>
>Similarly, the use of the "local" prefix should be limited to the references
>to locally-defined user functions. The user should also be free to declare
>the local function namespace as default function namespace, thus allowing
>the use of unqualified user functions.
>
>Antoine Mensch
>  
>

Received on Wednesday, 4 February 2004 07:56:59 UTC