Upcoming o:XML language changes
Martin Klang <[email protected]> Mon, 23 Apr 2007 11:42:10 +0100
| Newsgroups | gmane.text.xml.o-xml |
|---|---|
| Message-ID | <[email protected]> |
Hello all, I'm planning to implement some fairly substantial language changes to o:XML and o:Lib. The new language version will be called o:XML 1.2, which will be implemented in ObjectBox v1.2.0. The most visible change will be a new naming convention, which will give more consistent, and hopefully meaningful names to all built in and o:Lib types and functions. The naming convention will be, in short: Type names: UpperCamelCase, eg SystemError Type functions: UpperCamelCase, eg GetStackTrace() Global functions (eg XPath functions): hyphenated lower case, eg normalize-space() Another important, and necessary, change is to do with type declarations and nodesets. Nodesets are used in o:XML as general- purpose lists, similar to tuples or arrays in other languages. Type declarations will be extended to allow the following notation: Type - cardinality 1; denotes a single node of type 'Type'. Type? - cardinality 0 or 1; either an empty nodeset or a single node of type 'Type'. Type+ - 1 or more nodes of type 'Type' (ie a single node, or a nodeset with more than one nodes of type 'Type'). Type* - 0 or more nodes of type 'Type'. hence a function can be declared thus: <o:function name="AddNumbers"> <o:param name="nums" type="Number+"/> <!-- 1 or more Numbers --> or <o:function name="CheckValid"> <o:param name="item" type="String?"/> <!-- 0 or 1 Strings --> The change means, amongst other things, that you cannot pass an empty nodeset instead of a String to a function which expects a String or String+. Thirdly, the built in type hierarchy is subject to change. The current proposal is to introduce a new top-level type called Object. Object will have two main subtypes, Node (for XML constructs) and Value (for value-types), though other types may also inherit directly from Object. Node will still be the super type of all different XML constructs, though String, Number and Boolean will be moved to inherit directly from Value. They will be replaced under Node by a new type called Text (representing all types of PC data). The time schedule for these changes are to finalise the new language and produce a beta compiler in the next 2-3 weeks. Before the new version is made public, a new release of ObjectBox will be done that supports the current language variant. Please let me know what you think about the proposed changes, and if you feel there are others which should be added to the list. best regards, /m