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

Re: local alias for global object

No replies
Daniel Degrandi
Joined: 2010-05-10,
User offline. Last seen 42 years 45 weeks ago.

What do you mean by "global". It must be in some package or so. If you
have the object in scope just assign it to another val or import it
and give it an alias as shown before.

On 19 Sep., 00:48, "Russ P." wrote:
> I may be having a brain freeze here. Suppose I have a global singleton
> object with a long name, and I want a shorter alias for it in a local
> scope (because I will refer to it  many times, and I want clean code
> without a lot of line breaks). What is the syntax? I tried simply
> assigning it to another name, but that didn't work. Thanks.
>
> --Russ P.

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