Scala Language

The main forum for discussions and news about the Scala language.

Compiler plugin for detecting usage of Java classes

Hi,

I'm trying to write a compiler plugin, which should basically print the Java classes used in some Scala file.

E. g. when compiling

class A {
  val list = new java.util.ArrayList[Int]
  System.out.println(list)
}

the plugin should print something like:

Compiler ScalaDoc

Hey all,
There used to be links in scala-lang.org pointing to current and nightly compiler APIs. Now it seems these links are gone. Any chance to have them back in scala-lang.org or docs.scala-lang.org? I know I can generate the docs myself and I am doing it but having the these docs in the net is quite convenient.
Cheers

A Simple Scala Compiler Plugin, failed to create a new Class

This's a very simple plugin.

The original class is here:

@autoinject
trait X extends (() => Int) {
def name: String
val someValue: Int
def p = classOf[X]
def apply() = 5
}

And I wanna generate a class below:

private class XX @javax.inject.Inject()(val name: String, val
someValue: Int) extends X

Here's the code: https://github.com/iron9light/autoguice

It's nearly finished, except the generated constructor:

TREE: private class XImpl extends java.lang.Object with simple.X with
ScalaObject {
private[this] val name: String = _;
private[this] val someValue: Int = _;
private[this] def (name: String, someValue:
Int) = {
super.();
()
};

Nightly ScalaDoc

I was looking today at the nightly Scaladoc when I noticed it linked to the 2.9.2 branch. Could we please have it pointing to trunk again?

And, by the way, there were dozens of improvements to the Scaladoc tool *and* to Scala API docs on trunk. Can we have them backported *before* 2.9.2 is out? I volunteer to track down all commits if the answer is positive.

--
Daniel C. Sobral

I travel to the future all the time.

In case anyone's really been missing chained assignment

scala> class A[T](init: T) { private var _x = init ; def x = _x ; def x_=(y: T): T = { _x = y ; y } }defined class A
scala> new A("abc")res0: A[String] = A@7d740df7
scala> new A("def")res1: A[String] = A@2628de85
scala> res0.x = res1.x = "BIPPY"res0.x: String = BIPPY
scala> res0.xres2: String = BIPPY
scala> res1.xres3: String = BIPPY

uploading large files in Google Projects

Hi all,

starting from about 10 days ago,
I have problem in uploading large files (e.g. > 40Mb)
for my project scalalab.

It says that I'm over quota but I am not.

Does anyone know can happen or where I can ask for help?

Regards
Stergios

implicit parameter lookup precedence

Hi,
I have a question about the implicit parameter lookup precedence,specifically with regards to SLS and Josh's [Implicits without import tax][1] talk from earlier this year.
SLS page 106 states that there are two major categories for looking an implicit parameter of type T.Category 1: local scopeCategory 2: implicit scope (implicit members of the companion objects of the associated types)
We can ignore Category 2 for now.The local scope lookup is described as follows:

Text version of Scala Language Specification

In case I am not alone in having been driven all the way up the wall and over the nearby cliff in my attempts to cut and paste from the scala specification without devastating the meaning of the paste, I offer the attached plain text version of the scala spec.  It is not perfect, but it is a huge leap forward for me.
It is based on the nightly PDF of today, and is the product of the following successively applied transformations:
 - pdftohtml - htmltotext - me and my text processing friends manually cleaning up a bit until I lost the will to continue
Syndicate content

Copyright © 2013 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland