RE: [F&O] Function names

Noe:

Thank you for your comments.

 

Pat Case has already replied to you informing you that the WGs agreed to
remove the initial  "get-" in function names.

See
http://lists.w3.org/Archives/Public/public-qt-comments/2003Nov/0016.html

 

As for the names of the extractor functions, we use the plural forms for
extracting components from durations.

This seems right, as durations typically have multiple years, hours,
minutes, etc. 

 

We use the singular forms for extracting year, month and day from
dateTime, date and time values.

 

We use the plural forms when we extract hours, minutes and seconds from
such values.  This seems more

natural to me but I'm happy to listen to arguments.

 

fn:doc and fn:document - fn:doc is a simplified version of fn:document
that the XQuery WG members found was sufficient 

for XQuery.   fn:document() has been moved to the XSLT 2.0
specification.  We agreed to adding a note there that explains 

why the two functions are needed.

 

Please let us know if your comments have been satisfactorily addressed.

All the best, Ashok 

________________________________

From: public-qt-comments-request@w3.org
[mailto:public-qt-comments-request@w3.org] On Behalf Of Noe Michejda
Sent: Saturday, November 01, 2003 7:04 AM
To: public-qt-comments@w3.org
Subject: [F&O] Function names

 

There are few function in spec with 'get-' prefix:

 get-local-name-from-QName
 get-namespace-from-QName

 get-namespace-uri-for-prefix

 get-in-scope-namespaces

 get-xxx-from-xxx

 

does the prefix carries some meaning? Normally they are used for
getter/setter pairs, but in core all functions are side-effect free.

So why using longer and harder to remember names?

Accessors are very similar set of functions but aren't using 'get-'
prefix.

For example get-local-name-from-QName should be analogous to
local-name($n as node)

 

Also hour/minute/second extractors should use singular forms.

They are extracting named fields. SQL and most programming libraries
already uses singular forms.

 

I propose to change those names to:

 local-name-from-QName

 namespace-from-QName

 namespace-for-prefix

 in-scope-namespaces

 hour-from-XXX

 minute-from-XXX

 second-from-XXX

 day-from-XXX

 month-from-XXX

 year-from-XXX

 

I think expression

 

//visit[hour-from-time(@time)=12]

 

looks more natural that

 

//visit[get-hours-from-time(@time)=12]

 

 

Second thing is doc() vs document()

what is the rationale behind having two so similar functions? Especialy
if you are trying

to cut down function number. It could be very confusing for users using
different languages

Plus all functionality is available through another core functions so
there is no extra work for

implementators. Possibly it would be better to drop document(), but its
not possible (compatiblility).

So why not leave just document()?

 

Regards,

Noe Michejda

7th Portal S.C.

 

 

 

Received on Wednesday, 12 November 2003 14:01:34 UTC