- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Why are uniqueness annotations added behind their target
Thu, 2010-12-09, 09:56
Hi,
Looking at the uniqueness plugin I wonder why the @unique and @peer annotations are added behind the val / parameter. Why not in front? Like this:
@unique val logList: LogList = new LogList
Thanks,
Heiko
Company: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Akka - Simpler Scalability, Fault-Tolerance, Concurrency & Remoting through Actors: akkasource.org
Looking at the uniqueness plugin I wonder why the @unique and @peer annotations are added behind the val / parameter. Why not in front? Like this:
@unique val logList: LogList = new LogList
@transient def add(@peer(this) file: LogFile) = ...
Thanks,
Heiko
Company: weiglewilczek.com
Blog: heikoseeberger.name
Follow me: twitter.com/hseeberger
OSGi on Scala: scalamodules.org
Lift, the simply functional web framework: liftweb.net
Akka - Simpler Scalability, Fault-Tolerance, Concurrency & Remoting through Actors: akkasource.org
Syntactically, I guess because the types are annotated and not the
statements/definitions. AFAIK the uniqueness plugin extends the type
system so this basically makes sense for me.
But I guess you are getting at the readability of code written like that.
Johannes
On Thu, Dec 9, 2010 at 9:54 AM, Heiko Seeberger
wrote:
> Hi,
> Looking at the uniqueness plugin I wonder why the @unique and @peer
> annotations are added behind the val / parameter. Why not in front? Like
> this:
> @unique val logList: LogList = new LogList
>
> @transient def add(@peer(this) file: LogFile) = ...
>
> Thanks,
> Heiko
>
> Company: weiglewilczek.com
> Blog: heikoseeberger.name
> Follow me: twitter.com/hseeberger
> OSGi on Scala: scalamodules.org
> Lift, the simply functional web framework: liftweb.net
> Akka - Simpler Scalability, Fault-Tolerance, Concurrency & Remoting through
> Actors: akkasource.org
>