ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

support multiple backends per native annotation #1442

Closed jvasileff closed 8 years ago

jvasileff commented 8 years ago

Basically, make native variadic. This matters when there are three or more backends, since some "native" implementations may be suitable for multiple backends. For example, the Javascript implementation of Contextual can also be used for Dart.

jvasileff commented 8 years ago

I thought this was a copy&paste/DRY inconvenience, but it's actually bug-like—there's no way to have a two-or-more-backend module.

quintesse commented 8 years ago

No for now you can only have one backend per declaration or per module. You can easily make a copy, not nice but certainly not a bug either.

jvasileff commented 8 years ago

You can easily make a copy

How? I mean, I'm not arguing for any particular prioritization, but I don't see how this is possible.

quintesse commented 8 years ago

Just like it is now: you either have a module that works for all backends, or you make a module that works only for a single backend, which would mean that if the JS and the Dart backend code is really the same there's no other way right now than making a copy of the JS module and marking it Dart.

quintesse commented 8 years ago

Ok, this is now "unofficially" implemented. Unofficially because it's not a supported feature for 1.2. Still needs tests too. The syntax is like this native("jvm", "js", "dart")

jvasileff commented 8 years ago

Very cool!

quintesse commented 8 years ago

I'll consider this closed. Any problems can be put in new issues.

FroMage commented 8 years ago

Wrong repo, man.

quintesse commented 8 years ago

Heh