New style framework in plugins

How does new style framework affect plugins ?

For example how would we create instance of the objects ? Just pass in full path to the REALGetClassRef ?

I don’t use new frameworks currently in plugins.

text auto converts to string when calling plugin, so there is no big problem in that direction.
Folderitem from new framework is not yet available in desktop apps. But I’d wish to have it auto convert to old folderitem, so plugin doesn’t need to overload all methods.
Same for other data types.

I don’t either but I see it comming down the road and I would hate to find out then that plugins were not thought of, as in that we cannot create instance of those classes.

When you mentioned the overloads then I decided to do some tests, its really horrible

If doing the following overloads:

Add(item as String)
Add(item as Text)

Then it will work in Xojo if you do:

Dim a as String = “Test”

object.Add(a)

but not if you do

Dim a as Text = “Test”

object.Add(a)

And not if you do:

object.Add(“Test”)

This pretty much rules out all overloading for sake of supporting many things and for sake of optimizations. Am guessing that the “Test” is already Text thats why that one failed since the Text overload fails.

[quote=183367:@Björn Eiríksson]When you mentioned the overloads then I decided to do some tests, its really horrible

If doing the following overloads:

Add(item as String)
Add(item as Text)

Then it will work in Xojo if you do:

Dim a as String = “Test”

object.Add(a)

but not if you do

Dim a as Text = “Test”

object.Add(a)[/quote]

This works for me. The compiler picks the overload taking the Text and it’s unambiguous.

[quote=183367:@Björn Eiríksson]And not if you do:

object.Add(“Test”)

This pretty much rules out all overloading for sake of supporting many things and for sake of optimizations. Am guessing that the “Test” is already Text thats why that one failed since the Text overload fails.[/quote]

This is to be expected. A quoted literal decays to a String or a Text based off of the context and there’s no clear winner here for the compiler’s overload resolution.

Joe, could you add some preferences there like preferring new framework types?

If there are 2 choices and its quoted literal then make the new one win always. Since I would think over time its the intent to phase out the old one.

Its very hard for us to make a path for plugins towards the new framework if we cannot overload, and if it cannot take quoted literal then people simply won’t be able to use it if we are overloading.

For fast and smooth migration to new framework then you also need plugins on board. Which would mean for us to add overloads to help people use the new framework.

(and a way also to make instances of the new style objects !!!)