more thoughts
Monday, 8 December 2014 · 4 messages · last reply 9 Dec 2014
RS
Rob Stapper8 Dec 2014 12:12 #
Hi Christian,
Now I'm still on it, I've another thought; c.q. request.
With closures as datastructures we're half way an OOP'ish-implementation.
The other half concerns class-methods.
Modules work pretty good here, ( now it comes) however it would be nice if some sort of inheritance could be implemented.
For example: I store my map:update-function ( see my previous mail) with some other map-sugar functions in "XQR.map"-module, which is just an extension in the BaseX map-module.
If I don't want to be put up with both modules in my program, which for obvious reasons is a good attitude, I have to redirect all standard map-function calls in my self defined XQR.map-module to Basex's map-module.
But now I find myself programming these redirections, which, for the same obvious reasons, is not an optimal situation.
I was wondering if there is or maybe can be created, an easy way to redirect unresolved function calls within a module to a specified module. With or without entering W3C-territory.
What's your opinion on this?
Rob Stapper
---
Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware. http://www.avast.com
CG
Christian Grün8 Dec 2014 16:11 #
Hi Rob,
My experience so far is that people out there implement things very differently with XQuery. While some (well, actually most people) completely avoid higher-order features, few others try to do the same they would do in e.g. Haskell.
This is also the reason why it's difficult for me to give general advice on how to "simulate" inheritance in XQuery. You can use maps to build structures are similar to objects, but you lose static type safety pretty soon. Introducing inheritance in XQuery is once again nothing that I would dare to tackle on my own. Once again, the people on the talk at x-query.com mailing list may give you some more inspiration on that.
But of course, I am also interested in the feedback of other HOF aficionados on this list.
Christian
Quoted text · Rob Stapper · 52 lines
On Mon, Dec 8, 2014 at 12:12 PM, Rob Stapper <r.stapper at lijbrandt.nl> wrote: > Hi Christian, > > > > Now I’m still on it, I’ve another thought; c.q. request. > > > > With closures as datastructures we’re half way an OOP’ish-implementation. > > The other half concerns class-methods. > > Modules work pretty good here, ( now it comes) however it would be nice if > some sort of inheritance could be implemented. > > > > For example: I store my map:update-function ( see my previous mail) with > some other map-sugar functions in “XQR.map”-module, which is just an > extension in the BaseX map-module. > > If I don’t want to be put up with both modules in my program, which for > obvious reasons is a good attitude, I have to redirect all standard > map-function calls in my self defined XQR.map-module to Basex’s map-module. > > But now I find myself programming these redirections, which, for the same > obvious reasons, is not an optimal situation. > > > > I was wondering if there is or maybe can be created, an easy way to > redirect unresolved function calls within a module to a specified module. > With or without entering W3C-territory. > > > > What’s your opinion on this? > > > > Rob Stapper > > > ------------------------------ > <http://www.avast.com/> > > Dit e-mailbericht is gecontroleerd op virussen met Avast > antivirussoftware. > www.avast.com > >
RS
Rob Stapper8 Dec 2014 17:44 #
Hi Christian,
I understand and respect where you are standing.
Too bad because it all would make a true powerful combination.
Oh well, you can’t have it all, there must be something left to wish for.
Rob
Quoted text · Christian Grün · 29 lines
Van: Christian Grün [mailto:christian.gruen at gmail.com] Verzonden: maandag 8 december 2014 16:11 Aan: Rob Stapper CC: BaseX Onderwerp: Re: [basex-talk] more thoughts Hi Rob, My experience so far is that people out there implement things very differently with XQuery. While some (well, actually most people) completely avoid higher-order features, few others try to do the same they would do in e.g. Haskell. This is also the reason why it's difficult for me to give general advice on how to "simulate" inheritance in XQuery. You can use maps to build structures are similar to objects, but you lose static type safety pretty soon. Introducing inheritance in XQuery is once again nothing that I would dare to tackle on my own. Once again, the people on the talk at x-query.com mailing list may give you some more inspiration on that. But of course, I am also interested in the feedback of other HOF aficionados on this list. Christian On Mon, Dec 8, 2014 at 12:12 PM, Rob Stapper <r.stapper at lijbrandt.nl> wrote: Hi Christian, Now I’m still on it, I’ve another thought; c.q. request. With closures as datastructures we’re half way an OOP’ish-implementation. The other half concerns class-methods. Modules work pretty good here, ( now it comes) however it would be nice if some sort of inheritance could be implemented. For example: I store my map:update-function ( see my previous mail) with some other map-sugar functions in “XQR.map”-module, which is just an extension in the BaseX map-module. If I don’t want to be put up with both modules in my program, which for obvious reasons is a good attitude, I have to redirect all standard map-function calls in my self defined XQR.map-module to Basex’s map-module. But now I find myself programming these redirections, which, for the same obvious reasons, is not an optimal situation. I was wondering if there is or maybe can be created, an easy way to redirect unresolved function calls within a module to a specified module. With or without entering W3C-territory. What’s your opinion on this? Rob Stapper _____ <http://www.avast.com/> Afbeelding verwijderd door afzender. Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware. www.avast.com <http://www.avast.com/> --- Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware. http://www.avast.com
MG
Marc van Grootel9 Dec 2014 13:31 #
My personal opinion on this is that I hope XQuery develops even more in a functional direction and stays away from most OOP-ish constructs. I favor functional composition way above OOP.
Wrt maps: more choice for keys could be useful I suppose but so far I do not miss much really. Not sure if making keys more complex would result in decreased performance which is probably an important reason for having alternative datastructures like maps and arrays.
Quoted text · Rob Stapper · 129 lines
On Mon, Dec 8, 2014 at 5:44 PM, Rob Stapper <r.stapper at lijbrandt.nl> wrote: > Hi Christian, > > > > I understand and respect where you are standing. > > Too bad because it all would make a true powerful combination. > > > > Oh well, you can’t have it all, there must be something left to wish for. > > > > Rob > > > > *Van:* Christian Grün [mailto:christian.gruen at gmail.com] > *Verzonden:* maandag 8 december 2014 16:11 > *Aan:* Rob Stapper > *CC:* BaseX > *Onderwerp:* Re: [basex-talk] more thoughts > > > > Hi Rob, > > > > My experience so far is that people out there implement things very > differently with XQuery. While some (well, actually most people) completely > avoid higher-order features, few others try to do the same they would do in > e.g. Haskell. > > > > This is also the reason why it's difficult for me to give general advice > on how to "simulate" inheritance in XQuery. You can use maps to build > structures are similar to objects, but you lose static type safety pretty > soon. Introducing inheritance in XQuery is once again nothing that I would > dare to tackle on my own. Once again, the people on the talk at x-query.com > mailing list may give you some more inspiration on that. > > > > But of course, I am also interested in the feedback of other HOF > aficionados on this list. > > > > Christian > > > > > > > > > > On Mon, Dec 8, 2014 at 12:12 PM, Rob Stapper <r.stapper at lijbrandt.nl> > wrote: > > Hi Christian, > > > > Now I’m still on it, I’ve another thought; c.q. request. > > > > With closures as datastructures we’re half way an OOP’ish-implementation. > > The other half concerns class-methods. > > Modules work pretty good here, ( now it comes) however it would be nice if > some sort of inheritance could be implemented. > > > > For example: I store my map:update-function ( see my previous mail) with > some other map-sugar functions in “XQR.map”-module, which is just an > extension in the BaseX map-module. > > If I don’t want to be put up with both modules in my program, which for > obvious reasons is a good attitude, I have to redirect all standard > map-function calls in my self defined XQR.map-module to Basex’s map-module. > > But now I find myself programming these redirections, which, for the same > obvious reasons, is not an optimal situation. > > > > I was wondering if there is or maybe can be created, an easy way to > redirect unresolved function calls within a module to a specified module. > With or without entering W3C-territory. > > > > What’s your opinion on this? > > > > Rob Stapper > > > ------------------------------ > > [image: Afbeelding verwijderd door afzender.] <http://www.avast.com/> > > Dit e-mailbericht is gecontroleerd op virussen met Avast > antivirussoftware. > www.avast.com > > > > > > > ------------------------------ > <http://www.avast.com/> > > Dit e-mailbericht is gecontroleerd op virussen met Avast > antivirussoftware. > www.avast.com > >
--
--Marc
Written for BaseX 7.9. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery