scala-2.8 Questions

3

Solved

Suppose one wants to build a novel generic class, Novel[A]. This class will contain lots of useful methods--perhaps it is a type of collection--and therefore you want to subclass it. But you want t...

3

I know that to be Traversable, you need only have a foreach method. Iterable requires an iterator method. Both the Scala 2.8 collections SID and the "Fighting Bitrot with Types" paper are basicall...
Deka asked 8/4, 2010 at 18:16

6

Solved

Quite a few functions on Map take a function on a key-value tuple as the argument. E.g. def foreach(f: ((A, B)) ⇒ Unit): Unit. So I looked for a short way to write an argument to foreach: > val...
Movable asked 2/6, 2010 at 11:35

1

Solved

I am defining a stream in terms of itself (a recursive definition). When trying to access the second element of the stream, StackOverflowError is thrown. The code from scala console: scala> val...
Ratha asked 2/6, 2010 at 18:47

2

Solved

Could anyone help me telling me how to use scala's ObservableSet trait? Thank you very much in advance
Sky asked 31/5, 2010 at 15:53

1

Solved

Is there a design document for Scala 2.8 Actors, like it is for 2.7? Scala Actors: Unifying Thread-based and Event-based Programming Is there one for Akka? The "Scala Improvement Documents Libra...
Garble asked 28/5, 2010 at 11:56

1

Solved

I'm trying to find a cleaner alternative (that is idiomatic to Scala) to the kind of thing you see with data-binding in WPF/silverlight data-binding - that is, implementing INotifyPropertyChanged. ...
Invaluable asked 26/5, 2010 at 19:21

2

Solved

Does anybody have good examples of using scala.util.control.Exception version 2.12.0 (version 2.8.0), ? I am struggling to figure it out from the types.
Concernment asked 25/5, 2010 at 9:37

1

Solved

Language FAQ says import scala.collection.mutable.{_, Map => _, Set => _} should import all classes from package scala.collection.mutable, except Map and Set. But it gives me this error: ...
Adler asked 20/5, 2010 at 7:41

2

Solved

in Scala, if I want to implement a DSL, is there a way to do the following: I have an Object called "Draw" which contains the function def draw(d:Drawable) how can I make it so that I can import ...
Encephaloma asked 19/5, 2010 at 18:40

3

Solved

I'm trying to implement an JavaEE Session Bean with Scala 2.8. Because it's a Remote Session Bean, i have to annotate it with the following Java Annotation: @Target({ElementType.TYPE}) @Retention(...
Imamate asked 16/5, 2010 at 0:17

1

Solved

There are plenty of examples of actors replying with another message back to the sender, but whilst browsing the API docs I noticed the !! and !? operators which are part of the CanReply trait (whi...
Wrangle asked 14/5, 2010 at 19:33

3

Solved

In Scala 2.7, I could write: package com.acme.bar class Bar . package com.acme.foo class Foo { new bar.Bar } This doesn't compile in Scala 2.8 -- however this does: package com.acme pac...
Godden asked 13/5, 2010 at 20:55

1

Solved

Having the following class which is in a CPS-context (@cps[Unit]) how would I implement the Seq-trait? Do I have to leave the standard traits like Seq aside and just implement map, flatmap and fore...
Mercantile asked 19/4, 2010 at 13:27

2

Solved

Currently my whole work cycle is: edit foo.scala fsc foo.scala && scala -cp . FooMain But my project is getting bigger and I would like to split files, make unit tests, etc. But I'm too...
Experimentation asked 11/5, 2010 at 1:3

2

I just found out that there are such iterators in Java. Does Scala have iterators with 'set' and 'remove' methods for iterating (and modifying) mutable collections like array? If there is no such i...
Schooner asked 10/5, 2010 at 13:52

1

Solved

In C++ I would just take a pointer (or reference) to arr[idx]. In Scala I find myself creating this class to emulate a pointer semantic. class SetTo (val arr : Array[Double], val idx : Int) { def...
Despond asked 9/5, 2010 at 20:51

2

Solved

What is the difference between package and object?
Indigoid asked 9/5, 2010 at 0:24

2

Solved

I seem to remember Scala treating methods ending in _= specially, so something like this: object X { var x: Int = 0; def y_=(n : Int) { x = n }} X.y = 1 should call X.y_=(1). However, in 2.8.0 ...
Humbuggery asked 4/5, 2010 at 13:4

1

Solved

I'm studying the source code of the Scala 2.8 collection classes. I have questions about the hierarchy of scala.collection.Traversable. Look at the following declarations: package scala.collection...
Leathern asked 28/4, 2010 at 23:22

3

Solved

Why does this code fail to compile, but compiles successfully when I uncomment the indicated line? (I'm using Scala 2.8 nightly). It seems that explicitly calling string2Wrapper allows it to be use...
Refusal asked 28/4, 2010 at 16:7

1

Solved

Or does it just clutter up the code for something the JIT would take care of automatically anyway?
Justus asked 25/4, 2010 at 17:11

1

Solved

How does scala.collection.JavaConversions supercede the answers given in Stack Overflow question Iterating over Java collections in Scala (it doesn't work because the "jcl" package is gone) and in ...
Vinylidene asked 25/4, 2010 at 16:46

2

Solved

simple REPL test... def g(a:Int)(implicit b:Int) = {a+b} Why do neither of these attempted usages work? 1. scala> class A { var b:Int =8; var c = g(2) } :6: error: could not find implicit va...
Brendabrendan asked 25/4, 2010 at 15:7

1

Solved

And I mean that in the same sense that a C/Java for is just a funky syntax for a while loop. I still remember when first learning about the for loop in C, the mental effort that had to go into und...

© 2022 - 2024 — McMap. All rights reserved.