This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Aliasing symbols from the same package

2 replies
Sciss
Joined: 2008-12-17,
User offline. Last seen 28 weeks 5 days ago.

hi,

can i abbreviate this import somehow? (scala 2.8)

package de.sciss.tint.sc
case class EnvSeg( dur: GE, targetLevel: GE, shape: EnvShape = linearShape )
import de.sciss.tint.sc.{ EnvSeg => S }

so that i don't need to repeat the full package name.... these are my attempts, none of them works:

import EnvSeg => S
import { EnvSeg => S }
import sc.{ EnvSeg => S }

?

thanks, -sciss-

hseeberger
Joined: 2008-12-27,
User offline. Last seen 1 year 25 weeks ago.
Re: Aliasing symbols from the same package

package a.b
package c
...
import c.{X => Y}

Heiko

On Thursday, January 28, 2010, Sciss wrote:
> hi,
>
> can i abbreviate this import somehow? (scala 2.8)
>
>        package de.sciss.tint.sc
>        case class EnvSeg( dur: GE, targetLevel: GE, shape: EnvShape = linearShape )
>        import de.sciss.tint.sc.{ EnvSeg => S }
>
> so that i don't need to repeat the full package name.... these are my attempts, none of them works:
>
>        import EnvSeg => S
>        import { EnvSeg => S }
>        import sc.{ EnvSeg => S }
>
> ?
>
> thanks, -sciss-
>
>

Sciss
Joined: 2008-12-17,
User offline. Last seen 28 weeks 5 days ago.
Re: Aliasing symbols from the same package

thanks!

Am 28.01.2010 um 17:54 schrieb Heiko Seeberger:

> package a.b
> package c
> ...
> import c.{X => Y}
>
> Heiko
>
> On Thursday, January 28, 2010, Sciss wrote:
>> hi,
>>
>> can i abbreviate this import somehow? (scala 2.8)
>>
>> package de.sciss.tint.sc
>> case class EnvSeg( dur: GE, targetLevel: GE, shape: EnvShape = linearShape )
>> import de.sciss.tint.sc.{ EnvSeg => S }
>>
>> so that i don't need to repeat the full package name.... these are my attempts, none of them works:
>>
>> import EnvSeg => S
>> import { EnvSeg => S }
>> import sc.{ EnvSeg => S }
>>
>> ?
>>
>> thanks, -sciss-
>>
>>
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland