杨文杰 | 2 Feb 18:29 2016
Picon

Contribute to Scala via GSoC(Slick code generator)

Hi, guys:
I'm an undergraduate student from China. I love Scala since I enrolled the coursera class about Scala when I was a freshman two years ago. I want to contribute to Scala. But, I have no experience with contributing to open source community. Recently I found that Google planned to hold the GSoC. I wanna contribute to Scala. There is a suggestion about the Slick code generator. But I'm confused with it. Does it mean that the community plan to rewrite the code generator or just fix some bugs? If I want to join the development of Scala. What should I do now?

I'm so glad to hear your suggestions!

Thanks and best regards.

-----------
Ivan Yang

--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Daniel Armak | 1 Feb 19:50 2016
Picon
Gravatar

VerifyError ascribing java annotations to scala.annotation.Annotation

scala> import scala.reflect.runtime.universe.typeOf scala> import scala.annotation.Annotation scala> import java.lang.Deprecated ​ scala> typeOf[Deprecated] <:< typeOf[Annotation] res0: Boolean = true ​ scala> val x: Deprecated = null x: Deprecated = null ​ scala> x: Annotation java.lang.VerifyError: Bad type on operand stack

The same happens with any Java annotation, Deprecated isn’t special.

What is the intention? Why should Java annotations subtype scala.annotation.Annotation?

This is mentioned in a comment in SI-9400, but that’s about a different issue and I think if this is a bug it deserves its own ticket.

-- 
Daniel Armak

--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Abhishek Kumar | 1 Feb 17:22 2016
Picon

GSoC 2016 ideas

Hello
I am a computer science student from India,I've been involved with Scala open source community for quite some time and have contributed bug fixes to Ammonite project also.I tried to search for prospective GSoC ideas or mentors but ideas page has only one idea.What are some of the projects likely to be there for GSoC 2016?

Thanks
Abhishek

--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Julien Lavergne | 14 Jan 19:04 2016
Picon
Gravatar

how to extend scala classes from groovy traits?

Hi All,

I have some traits in groovy and need to extend some scala classes from them.

How to handle that?

Any idea?

Thx for your feedbacks.

Julien.

--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Julien Lavergne | 14 Jan 16:30 2016
Picon
Gravatar

scala class extends groovy trait ?

Hi All,

I have some traits in groovy and need to extend some scala classes from them.

How to handle that?

Any idea?

Thx for your feedbacks.

Julien.

--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
mrmridcmj | 12 Jan 04:35 2016
Picon

Abstract member may not have private modifier




Hi All


In Scala 2.11.0,


<at> native private def sampleMethod(argOne: Long): Int

private def sampleMethod(argOne: Long): Int

Above declarations gives the following compiler error
 
abstract member may not have private modifier <at> native private def sampleMethod(argOne: Long): Int
 

What is the proper way of declaring native private member method or private member


Note:

<at> native protected def sampleMethod(argOne Long): Int compiles


   

<at> native private def sampleMethod(argOne: Long): Int = 0 compiles but doesn't generate byte code entry

       

  <at> native private def sampleMethod(argOne: Long): Int = _   gives following error


         unbound placeholder parameter <at> native private def sampleMethod(argOne: Long): Int = _


 
These question posted at stack overflow as well http://stackoverflow.com/questions/34718192/why-scala-native-method-can-not-be-private?noredirect=1#comment57185725_34718192

Can anyone explain the rational  behind this behavior

--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Vishesh Chauhan | 6 Jan 13:10 2016
Picon

GSOC 2016 participation

Hello everyone,


I am Vishesh Chauhan a 3rd year student of IIT(BHU), Varanasi, India.

I want to start contributing to the Scala community and wish to participate in GSOC 2016.

I have done the online course on scala offered at coursera and have almost finished the book 'Programming in Scala'. 

Can someone please point me in the right direction ?

--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
shashank kapoor | 4 Jan 13:17 2016
Picon

what type of hashing in scala

