Search Discussions
-
is there a reason for these two codewords? as far as i understand, extends could cover both cases -- You received this message because you are subscribed to the Google Groups "scala-user" group. To ...
Dennis Haupt
Mar 13, 2015 at 10:01 am
Mar 19, 2015 at 4:01 pm -
scala :paste // Entering paste mode (ctrl-D to finish) trait Context object Helper { def stuff(implicit c: Context) = 3 def stuff_=(i: Int)(implicit c: Context) = () // woot type C[_] = Context def ...
Raul Bache
Mar 30, 2015 at 5:48 pm
Apr 2, 2015 at 9:38 am -
Hi, I'm stumbling into the wonderful world of full unicode, code points and supplementary characters. Who knew! So I was wondering if anybody has written a scala abstraction of full unicode strings, ...
Matthew Pocock
Mar 10, 2015 at 10:42 am
Mar 10, 2015 at 6:52 pm -
I am working on a Scala to GPU compiler called rootbeerfloat (see github). I am wondering if there is interest in this or, am I wasting my time? Also, what things would you like to see as part of ...
Hadil Sabbagh
Mar 2, 2015 at 10:51 pm
Mar 3, 2015 at 10:52 pm -
In C++ you may define enums as : enum color { red, yellow, green=20, blue }; where you can bind a specific value to an enmum. 1. How can one bind a specific value to and enum in Scala? 2. How can one ...
Rennoisamuel
Mar 24, 2015 at 1:13 pm
Mar 25, 2015 at 10:40 pm -
class TX { buyerId: int tax: BigDecimal taxTo: int fee: BigDecimal feeTo: int } class Totals { taxTotal: BigDecimal feeTotal: BigDecimal } List[TX] is as follows: BuyerId tax taxTo fee feeTo 14 ...
Rennoisamuel
Mar 23, 2015 at 1:42 pm
Mar 23, 2015 at 6:17 pm -
I am extending a mutable map, and this is what I have so far (from a worksheet): import java.lang._ import scala.collection.MapLike import scala.collection.mutable._ class MyMap extends ...
Eric Fowler
Mar 13, 2015 at 4:58 am
Mar 16, 2015 at 1:45 am -
Hi, I have a common pattern recurring regarding using asynchronous api: I have modular code composed of many small functions. One function deep down then needs to become a future, as it comes to rely ...
Matan Safriel
Mar 11, 2015 at 1:48 pm
Mar 13, 2015 at 3:52 pm -
Hello everyone. Please tell me, how do I make this code compile? scala :pa // Entering paste mode (ctrl-D to finish) trait T { def f1: Seq[this.type]; def f2(x: Seq[this.type]): Seq[this.type] = f1 ...
Serge
Mar 28, 2015 at 2:57 pm
Mar 28, 2015 at 7:08 pm -
I'm hoping it would be possible to get a compiler-error if trying to widen a protected method in a trait to public trait A { protected def crank: String } class C extends A { def crank: String = ...
Andreas Joseph Krogh
Mar 6, 2015 at 11:59 am
Mar 6, 2015 at 2:49 pm -
Provided that you have two Maps .. what is the most efficient way to merge two Maps and sum/aggregate only one the members in a class which represents the actual value? class Position( val long ...
Rennoisamuel
Mar 25, 2015 at 5:16 pm
Mar 27, 2015 at 2:02 am -
Hi, I notice that the compiler often lets you provide non-Future types for cases in a match for a Future. Obviously, case matching a future with some non-future type will never match... What is the ...
Matan Safriel
Mar 13, 2015 at 1:15 am
Mar 13, 2015 at 8:00 pm -
Hello, I want to convert an Iterator[String] to a java.io.InputStream but I didn't find an east way to do it. The main challenge is I cannot store all the data in memory to say, creating the ...
Ayoub Benali
Mar 13, 2015 at 9:58 am
Mar 18, 2015 at 4:48 pm -
Dear All, I am struggling to get the sbt console to use more memory. My system (a Dell desktop, core i7 with 4 cores(8 virtual cores)) has 16GB installed. If I run export JAVA_OPTS="-Xms6g -Xmx12g" ...
Siddhartha Gadgil
Mar 11, 2015 at 10:09 am
Mar 12, 2015 at 6:45 am -
Hi, I have already asked this question in StackOverflow <http://stackoverflow.com/questions/28675303/accessing-method-parameter-names-in-scala-using-java-reflection , but didn't get any response. So, ...
Yadukrishnan K
Mar 4, 2015 at 12:33 pm
Mar 6, 2015 at 4:51 am -
I am looking for a text that provides a good systematic coverage of the Scala language similar to what David Flanagan has done with the various editions of "Java in a Nutshell" (I have long been a ...
Careysub
Mar 30, 2015 at 12:45 am
Apr 2, 2015 at 10:28 pm -
Greetings, Id like to do something like the following but I cant figure out the right syntax. Any help here? private var _caches: Map[Class[T], Map[K, T <: Model[K]]] = null The basic idea is that I ...
Kraythe
Mar 27, 2015 at 10:11 pm
Mar 28, 2015 at 9:28 am -
If one chooses to use a multi member class as a key for a Map, what are the necessary overrides to make it work effectively in a Map? I would think at least 2? What else? 1. equals() 2. hashCode() Is ...
Rennoisamuel
Mar 26, 2015 at 12:57 pm
Mar 27, 2015 at 8:35 pm -
Hello, Suppose I have packaged my app as MyApp.jar, with main class a.b.c.MyApp and it also needs dependencies lib/dep1.jar and lib/dep2.jar. How can I run this on the command line? Can't find ...
Oliver Ruebenacker
Mar 25, 2015 at 12:15 pm
Mar 25, 2015 at 11:06 pm -
I'm trying to find a good way to update the value of a "builder" instance based on the value of an option. Probably easiest to explain with an example: def getConf(aOpt: Option[A]): MyConf = { val ...
Imran Rashid
Mar 18, 2015 at 2:16 pm
Mar 23, 2015 at 4:51 pm -
Consider the following: class Base { def foo(uris: Set[URI]) = {} } class Derived extends Base { def foo(uris: Set[URI]) = {} def foo(filter: URI = Boolean) = {} } class OverloadTest { def bar(uris ...
Andrea
Mar 19, 2015 at 10:11 am
Mar 20, 2015 at 9:08 am -
Hi, I have caused a NonLocalReturnControl runtime error by explicitly, superfluously, and unintentionally returning a value within this function private def foo(data: DataObject): Future[ReadyData] = ...
Matan Safriel
Mar 14, 2015 at 7:43 pm
Mar 14, 2015 at 10:36 pm -
Just learned that. It is Future. Thanks, -Vlad -- You received this message because you are subscribed to the Google Groups "scala-user" group. To unsubscribe from this group and stop receiving ...
Vlad Patryshev
Mar 27, 2015 at 8:26 pm
Mar 28, 2015 at 4:29 am -
I ran across an odd result the other day. Why are these expressions not evaluated with the same result?: scala (if (true) { Nil } else { 1 :: Nil }) ::: (2 :: Nil) res0: List[Int] = List(2) scala if ...
Austen Holmes
Mar 24, 2015 at 2:30 pm
Mar 24, 2015 at 3:04 pm -
Hello All - Question on cleanest way to accomplish something. If firstThing comes back as true, then I want to ignore any exceptions that might be thrown by secondThingFuture (or thirdThingFuture) ...
Mike Lenner
Mar 20, 2015 at 8:34 pm
Mar 23, 2015 at 3:12 pm -
Hello, I'm more a server-oriented guy and now feel like I should build up some skills with making Web GUIs with HTML and JavaScript. The idea is to combine learning HTML and JavaScript with what is ...
Haddock
Mar 15, 2015 at 10:53 am
Mar 17, 2015 at 11:53 am -
Say, I have a trait with a bunch of attributes, like trait User { def ssn: SSN def name: String // or, better, Name def dob: Date // etc } and I have a data source that returns these things, say, ...
Vlad Patryshev
Mar 16, 2015 at 4:04 pm
Mar 16, 2015 at 10:50 pm -
Hello, I'm trying to dynamically instantiate case classes from their reflected constructors. For a simple case class with "normal" members this works easily. But if my case class has a member that is ...
Greg Zoller
Mar 11, 2015 at 4:52 am
Mar 11, 2015 at 5:08 pm -
Hi, I have a stream like interface: source.read(...) it returns true if it has more data. Currently, I am doing while(source.read(...)) { // append the data to a list } I wonder if I can do something ...
Xi Shen
Mar 5, 2015 at 10:24 am
Mar 6, 2015 at 6:58 am -
This is one is correct: scala println(showCode(q"""val ${TermName("someVal")}: String = "lala"""")) val someVal: String = "lala" so is this one: scala println(showCode(q"""val ${TermName("some weird ...
Rodrigo Cano
Mar 23, 2015 at 5:37 pm
Mar 25, 2015 at 3:10 pm -
I notice that in many pieces of scala code that I've scene the word "That" was used to name things. What is the motivation behind this? -- You received this message because you are subscribed to the ...
John Creighton
Mar 19, 2015 at 9:12 pm
Mar 19, 2015 at 10:19 pm -
Hi all, In short, my question is, can you think of a better way of writing the future combination below? (in the userProfile function): case class User(name: String, homepageUrl: Option[String]) case ...
George Petrov
Mar 18, 2015 at 4:53 pm
Mar 19, 2015 at 9:12 pm -
Hi all, Just going through some exercises to get better acquainted with Scala. I'd like to read a character from Stdin in the console without blocking program execution - I can't seem to see anything ...
Ben Collier
Mar 16, 2015 at 4:07 pm
Mar 17, 2015 at 4:47 pm -
Wondering why this is happening: Welcome to Scala version 2.11.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_27) scala 1 == "1" <console :8: warning: comparing values of types Int and String using ...
Steven Heidel
Mar 13, 2015 at 7:28 pm
Mar 13, 2015 at 9:17 pm -
There is scala.collection.mutable.Multimap but not scala.collection.immutable.MultiMap. Is there a reason why this was left out or any design reason why I shouldn't write my own? Thanks! -- You ...
Stuart Small
Mar 12, 2015 at 1:48 pm
Mar 12, 2015 at 5:58 pm -
From what I understand, flatMap corresponds to the operation in a monad that somewhere else is called bind. To put it the Wikipedia way: the *bind* operation chains a monadic value of type *M a* with ...
Andrea
Mar 11, 2015 at 10:01 am
Mar 11, 2015 at 2:22 pm -
How can one pass a list of BigDecimal to an Actor to process efficiently? I ask this because Actors should only be sent short messages. What if you have a List of 1 million BigDecimal? How is this ...
Rennoisamuel
Mar 9, 2015 at 11:58 pm
Mar 10, 2015 at 12:58 pm -
val str = "A5:B6+---5:8+-----A:C++++G7" val pattern ="""([a-zA-Z]+)([0-9]+)(\:)([a-zA-Z]+)([0-9]+)|([a-zA-Z]+)([0-9]+)|([a-zA-Z]+)(\:)([a-zA-Z]+)|([0-9]+)(\:)([0-9]+)""".r val reformatted = pattern ...
Jiakui Wang
Mar 5, 2015 at 10:39 pm
Mar 6, 2015 at 12:50 am -
https://github.com/fwbrasil/bond I’ve just pushed to maven central the first release of Bond. It is a library to express validation constraints using the type system. Some usage examples: import ...
Flavio W. Brasil
Mar 2, 2015 at 1:14 pm
Mar 5, 2015 at 12:17 am -
Hello, I think I just found a weird bug in 2.11 The code below fails to compile Error:(28, 34) type mismatch; found : Object required: Option[com.babelcentral.analytics.etl.dim.Property] ...
Peter Wolf
Mar 3, 2015 at 2:32 am
Mar 3, 2015 at 12:26 pm -
Teaching a Scala class, and we were analyzing this kind of code. def summation(x:Int, y: Int = Int) = y(x) var incrementer = 3 def closure = (x: Int) = x + incrementer println(summation(11, closure)) ...
Daniel Hinojosa
Mar 3, 2015 at 4:42 am
Mar 3, 2015 at 6:04 am -
I was looking at the FoldLeft and FoldRight methods and the operator version of the method was extremely peculiar which was something like this (0 /: List.range(1,10))(_+_). For right associative ...
Charles vinodh
Mar 31, 2015 at 10:58 pm
Apr 2, 2015 at 5:29 pm -
Hi all! New to scala-user. Will probably be seeing me around a lot in the future. So I've been running into the following problem with using futures and mapTo. With an implicit conversion in scope, ...
Qqqqq
Mar 30, 2015 at 12:46 am
Mar 30, 2015 at 12:26 pm -
Hi, Say I have a tuple and a function F. val t =(1,2,3) val F(x:Int): Double = ... I want to build a new tuple like this val new_t = (t._1, t._2, t._3, F(t._3)) I wonder if there's a magic like ...
Xi Shen
Mar 29, 2015 at 11:58 am
Mar 30, 2015 at 8:37 am -
Scalatags is a library for generating HTML fragments in high-performance, type-checked Scala. The main feature of Scalatags 0.5.1 <https://github.com/lihaoyi/scalatags#scalatags-050 is it's CSS ...
Haoyi Li
Mar 29, 2015 at 1:26 am
Mar 29, 2015 at 7:55 pm -
Documentation for all subpackages of scala.reflect starting from 2.11.0 is absent from http://www.scala-lang.org/api/current/index.html#scala.reflect.api.Types. Has it been moved elsewhere or removed ...
Alexey Romanov
Mar 28, 2015 at 5:12 pm
Mar 29, 2015 at 5:39 am -
scala val b = List(4, 5, 6) b: List[Int] = List(4, 5, 6) scala val c = List("r", "q", "c") c: List[String] = List(r, q, c) scala val q = b.zip(c) q: List[(Int, String)] = List((4,r), (5,q), (6,c)) ...
Jiakui Wang
Mar 28, 2015 at 11:56 pm
Mar 29, 2015 at 2:40 am -
Hi, I define a Replyable that captures the type of the reply: trait Replyable[R] It can be used like this: trait MyResult object MyCommand extends Replyable[MyResult] Now I would like to define a ...
Yann Simon
Mar 15, 2015 at 8:22 am
Mar 22, 2015 at 8:44 pm -
I'm trying to compile a class. scalac D:\temp\main.scala works well. scalac "D:\temp\scala test\hello world\main.scala" give me an error: test\hello unexpected was unexpected at this time scalac ...
Alessandro Piccione
Mar 19, 2015 at 9:12 pm
Mar 19, 2015 at 10:27 pm -
Assuming I have the following: trait Foo { case class Bar(val code: Int) } class X extends Foo class Y extends Foo I cant access Bar directly like Foo#Bar but rate have to declare a concrete type X ...
Kraythe
Mar 17, 2015 at 9:01 pm
Mar 19, 2015 at 6:03 am
Group Overview
group | scala-user |
categories | scala |
discussions | 93 |
posts | 404 |
users | 122 |
website | scala-lang.org |
irc | #scala |
122 users for March 2015
Archives
- June 2016 (88)
- May 2016 (164)
- April 2016 (268)
- March 2016 (197)
- February 2016 (159)
- January 2016 (260)
- December 2015 (273)
- November 2015 (202)
- October 2015 (309)
- September 2015 (302)
- August 2015 (305)
- July 2015 (229)
- June 2015 (380)
- May 2015 (392)
- April 2015 (442)
- March 2015 (404)
- February 2015 (346)
- January 2015 (502)
- December 2014 (374)
- November 2014 (424)
- October 2014 (348)
- September 2014 (387)
- August 2014 (399)
- July 2014 (483)
- June 2014 (49)
- May 2014 (304)
- April 2014 (562)
- March 2014 (564)
- February 2014 (1,052)
- January 2014 (971)
- December 2013 (531)
- November 2013 (487)
- October 2013 (550)
- September 2013 (448)
- August 2013 (414)
- July 2013 (573)
- June 2013 (633)
- May 2013 (783)
- April 2013 (773)
- March 2013 (846)
- February 2013 (1,006)
- January 2013 (774)
- December 2012 (692)
- November 2012 (910)
- October 2012 (853)
- September 2012 (1,161)
- August 2012 (736)
- July 2012 (684)
- June 2012 (354)