Scala Programming Language

Rémy Mouëza ray.jay.ay.moueza at DoNtSpAm.gmail.com
Wed Jun 28 12:51:51 PDT 2006


In article <e7sp9q$p1n$1 at digitaldaemon.com>, sailormoontw says...
>
>
>Scala :
>http://scala.epfl.ch/index.html
>
>At the first stance the language is cool. Though I don't like the
>Javascript-like syntax, and running in JVM makes it slow, and it's slower than
>Java because it has another layer over JVM.
>
>However, in the development of D, I still think some features can be
>referenced...
>
>By the way, the regular expression page of D
>http://www.digitalmars.com/d/regular-expression.html
>In the beginning it introduces the class RegExp, but in the following article,
>the programs are written without the class RegExp, just the functions from
>std.regexp take strings as input, why??

The std.regexp functions instanciate a RegExp object, passing the argument
string to the constructor, then compile the regexp object to a more efficient
internal form and then call the corresponding method and finally return the
result. That helps the D programmer to write more concise code.

Like this :
# RegExp aFunction ( char [] aString )
# {
#      auto regexp = new RegExp ( aString ); 
#      regexp.compile ();
#      return regexp.aMethod ();
# }








More information about the Digitalmars-d mailing list