logo       

Re: assorted beginner questions: msg#00504

lang.scala

Subject: Re: assorted beginner questions

On 1/28/07, Rafael de F. Ferreira rafael-at-rafaelferreira.net |scala|
<...> wrote:
> 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).

editor support doesn't reflect this - another fyi item.

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

to explain my question better: i thought 'forall' was intended to be
used more like a quantifier in math, traditionally preceding the
elements being quantified, as in the following way to define a subset
S of T:

forall x in S, T contains x

or maybe it was meant to be used in a more english-like manner (or at
least python-like):

T contains x forall x in S

yang



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise