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

@privateSetter

5 replies
Landei
Joined: 2008-12-18,
User offline. Last seen 45 weeks 4 days ago.

Hello!

Shouldn't @privateSetter as described in
http://suereth.blogspot.com/2009/02/levaraging-annotations-
in-scala-part-2.html become an official part of Scala?

Cheers,
Daniel

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: @privateSetter

You may want to wait until I work out all the kinks. My simple tests
pass, but nothing complex is passing yet.

Sent from my iPhone

On Feb 6, 2009, at 4:44 AM, Landei wrote:

>
> Hello!
>
> Shouldn't @privateSetter as described in
> http://suereth.blogspot.com/2009/02/levaraging-annotations-
> in-scala-part-2.html become an official part of Scala?
>
> Cheers,
> Daniel

Landei
Joined: 2008-12-18,
User offline. Last seen 45 weeks 4 days ago.
Re: @privateSetter

Josh Suereth wrote:
>
> You may want to wait until I work out all the kinks. My simple tests
> pass, but nothing complex is passing yet.
>

I just wanted to point out that this is IMHO a useful feature, and initiate
a discussion:
- Should this feature be part of Scala?
- Are there any hidden problems?
- Do we need a SIP?
...

Take care!
Daniel

BTW, the link was broken in my first post.
http://suereth.blogspot.com/2009/02/levaraging-annotations-in-scala-part...

David Pollak
Joined: 2008-12-16,
User offline. Last seen 42 years 45 weeks ago.
Re: @privateSetter
Personally, I would hate to see much more in the way of annotations creep into Scala.
I'd also like to understand the reason why we would add something to the language that saves no lines of code and is of arguable clarity.


On Fri, Feb 6, 2009 at 5:46 AM, Landei <Daniel [dot] Gronau [at] gmx [dot] de> wrote:



Josh Suereth wrote:
>
> You may want to wait until I work out all the kinks.  My simple tests
> pass, but nothing complex is passing yet.
>

I just wanted to point out that this is IMHO a useful feature, and initiate
a discussion:
- Should this feature be part of Scala?
- Are there any hidden problems?
- Do we need a SIP?
...

Take care!
Daniel

BTW, the link was broken in my first post.
http://suereth.blogspot.com/2009/02/levaraging-annotations-in-scala-part-2.html
--
View this message in context: http://www.nabble.com/%40privateSetter-tp21869416p21872669.html
Sent from the Scala - Debate mailing list archive at Nabble.com.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp
Erik Engbrecht
Joined: 2008-12-19,
User offline. Last seen 3 years 18 weeks ago.
Re: @privateSetter
I think this is the type of feature that belongs outside the standard distribution.  I personally prefer the more explicit/verbose way, because if a var is public, but it can't be set, then it is not really a public var.  So adding the annotation changes the semantics of the public interface.
But I think it's an interesting example and I am impressed by how simple the code for the compiler plugin is.
Good work Josh!

On Fri, Feb 6, 2009 at 8:46 AM, Landei <Daniel [dot] Gronau [at] gmx [dot] de> wrote:



Josh Suereth wrote:
>
> You may want to wait until I work out all the kinks.  My simple tests
> pass, but nothing complex is passing yet.
>

I just wanted to point out that this is IMHO a useful feature, and initiate
a discussion:
- Should this feature be part of Scala?
- Are there any hidden problems?
- Do we need a SIP?
...

Take care!
Daniel

BTW, the link was broken in my first post.
http://suereth.blogspot.com/2009/02/levaraging-annotations-in-scala-part-2.html
--
View this message in context: http://www.nabble.com/%40privateSetter-tp21869416p21872669.html
Sent from the Scala - Debate mailing list archive at Nabble.com.




--
http://erikengbrecht.blogspot.com/
Alex Cruise
Joined: 2008-12-17,
User offline. Last seen 2 years 26 weeks ago.
Re: @privateSetter

Landei wrote:
> I just wanted to point out that this is IMHO a useful feature, and initiate
> a discussion:
> - Should this feature be part of Scala?
> - Are there any hidden problems?
> - Do we need a SIP?
>
I agree that the feature is useful, but I'm uneasy with the trend of
using annotations for what should be types, or members of types. It
leads to situations like the following...

case class Foo(@BeanProperty var bar) {
override def equals(o: AnyRef) = o == this ||
o.asInstanceOf[Foo].getBar == getBar // error, no such method yet
}
object Foo {
val aFoo = Foo("hi").getBar // this works, presumably due to separate
compilation
}

Some tools for abstraction over methods would be good.

-0xe1a

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