Hi,
I'm working on an experimental framework with coffeescript. All my classes/mixins are namespaced like this:
MyFrameworkNamespace.Mixin.Observable: {}
MyApp.Class.Controller.Index: {}
...and so on. In my code I do:
( ->
# Import classes/packages into this closure
Index: MyApp.Class.Controller.Index
Mixin: MyFrameworkNamespace.Mixin
c: new Index()
$.extend(true, c, Mixin.Observable)
)()
Now idealy i would like a smart Import keyword that would do the imports for me:
( ->
# Loops through MyFrameworkNamespace.Mixin and imports all mixins
import MyFrameworkNamespace.Mixin.*
# import into variable Ind
import MyApp.Class.Controller.Index as Ind
c: new Ind()
$.extend(true, c, Observable)
)()
The implementation for this would be very simple. What do you think about this?
EDIT:
Perhaps this would be allowed as well:
from MyNameSpace.Mixin import Observable, Enumerable as Enum, Countable
Hi,
I'm working on an experimental framework with coffeescript. All my classes/mixins are namespaced like this:
MyFrameworkNamespace.Mixin.Observable: {} MyApp.Class.Controller.Index: {}...and so on. In my code I do:
Now idealy i would like a smart Import keyword that would do the imports for me:
The implementation for this would be very simple. What do you think about this?
EDIT:
Perhaps this would be allowed as well: