This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: improvements to import form


> On Apr 15, 2015, at 1:07 AM, Per Bothner <per@bothner.com> wrote:
> 
> Using define-alias to abbreviate a classname is a bit verbose:
> 
> (define-alias StringBuffer java.lang.StringBuffer)
> 
> I checked in a new variant of import which should be more convenient:
> 
> (import (class java.lang StringBuffer))
> 
> The syntax is (import (class PREFIX NAME1 NAME2 ... NAMEN)).
> This is roughly equivalent to:
>  (define-alias NAME1 PREFIX.NAME1)
>  (define-alias NAME2 PREFIX.NAME2)
>  ...
>  (define-alias NAMEN PREFIX.NAMEN)
> 
> Strictly speaking, it's more like define-private-alias, since the new
> names are (by default) not exported.

Thanks, Per. This is very nice for my uses and will eliminate some macrology I've been using.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]