extending 'import' using 'with'

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 1 11:52:00 PDT 2015


On 2015-04-01 12:21, Mike James wrote:
> Just a thought...
>
> How about adding the keyword 'with' to 'import' to save on typing :-)
>
> import  org.eclipse.swt.widgets.Canvas,
>          org.eclipse.swt.widgets.Composite,
>          org.eclipse.swt.events.DisposeListener,
>          org.eclipse.swt.events.DisposeEvent,
>          org.eclipse.swt.events.PaintListener,
>          org.eclipse.swt.events.PaintEvent;
>
> import with (org.eclipse.swt) {
>          widgets.Canvas,
>          widgets.Composite,
>          events.DisposeListener,
>          events.DisposeEvent,
>          events.PaintListener,
>          events.PaintEvent;
> }

If you're really using DWT and this is not just an example, you can 
import org.eclipse.swt.std to import the most common used modules or 
org.eclipse.swt.all to import all of them.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list