Cracl Pop | 1 Jan 02:03 2005
Picon

Scala Interpreter

Is the Scala Interpreter available programmatically?
I am trying to do a "jsp" kind of template translation 
and would like to use Scala as the embedded language.

Thanks.

Cracl Pop | 2 Jan 21:24 2005
Picon

Freshmeat out of date

"... Scala is listed on freshmeat where all new releases are announced...."

Freshmeat only has version 1.3.0.7 whereas it appears that 1.3.0.9 is the latest?

Cracl Pop | 2 Jan 23:53 2005
Picon

SelfTypes + Mixins vs. AOP

"...Generally, one can handle all before/after advice on method join-points in
this way...."

Would it be possoble to get some concrete examples of this? (I learn mostly by
looking at example code.)

Thanks

Philippe Altherr | 3 Jan 10:05 2005
Picon
Picon

Re: Default values

> There's obviously a big difference between text substitution (which is what C++
> more or less does) and type substitution (which Scala does).  Scalac _knows_ the
> types it is using to generate classes.  C++ just mushes things together and sees
> if the result makes sense.  At times, that can be convenient ;)

You can use mixins to do something similar to what C++ does with
templates. Indeed, in Scala, the code of mixed-in classes is simply
copied into the newly-defined class.

The example below defines the function "fact" only once and mixes it
in twice to obtain an "int" and a "double" version. The two
specialized versions really take and return
"int"s/"double"s. Unfortunately, their implementation really call the
methods declared in "Number" which is not very efficient. However, an
optimizer could rather easily inline all those method calls. We are
currently trying to add some code optimization phases to the Scala
compiler, so maybe you can soon use this technique and expect
efficient code.

Philippe

trait Numbers[T] {
  def zero: T;
  def one: T;
  def cst(i: Int): T;
  def add(x: T, y: T): T;
  def sub(x: T, y: T): T;
  def mul(x: T, y: T): T;
  def div(x: T, y: T): T;
  def eq(x: T, y: T): Boolean;
(Continue reading)

Michel Schinz | 5 Jan 13:26 2005
Picon
Picon

Re: Freshmeat out of date

Le 2 janv. 05, à 21:24, Cracl Pop a écrit :

> "... Scala is listed on freshmeat where all new releases are 
> announced...."
>
> Freshmeat only has version 1.3.0.7 whereas it appears that 1.3.0.9 is 
> the latest?

Yeah, the "all" is a bit misleading: there are a few very minor 
releases that are not announced there, 1.3.0.9 being one of them. I'll 
update the freshmeat page anyway, but this kind of situation will 
probably happen again in the future.

Thanks,
Michel.

Mike | 9 Jan 00:16 2005

Scala combinators

Hi all,

I've been very happily using the Scala combinators / for-comphrensions technique
for my undergraduate at compilers class (I'm a student at UC Riverside). It's
been extremely helpful and exciting for a simple guy like me to be introduced to
the functional programming world like this -

kudos to the team, and I'll be keeping up with page,
-Mike

Oost, Arco | 14 Jan 10:01 2005

.class equivalent in Scala


In Java I can use the suffix .class to use a class as a parameter to a method. In our applications we use this
both for our persistence layer and for setting up test suites in JUnit. 

I haven't been able to find an equivalent in Scala. A work-around of course, is to use
Class.forName("some.ClassName"), but this has the disadvantage that it isn't checked by the compiler.

Is there something equivalent in Scala, or do I have to resort to the work-around.

Groeten,
  Arco Oost

Michel Schinz | 14 Jan 10:15 2005
Picon
Picon

Re: .class equivalent in Scala

Le 14 janv. 05, à 10:01, Oost, Arco a écrit :

> In Java I can use the suffix .class to use a class as a parameter to a 
> method.

[...]

> Is there something equivalent in Scala, or do I have to resort to the 
> work-around.

Unfortunately, we don't have an equivalent notation in Scala right now, 
so you have to resort to the work-around you mention.

Michel.

Tobias Rademacher | 24 Jan 17:18 2005
Picon

dtd2scala limitations

Hi Folks,

I am new to scala. 

Can you give me a hint to get th dtd2 scala tool to use a given package like:

dtd2 -d generate-src bla.dtd blub bl.bla.blu

Unfortunaly the generated blub source file does not have any package declaration! Is is a limitation of the
dtd2scala tool.

Thx a lot
Toby

--

-- 
Visit my Weblog  <at>  http://www.jroller.com/page/tradem

Burak Emir | 25 Jan 09:19 2005
Picon
Picon

Re: dtd2scala limitations

Hello Toby-Wan,

it is indeed a limitation of dtd2scala. I will try to add that feature 
for the next release. The syntax you suggested seems perfect.

The "namespace" parameter denotes rather an XML namespace than a scala 
package.

However, the object name could be prefixed with a path, e.g. "dtd2scala 
-d dir bla.dtd. bl.bla.blu.blub" would generate a source file 
"blub.scala" which defines an object "blub" in package "bl.bla.blu". 
This file would be in subdirectory "./bl/bla/bu" of "dir".

I added this as feature request, you can find it and follow up on it in 
the bugtracking system #394.

Thanks!

cheers,
Burak

Tobias Rademacher wrote:

>Hi Folks,
>
>I am new to scala. 
>
>Can you give me a hint to get th dtd2 scala tool to use a given package like:
>
>dtd2 -d generate-src bla.dtd blub bl.bla.blu
(Continue reading)


Gmane