eclipse-archived / ceylon

The Ceylon compiler, language module, and command line tools
http://ceylon-lang.org
Apache License 2.0
399 stars 62 forks source link

Allow constants in module descriptor #4346

Open CeylonMigrationBot opened 9 years ago

CeylonMigrationBot commented 9 years ago

[@FroMage] It'd be pretty neat to be able to do:

module foo "1" {
  value springVersion = "2.0";
  import spring.core springVersion;
  import spring.web springVersion;
  import spring.winter springVersion;
}

I think we could allow that, but only for module versions (it'd be ambiguous for module names which can be non-quoted), and only for values defined locally: we can't make the values be defined in another module because we can't import other modules until all versions are resolved, so versions can't depend on other modules.

If we had a notion of constant expressions (string, number, boolean, string interpolation) (which we may already have for annotations), then this should be doable.

Note that I'm already adding something similar in module overrides.

[Migrated from ceylon/ceylon-spec#1240]

CeylonMigrationBot commented 9 years ago

[@thradec] I would like to see some concept of version management between multiple modules in future. (for example to be able to define used versions for whole project, which consists of several modules in one place)

CeylonMigrationBot commented 9 years ago

[@gavinking] @thradec That's what assemblies are for.

CeylonMigrationBot commented 9 years ago

[@FroMage] Well, sure, but this is another issue ;) This one is just about simplifying existing module descriptors.

CeylonMigrationBot commented 9 years ago

[@thradec] @gavinking I thought, that assemblies are for composing modules together into "application", with support of resolving version conflicts, which is slightly different from my use case.

CeylonMigrationBot commented 9 years ago

[@gavinking] @thradec sounds like "define used versions for whole project".

project==assembly.

CeylonMigrationBot commented 9 years ago

[@thradec] Well, if assemblies will allow to omit version in dependency import and defined it from one place elsewhere, then great ;-).