Skip to content
This repository was archived by the owner on Feb 20, 2024. It is now read-only.

Modular system ? #9

Open
booti386 opened this issue Mar 18, 2016 · 2 comments
Open

Modular system ? #9

booti386 opened this issue Mar 18, 2016 · 2 comments

Comments

@booti386
Copy link

Is a modular system planned ? Or at least, an "ifexists" macro, or a lazy constant assignment ?

@evanw
Copy link
Owner

evanw commented Mar 18, 2016

I'm not sure what you're asking. Could you give examples or more information? Are those all related or separate? I am planning to do a package system at some point. Skew also supports conditional compilation if that's what you meant by an "ifexists" macro:

if TARGET == .JAVASCRIPT {
  def log(text string) { dynamic.console.log(text) }
} else if TARGET == .CSHARP {
  def log(text string) { dynamic.System.Console.WriteLine(text) }
}

@booti386
Copy link
Author

It would be useful in order to enable modular compilation, if different projets depends on another. Here is a happy case :
A => libZ
B => libZ
A and B are fully independent, so yeayh.

Here, no problem again :
libW => libZ
A => libW

But there :
libW => libZ
A => libW, libZ
If libW is an optional module, it means that A must roll-in its own version of libZ. Which will cause conflicts, unless a internal mechanism exists to allow only a single copy of the given library to be included.

So, with an hypothetical ifnexists:

ifnexists LIBZ_ID {
    const LIBZ_ID = 1
    # ...
}

So it could be useful to implement that. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants