Scala Mailing Lists | 21 Sep 15:32 2014
Picon
Picon

Mailing list reminder: Scala-language

Welcome to the "Scala-language" mailing list.

This automatic reminder is sent once a month to the list,
to keep subscribers up-to-date with the mailing list services,
and to help keeping the list on topic.

-------------------------------------------------------------------

The "Scala-language" mailing list:

This list is the main forum for discussions and news about the
Scala language. Questions about programming in Scala, especially
by beginners, should preferably go to the "scala-user" list
instead: please post there if you would like to discuss your
code snippets or need assistance. Questions about Scala tools
should go to "scala-tools".

Questions about the Scala IDE for Eclipse should go to 
http://groups.google.com/group/scala-ide-user.

Threads that become too long, and are unlikely to be of general
interest, should eventually be moved to "scala-debate".

-------------------------------------------------------------------

Other information:

There are several Scala lists devoted to individual topics (and
more may be created in the future). For the full list, please
see: http://www.scala-lang.org/node/199
(Continue reading)

"IonuČ› G. Stan" | 8 Sep 10:38 2014
Picon

Why does Scala allow type casts outside a type hierarchy?

Hi all,

A friend of mine just discovered that the following cast typechecks:

scala> val s: String = null
s: String = null

scala> s.asInstanceOf[Int]
res2: Int = 0

After a few Google searches, I found this: 
https://github.com/scala/scala-dist/pull/104/files, but it doesn't offer 
an explanation about the type checking aspect and it's not clear whether 
that rule should apply to *all* null values.

My question is, why does the Scala compiler even allow a call to the 
asInstanceOf method in this case where the String and Int types are not 
part of the same type hierarchy. This kind of cast is called a "stupid 
cast" in TaPL.

Also, why does it even allow this:

null.asInstanceOf[Int]

knowing that we can't do this:

val x: Int = null

I know asInstanceOf is bad and such, but still... rendering it even less 
typesafe than Java's cast mechanism is not really progress.
(Continue reading)

wwagner4 | 1 Sep 12:36 2014
Picon

scala-swing 2.11 final builds missing in maven repository

I am missing the final builds for scala-swing 2.11 in the maven central repository. Therefore I cannot switch to 2.11 for the my whole project. :-(

See: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.scala-lang%22%20AND%20a%3A%22scala-swing%22

--
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.
Ivan Romanyuk | 31 Aug 13:17 2014
Picon

Is there any example of using google-maps API written on scala?

I've found this one http://java.dzone.com/articles/location-based-application Is there any other projects?

--
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.
leithaus | 21 Aug 20:46 2014
Picon

jline for scala-2.11.0?

Dear Scalarazzi and Scalawags,


i notice that mvnrepository indicates that the version available for jline is one of scala-2.11.0-Mx for ( 1 <= x <= 3 ). However the maven scala plugin is expecting artifact org.scala-lang:jline:jar:2.11.0. Thus, invoking mvn scala:console results in the complaint.

[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.1.5:console (default-cli) on project agentservices-store-ia: wrap: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Could not find artifact org.scala-lang:jline:jar:2.11.0 in scala-tools.org (https://oss.sonatype.org/content/groups/scala-tools/)

Would it be possible to deploy jline for scala-2.11.0?

Love to all,

--greg

--
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.
Scala Mailing Lists | 21 Aug 15:32 2014
Picon
Picon

Mailing list reminder: Scala-language

Welcome to the "Scala-language" mailing list.

This automatic reminder is sent once a month to the list,
to keep subscribers up-to-date with the mailing list services,
and to help keeping the list on topic.

-------------------------------------------------------------------

The "Scala-language" mailing list:

This list is the main forum for discussions and news about the
Scala language. Questions about programming in Scala, especially
by beginners, should preferably go to the "scala-user" list
instead: please post there if you would like to discuss your
code snippets or need assistance. Questions about Scala tools
should go to "scala-tools".

Questions about the Scala IDE for Eclipse should go to 
http://groups.google.com/group/scala-ide-user.

Threads that become too long, and are unlikely to be of general
interest, should eventually be moved to "scala-debate".

-------------------------------------------------------------------

Other information:

There are several Scala lists devoted to individual topics (and
more may be created in the future). For the full list, please
see: http://www.scala-lang.org/node/199

Try to avoid cross-posting whenever possible. If you can, select
the list that is closer to your topic and post in that list only.
In any case, never cross-post replies.

If you ever want to unsubscribe from this list, just visit this
page: http://groups.google.com/group/scala-language/subscribe
or send an email to scala-language+unsubscribe <at> googlegroups.com

Thank you!
The Scala Team

--

-- 
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.

mar | 21 Aug 00:42 2014
Picon

Is a self type declared as `this: X =>` the exact same as `_: X =>` ?

From this answer on stack-overflow, it would seem it is. Assuming it is, should the `_: X =>` syntax perhaps be considered for deprecation as it then adds nothing but mud to the water?

--
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.
leithaus | 20 Aug 21:28 2014
Picon

scala continuations plugin

Dear Scalawags, Scalarazzi, and TypeSafe,

Who does Biosimilarity talk to about becoming the delimited continuations plugin maintainer?

Love to all,

--greg

P.S. Is there a step-by-step guide for getting this to work with scala 2.11?

--
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.
Alexander Myltsev | 15 Aug 07:45 2014

Compilation speed improvement

Hi all,

I am searching for Scala features that are dramatically slowing down compilation speed of my project. I'd like to know if I am using more traits and implicits I really need to. Any suggestions?

I wonder if Scala compiler plugin is possible to create (or even there is one in a wild) that measures compilation speed in, say, msecs of each phase and file?

A.

--
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.
Haoyi Li | 14 Aug 05:44 2014
Picon

Cached/lazy/interned macro materializers or implicits?

I'm working on a macro-based pickling library upickle, and one thing I do is that I do this whole implicit-resolution-to-find-picklers thing, e.g.
write[Int](...) -> write[Int](...)(intWriter) write[Seq[Int]](...) -> write[Int](...)(SeqWriter(intWriter)) write[MyCaseClass](...) -> write[Int](...)(Writer.macroWriter) -> write[Int](...)(...expanded code...)
Well, one thing I realized recently that in my benchmarks, the *act of instantiating the implicit* is sufficient to make a real impact on the performance of the pickling! For example, my benchmark basically tests:
sealed trait A case class B(i: Int) extends A case class C(s1: String, s2: String) extends A sealed trait LL case object End extends LL case class Node(c: Int, next: LL) extends LL case class ADT0() case class ADTc(i: Int = 2, s: String, t: (Double, Double) = (1, 2)) type Data = ADT[Seq[(Int, Int)], String, A, LL, ADTc, ADT0]
read[Data](...: String) write[Data](...: Data)
When I pre-instantiate the readers and writers outside my while-loop, my perf numbers (higher is better) are

[info]     jvm/read Success(306933)
[info]     jvm/write Success(330214)
[info]     js/read Success(34296)
[info]     js/write Success(25559)

On the other hand, if I leave the instantiation to the implicit resolution, and thus inside the while loop, the numbers are 

[info]     jvm/read Success(260349)
[info]     jvm/write Success(313252)
[info]     js/read Success(23268)
[info]     js/write Success(18099)

This is consistent over many runs, and all that stuff. It turns out that in Scala.js around 1/3 of my time is simply spent instantiating my (non-trivial) materializers! Even on the JVM, there is a noticeable 5-10% perf hit from doing this every time.

Now, every single one of these implicits and the macro-materializers are "pure"; they serve no other purpose other than to make the whole typeclass-pattern-thing work, and the exact same structure is going to be instantiated every single time this line of code is executed.

This leads up to my point: is there a way to mark an implicit as "cached", such that (similar to a lazy val) it gets stored somewhere after being calculated the first time (with a mutex or whatever), and there after it always returns the same instance of the thing rather than re-instantiating it each time? 

I imagine that for people using generic typeclasses (for non-generic ones you can just make the implicit a val), a large fraction of their implicits materialize "pure" objects with no internal state and which can be safely shared across any and all invocations of the callsite. That would save a significant amount of garbage being generated make a bunch of things run faster, similar to lifting non-closure-lambdas into static-lambdas. 

Thoughts?

--
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.
CM11 | 13 Aug 23:17 2014
Picon

pattern similar to implicit req action in Play! but without implicit keyword

Hi guys, I've a code which use an implicit parameter similar to how it works in play Actions...this works pretty fine but I dont like use the "implicit keyword" everytime, I wish something more transparent and simple for the final user, even using blocks instead lambdas

this is a simple example of what I can achieve

def hello(implicit a : String) = "hello "+a

def m1(b : => String) ={
      implicit var a = "tom"
      b
}

m1{
   hello
}


this doesnt works because hello can resolve the implicit parameter...is there any way how can achieve this method call and the implicit variable can be accessible in the block scope.??

thanks!!

--
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