What does “outer =>” really mean?

Is there any documentation on the "outer =>" feature? It looks like a self type annotation with an infered type. However I have the feeling that I am wrong.

If it would be the case, is it only a different way to express access to super?

trait A extends (B => C) {
  outer =>
  def apply(x: B): C = outer(x)
}

Answers


Not super, but the outer scope. It's a way to aliasing different scopes. For example:

class A(val x:Int) { thisA =>
 class B { 
   val x = 2 
   val y = x + thisA.x // without thisA how could we use A.x instead of B.x ? (*)
 }
}

There is a better illustration here.

(*) There exist another way to have the same effect, but it's beyond this question.


Need Your Help

How do I select a maximum date from SQL Server 2005 XML Column?

xml sql-server-2005 xquery xquery-sql sqlxml

I am new to XML programming in SQL Server. This will probably be a simple question for you guys!

Method Not Implemented PhpMyAdmin

methods phpmyadmin

Getting this error when clicking the edit button for a record in phpmyadmin

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.