|
Re: assorted beginner questions: msg#00454lang.scala
Hi Yang. I'll try to answer what I can... On 1/27/07, Yang <6gcgy2n02@xxxxxxxxxxxxxx> wrote: i've accumulated a list of questions over the past few days of usin scala> val aSet = Set("a", "b", "c", "a") aSet: scala.collection.immutable.Set[java.lang.String] = Set(a, b, c) scala> aSet.mkString("[", "|", "]") line33: java.lang.String = [a|b|c] for the following code: all((for (val b <- List(true,false)) yield !b).elements) //this works This for comprehension yields a List[Boolean] because that is the declared return type of the List.map method: def map [b] (f: (a) => b) : scala.List[ b] are there any form of nested comments in scala? I think so: object X { /* outer /* inner */ */ } Compiles normally (as opposed to similar construct in a .java source). is there any special syntax for hashtable/map/set gets/updates? No language syntax, but there is simple and terse library support: http://www.scala-lang.org/downloads/library.html what's the keyword to look for for info about varargs? what is this They are called repeated parameters, butI don't know about overloading, sorry. i read on the list archives that there are efforts to revamp the Good question :-) what's the 'intended' way to use forall? I believe I didn't understand the question, but see if this trivial use of forall can help: def allEven(ls:List[int]) = ls forall {i => i%2==0} thanks for any answers! Sorry I couldn't help with many of the questions. Cheers. -- Rafael de F. Ferreira. http://www.rafaelferreira.net/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Trouble with intersection types: 00454, martin odersky |
|---|---|
| Next by Date: | Re: The public interface of a program unit in Scala: 00454, martin odersky |
| Previous by Thread: | Re: assorted beginner questionsi: 00454, sean mcdirmid |
| Next by Thread: | Re: assorted beginner questions: 00454, martin odersky |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |