digitalmars.D - Nested imports - y/n
- adnan338 (18/18) Jun 21 2020 Hello, has the idea of nested imports been explored yet?
- Eugene Wissner (3/21) Jun 22 2020 Define a module with imports and aliases you need and import this
Hello, has the idea of nested imports been explored yet? For example if you have: import gtk.Application : Application; import gtk.ApplicationWindow : GAW = ApplicationWindow; import gtk.Nested.This: Symbol; import gtk.Nested.That; import gtk.Entry; With nested imports you would just write something like: import gtk( Application: Application, ApplicationWindow: GAW = ApplicationWindow, Nested( This : Symbol, That ), Entry, ); It would reduce some typing.
Jun 21 2020
On Monday, 22 June 2020 at 03:54:56 UTC, adnan338 wrote:Hello, has the idea of nested imports been explored yet? For example if you have: import gtk.Application : Application; import gtk.ApplicationWindow : GAW = ApplicationWindow; import gtk.Nested.This: Symbol; import gtk.Nested.That; import gtk.Entry; With nested imports you would just write something like: import gtk( Application: Application, ApplicationWindow: GAW = ApplicationWindow, Nested( This : Symbol, That ), Entry, ); It would reduce some typing.Define a module with imports and aliases you need and import this module instead of the direct library imports.
Jun 22 2020