Hi
In scala what type of hashing is used? In java it is park-miller by default. So in scala what is the default hashing algorithm?


--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
lalgeo78 | 4 Jan 12:02 2016
Picon

help with weak references

Weak references don't seem to be eagerly collected as the following script illustrates. Why?

---------------------
Welcome to Scala version 2.11.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_60).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import scala.ref.WeakReference
import scala.ref.WeakReference

scala> val rq = new scala.ref.ReferenceQueue[List[Int]]
rq: scala.ref.ReferenceQueue[List[Int]] = java.lang.ref.ReferenceQueue <at> ba2f4ec

scala> case class WR(a: List[Int]) { val wr = new WeakReference(a, rq)}
defined class WR

scala> val wr = WR((0 until 5).toList)
wr: WR = WR(List(0, 1, 2, 3, 4))

scala> val x = wr.wr.get
x: Option[List[Int]] = Some(List(0, 1, 2, 3, 4))

scala> val x = 3      // re-define x
x: Int = 3

scala>  System.gc()

scala> val x = wr.wr.get
x: Option[List[Int]] = Some(List(0, 1, 2, 3, 4))  // <<------ should have been None

scala>

--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Eyal Roth | 29 Dec 14:55 2015
Picon

TypeTag and ClassTag

There's something bothering about TypeTag and ClassTag.

According to the documentation, ClassTag merely contains a subset of the information in TypeTag, but, in fact, each of them has a distinct functionality:

ClassTag makes it possible to check weather any object is of a certain generic-type:
def isInstanceOf[A:ClassTag](o: Any) = classTag[A].runtimeClass.isInstance(o)
AFAIK, one can't achieve that with TypeTag.

Of course, this doesn't cover cases where our generic type is itself a class with a generic type; for instance:
isInstanceOf[List[Int]](List("foo")) // returns true, though we would like it to return false

For that, we need to store the TypeTag of our generic class:
class MyGenericClass[A](implicit t: TypeTag[A]) { val tag = t }

def isGenericOf[A:TypeTag](o: Any) = o match {
   
case gen: MyGenericClass[_] => gen.tag.tpe =:= typeOf[A]
   
case _ => false
}

We could do that with ClassTag, but according to this StackOverflow answer, we'd better use TypeTag.

In this example, we have to use both ClassTag and TypeTag:

trait MyDao {
    def get[A:TypeTag:ClassTag](id: String): A
}


class SingleValueDao extends MyDao {
    var idToValue: Map[String, Any] = Map()
    
    
override def get[A:TypeTag:ClassTag](id: String): A = {
        val v = idToValue(id)
        
if (classTag[A].runtimeClass.isInstance(v)) v
        else throw new Exception("wrong type")
    }
}

class TypedSeq[A](val seq: Seq[A])(implicit t: TypeTag[A]) {
    val tag = t
}

class MultipleValuesDao extends MyDao {
    var idToValues: Map[String, TypedSeq[_]] = Map()

    override def get[A:TypeTag:ClassTag](id: String): A = {
        val seq = idToValues(id)
        if (seq.tag.tpe =:= typeOf[A]) seq.seq.head.asInstanceOf[A]
        else throw new Exception("wrong type")
    }
}

It would have been more elegant if we could use only one of the "Tag" classes.

--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Peter Empen | 26 Dec 11:22 2015
Picon

Distinguishing case class members

Currently all parameters of the first parameter list go into the generated equals/hashCode/copy/unapply methods.
This works well for most cases but sometimes we need to exclude some parameters from equals/hashCode while keeping them copy and matchable.

Now, to relieve programmers from the burden of defining custom equals/hashCode in such situations, it would be great to have some direct means to advise the compiler which parameters should not go into equals/hashCode.

One approach could be to provide a specific member-level annotation for this purpose.
Another approach could be to let val-/non-implicit-members of any secondary parameter list become a parameter of copy automatically.
Maybe you have even a better approach.

What do you think about this proposal?

--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gmane