<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-30217</id>
	<title>Nabble - Scala - User</title>
	<updated>2009-11-08T21:06:56Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/Scala---User-f30217.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Scala---User-f30217.html" />
	<subtitle type="html"></subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26261375</id>
	<title>Re: Re: lazy filtering</title>
	<published>2009-11-08T21:06:56Z</published>
	<updated>2009-11-08T21:06:56Z</updated>
	<author>
		<name>Ishaaq Chandy</name>
	</author>
	<content type="html">Hmm, I&amp;#39;m not sure - unlike your bug description the predicate is not getting called more than once, its just surprising (to me) that it is eagerly called - iterating through the first few elements until it finds the first match, after which, any subsequent calls to Iterator.take(n) work as expected.&lt;br&gt;

&lt;br&gt;As I said, not really a bug for my use-case - though I could well imagine that there must be use-cases where you&amp;#39;d expect to not have to call an expensive predicate till the absolute last moment possible.&lt;br&gt;&lt;br&gt;
Ishaaq&lt;br&gt;
&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/11/9 Eric Willigers &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26261375&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ewilligers@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;

&lt;div class=&quot;im&quot;&gt;Ishaaq Chandy wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Cool, thanks David, yes that works - and is much simpler than some of the monstrosities I was trying out, though the method to get the Iterator from a List is &amp;quot;elements&amp;quot; not &amp;quot;iterator&amp;quot;.&lt;br&gt;
&lt;br&gt;
interestingly though, running the for comprension over the Iterator instead of the List  eagerly runs foo() on the first few foos to pre-fetch the first result before the call to take(n) - not really a problem for what I want to do but I found it a bit surprising.&lt;br&gt;


&lt;/blockquote&gt;
&lt;br&gt;&lt;/div&gt;
You might be seeing&lt;br&gt;
&lt;a href=&quot;http://lampsvn.epfl.ch/trac/scala/ticket/2552&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://lampsvn.epfl.ch/trac/scala/ticket/2552&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
The Iterator returned by Iterator.filter evaluates the predicate more times than it needs to: a call to next after hasNext need not call the predicate, but currently does, and repeated calls to hasNext need not call the predicate, but currently do.&lt;br&gt;


&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/lazy-filtering-tp26260766p26261375.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26261196</id>
	<title>Re: lazy filtering</title>
	<published>2009-11-08T20:35:03Z</published>
	<updated>2009-11-08T20:35:03Z</updated>
	<author>
		<name>Eric Willigers</name>
	</author>
	<content type="html">Ishaaq Chandy wrote:
&lt;br&gt;&amp;gt; Cool, thanks David, yes that works - and is much simpler than some of 
&lt;br&gt;&amp;gt; the monstrosities I was trying out, though the method to get the 
&lt;br&gt;&amp;gt; Iterator from a List is &amp;quot;elements&amp;quot; not &amp;quot;iterator&amp;quot;.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; interestingly though, running the for comprension over the Iterator 
&lt;br&gt;&amp;gt; instead of the List &amp;nbsp;eagerly runs foo() on the first few foos to 
&lt;br&gt;&amp;gt; pre-fetch the first result before the call to take(n) - not really a 
&lt;br&gt;&amp;gt; problem for what I want to do but I found it a bit surprising.
&lt;br&gt;&lt;br&gt;You might be seeing
&lt;br&gt;&lt;a href=&quot;http://lampsvn.epfl.ch/trac/scala/ticket/2552&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lampsvn.epfl.ch/trac/scala/ticket/2552&lt;/a&gt;&lt;br&gt;&lt;br&gt;The Iterator returned by Iterator.filter evaluates the predicate more 
&lt;br&gt;times than it needs to: a call to next after hasNext need not call the 
&lt;br&gt;predicate, but currently does, and repeated calls to hasNext need not 
&lt;br&gt;call the predicate, but currently do.
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/lazy-filtering-tp26260766p26261196.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26261020</id>
	<title>Re: lazy filtering</title>
	<published>2009-11-08T20:08:27Z</published>
	<updated>2009-11-08T20:08:27Z</updated>
	<author>
		<name>David Hall-17</name>
	</author>
	<content type="html">On Sun, Nov 8, 2009 at 8:01 PM, Ishaaq Chandy &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26261020&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ishaaq@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Cool, thanks David, yes that works - and is much simpler than some of the
&lt;br&gt;&amp;gt; monstrosities I was trying out, though the method to get the Iterator from a
&lt;br&gt;&amp;gt; List is &amp;quot;elements&amp;quot; not &amp;quot;iterator&amp;quot;.
&lt;br&gt;&lt;br&gt;It is right now. In 2.8 it becomes iterator, and I forgot to
&lt;br&gt;back-translate it. (elements will remain as deprecated)
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; interestingly though, running the for comprension over the Iterator instead
&lt;br&gt;&amp;gt; of the List  eagerly runs foo() on the first few foos to pre-fetch the first
&lt;br&gt;&amp;gt; result before the call to take(n) - not really a problem for what I want to
&lt;br&gt;&amp;gt; do but I found it a bit surprising.
&lt;br&gt;&lt;br&gt;Indeed.
&lt;br&gt;&lt;br&gt;-- David
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Ishaaq
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 2009/11/9 David Hall &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26261020&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dlwh@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; do the for comprehension on on foos.iterator, and then on the result
&lt;br&gt;&amp;gt;&amp;gt; take(n).toList
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; -- David
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/lazy-filtering-tp26260766p26261020.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26260972</id>
	<title>Re: lazy filtering</title>
	<published>2009-11-08T20:01:57Z</published>
	<updated>2009-11-08T20:01:57Z</updated>
	<author>
		<name>Ishaaq Chandy</name>
	</author>
	<content type="html">Cool, thanks David, yes that works - and is much simpler than some of the monstrosities I was trying out, though the method to get the Iterator from a List is &amp;quot;elements&amp;quot; not &amp;quot;iterator&amp;quot;.&lt;br&gt;&lt;br&gt;interestingly though, running the for comprension over the Iterator instead of the List  eagerly runs foo() on the first few foos to pre-fetch the first result before the call to take(n) - not really a problem for what I want to do but I found it a bit surprising.&lt;br&gt;

&lt;br&gt;Ishaaq&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/11/9 David Hall &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26260972&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dlwh@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;

&lt;div class=&quot;im&quot;&gt;&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;do the for comprehension on on foos.iterator, and then on the result&lt;br&gt;
take(n).toList&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
-- David&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/lazy-filtering-tp26260766p26260972.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26260809</id>
	<title>Re: lazy filtering</title>
	<published>2009-11-08T19:30:08Z</published>
	<updated>2009-11-08T19:30:08Z</updated>
	<author>
		<name>David Hall-17</name>
	</author>
	<content type="html">On Sun, Nov 8, 2009 at 7:23 PM, Ishaaq Chandy &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26260809&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ishaaq@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi guys,
&lt;br&gt;&amp;gt; I have a list of Foo instances. The Foo trait defines a single method call
&lt;br&gt;&amp;gt; bar() which returns either a Some(Baz) or None.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I need to find the first n instances that return a Some and collate those
&lt;br&gt;&amp;gt; Somes to return a List[Some[Baz]] of length &amp;lt;= n.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Here is my naive first cut at this (warning non-compiler-checked code
&lt;br&gt;&amp;gt; ahead):
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; val allResults: List[Some(Baz)] = (for
&lt;br&gt;&amp;gt; foo &amp;lt;- foos
&lt;br&gt;&amp;gt; result = foo.bar()
&lt;br&gt;&amp;gt; if(result != None)
&lt;br&gt;&amp;gt; ) yield result
&lt;br&gt;&amp;gt; val filteredResults = (allResults.length &amp;lt;= n) allResults else
&lt;br&gt;&amp;gt; allResults.dropRight(allResults.length - n)
&lt;/div&gt;&lt;br&gt;do the for comprehension on on foos.iterator, and then on the result
&lt;br&gt;take(n).toList
&lt;br&gt;&lt;br&gt;-- David
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; But this is ineficient as it evaluates bar() on every instance not just the
&lt;br&gt;&amp;gt; first n results - what I did not mention above is that bar() is an expensive
&lt;br&gt;&amp;gt; operation and I would like to avoid calling it if I can.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; My intuition tells me I should be able to formulate a construct with
&lt;br&gt;&amp;gt; takeWhile and a projection but my attempts at it can't get past calling
&lt;br&gt;&amp;gt; bar() twice - once for the check and a second time for the yield. I fear my
&lt;br&gt;&amp;gt; scala-foo is not up to scratch yet - hints/insights anyone?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I know how to solve the problem with imperative code - my object is to find
&lt;br&gt;&amp;gt; the functional equivalent.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Ishaaq
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/lazy-filtering-tp26260766p26260809.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26260766</id>
	<title>lazy filtering</title>
	<published>2009-11-08T19:23:54Z</published>
	<updated>2009-11-08T19:23:54Z</updated>
	<author>
		<name>Ishaaq Chandy</name>
	</author>
	<content type="html">Hi guys,&lt;br&gt;I have a list of Foo instances. The Foo trait defines a single method call bar() which returns either a Some(Baz) or None.&lt;br&gt;&lt;br&gt;I need to find the first n instances that return a Some and collate those Somes to return a List[Some[Baz]] of length &amp;lt;= n.&lt;br&gt;

&lt;br&gt;Here is my naive first cut at this (warning non-compiler-checked code ahead):&lt;br&gt;&lt;br&gt;val allResults: List[Some(Baz)] = (for&lt;br&gt;foo &amp;lt;- foos&lt;br&gt;result = foo.bar()&lt;br&gt;if(result != None)&lt;br&gt;) yield result&lt;br&gt;val filteredResults = (allResults.length &amp;lt;= n) allResults else allResults.dropRight(allResults.length - n)&lt;br&gt;

&lt;br&gt;But this is ineficient as it evaluates bar() on every instance not just the first n results - what I did not mention above is that bar() is an expensive operation and I would like to avoid calling it if I can.&lt;br&gt;&lt;br&gt;

My intuition tells me I should be able to formulate a construct with takeWhile and a projection but my attempts at it can&amp;#39;t get past calling bar() twice - once for the check and a second time for the yield. I fear my scala-foo is not up to scratch yet - hints/insights anyone?&lt;br&gt;

&lt;br&gt;I know how to solve the problem with imperative code - my object is to find the functional equivalent.&lt;br&gt;&lt;br&gt;Ishaaq&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/lazy-filtering-tp26260766p26260766.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26258078</id>
	<title>Cannot get FeatureSpec structure to show up in the output when combined with JUnitSuite</title>
	<published>2009-11-08T13:21:25Z</published>
	<updated>2009-11-08T13:21:25Z</updated>
	<author>
		<name>Kellie Spears</name>
	</author>
	<content type="html">Given the following code: 
&lt;br&gt;&lt;br&gt;port collection.mutable.Stack
&lt;br&gt;import org.junit.Test
&lt;br&gt;import org.scalatest.junit.JUnitSuite
&lt;br&gt;import org.scalatest.matchers.MustMatchers
&lt;br&gt;import org.scalatest.{GivenWhenThen, FeatureSpec}
&lt;br&gt;&lt;br&gt;class ExampleSpecTest extends FeatureSpec with JUnitSuite with 
&lt;br&gt;GivenWhenThen with MustMatchers
&lt;br&gt;{
&lt;br&gt;&lt;br&gt;&amp;nbsp;@Test
&lt;br&gt;&amp;nbsp; def featureSpecExample() {
&lt;br&gt;&amp;nbsp; &amp;nbsp; feature(&amp;quot;The user can pop an element off the top of the stack&amp;quot;) {
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; info(&amp;quot;As a programmer&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; info(&amp;quot;I want to be able to pop items off the stack&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; info(&amp;quot;So that I can get them in last-in-first-out order&amp;quot;)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; scenario(&amp;quot;pop is invoked on a non-empty stack&amp;quot;) {
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; given(&amp;quot;a non-empty stack&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; val stack = new Stack[Int]
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stack.push(1)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stack.push(2)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; val oldSize = stack.size
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; when(&amp;quot;when pop is invoked on the stack&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; val result = stack.pop()
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; then(&amp;quot;the most recently pushed element should be returned&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result must be === 2
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; and(&amp;quot;the stack should have one less item than before&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stack.size must be === oldSize - 1
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; scenario(&amp;quot;pop is invoked on an empty stack&amp;quot;) {
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; given(&amp;quot;an empty stack&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; val emptyStack = new Stack[String]
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; when(&amp;quot;when pop is invoked on the stack&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; then(&amp;quot;NoSuchElementException should be thrown&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; evaluating { emptyStack.pop() } must produce 
&lt;br&gt;[NoSuchElementException]
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; and(&amp;quot;the stack should still be empty&amp;quot;)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; emptyStack must be ('empty)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;when I run this version of ExampleSpecTest, I am getting the following 
&lt;br&gt;output:
&lt;br&gt;Run starting. Expected test count is: 1
&lt;br&gt;ExampleSpecTest:
&lt;br&gt;Test Starting - ExampleSpecTest: featureSpecExample
&lt;br&gt;Test Succeeded - ExampleSpecTest: featureSpecExample
&lt;br&gt;Run completed in 255 milliseconds.
&lt;br&gt;Total number of tests run: 1
&lt;br&gt;Suites: completed 1, aborted 0
&lt;br&gt;Tests: succeeded 1, failed 0, ignored 0, pending 0
&lt;br&gt;All tests passed.
&lt;br&gt;&lt;br&gt;I am not getting any of the expected given/when/then output in the report
&lt;br&gt;&lt;br&gt;Expected:
&lt;br&gt;&lt;br&gt;Run starting. Expected test count is: 1
&lt;br&gt;ExampleSpecTest:
&lt;br&gt;Test Starting - ExampleSpecTest: featureSpecExample
&lt;br&gt;Feature: The user can pop an element off the top of the stack 
&lt;br&gt;&amp;nbsp; As a programmer 
&lt;br&gt;&amp;nbsp; I want to be able to pop items off the stack 
&lt;br&gt;&amp;nbsp; So that I can get them in last-in-first-out order 
&lt;br&gt;&amp;nbsp; Scenario: pop is invoked on a non-empty stack
&lt;br&gt;&amp;nbsp; &amp;nbsp; Given a non-empty stack 
&lt;br&gt;&amp;nbsp; &amp;nbsp; When when pop is invoked on the stack 
&lt;br&gt;&amp;nbsp; &amp;nbsp; Then the most recently pushed element should be returned 
&lt;br&gt;&amp;nbsp; &amp;nbsp; And the stack should have one less item than before 
&lt;br&gt;&amp;nbsp; Scenario: pop is invoked on an empty stack
&lt;br&gt;&amp;nbsp; &amp;nbsp; Given an empty stack 
&lt;br&gt;&amp;nbsp; &amp;nbsp; When when pop is invoked on the stack 
&lt;br&gt;&amp;nbsp; &amp;nbsp; Then NoSuchElementException should be thrown 
&lt;br&gt;&amp;nbsp; &amp;nbsp; And the stack should still be empty
&lt;br&gt;Test Succeeded - ExampleSpecTest: featureSpecExample 
&lt;br&gt;Run completed in 96 milliseconds.
&lt;br&gt;Total number of tests run: 2
&lt;br&gt;Suites: completed 1, aborted 0
&lt;br&gt;Tests: succeeded 1, failed 0, ignored 0, pending 0
&lt;br&gt;All tests passed.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;This email and any files included with it may contain privileged,
&lt;br&gt;proprietary and/or confidential information that is for the sole use
&lt;br&gt;of the intended recipient(s). &amp;nbsp;Any disclosure, copying, distribution,
&lt;br&gt;posting, or use of the information contained in or attached to this
&lt;br&gt;email is prohibited unless permitted by the sender. &amp;nbsp;If you have
&lt;br&gt;received this email in error, please immediately notify the sender
&lt;br&gt;via return email, telephone, or fax and destroy this original transmission
&lt;br&gt;and its included files without reading or saving it in any manner.
&lt;br&gt;Thank you.
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Cannot-get-FeatureSpec-structure-to-show-up-in-the-output-when-combined-with-JUnitSuite-tp26258078p26258078.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26255933</id>
	<title>Re: Ranges.Double produces BigDecimal</title>
	<published>2009-11-08T09:37:02Z</published>
	<updated>2009-11-08T09:37:02Z</updated>
	<author>
		<name>janek</name>
	</author>
	<content type="html">Sorry, it is already fixed in latest nightly build.
&lt;br&gt;&lt;br&gt;On Sun, Nov 8, 2009 at 5:26 PM, Jan Kotek &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26255933&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;opencoeli@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I thing I found problem in 2.8 library. Double range does not return
&lt;br&gt;&amp;gt; doubles, but BigDecimals.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Problem is in object: scala.collection.immutable.Range.Double
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This is actual type definition produced by Scala decompiler:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  object Double extends java.lang.Object with scala.ScalaObject {
&lt;br&gt;&amp;gt;    def this() = { /* compiled code */ }
&lt;br&gt;&amp;gt;    def apply(start : scala.Double, end : scala.Double, step :
&lt;br&gt;&amp;gt; scala.Double) :
&lt;br&gt;&amp;gt; scala.collection.immutable.GenericRange.Exclusive[scala.BigDecimal] =
&lt;br&gt;&amp;gt; { /* compiled code */ }
&lt;br&gt;&amp;gt;    def inclusive(start : scala.Double, end : scala.Double, step :
&lt;br&gt;&amp;gt; scala.Double) :
&lt;br&gt;&amp;gt; scala.collection.immutable.GenericRange.Inclusive[scala.BigDecimal] =
&lt;br&gt;&amp;gt; { /* compiled code */ }
&lt;br&gt;&amp;gt;  }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; From source code, it seems that BigDecimals are used internally. At
&lt;br&gt;&amp;gt; output there is conversion, but it fails. So BigDecimal range is used
&lt;br&gt;&amp;gt; in result.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Jan
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Ranges.Double-produces-BigDecimal-tp26255817p26255933.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26255817</id>
	<title>Ranges.Double produces BigDecimal</title>
	<published>2009-11-08T09:26:58Z</published>
	<updated>2009-11-08T09:26:58Z</updated>
	<author>
		<name>janek</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;I thing I found problem in 2.8 library. Double range does not return
&lt;br&gt;doubles, but BigDecimals.
&lt;br&gt;&lt;br&gt;Problem is in object: scala.collection.immutable.Range.Double
&lt;br&gt;&lt;br&gt;This is actual type definition produced by Scala decompiler:
&lt;br&gt;&lt;br&gt;&amp;nbsp; object Double extends java.lang.Object with scala.ScalaObject {
&lt;br&gt;&amp;nbsp; &amp;nbsp; def this() = { /* compiled code */ }
&lt;br&gt;&amp;nbsp; &amp;nbsp; def apply(start : scala.Double, end : scala.Double, step :
&lt;br&gt;scala.Double) :
&lt;br&gt;scala.collection.immutable.GenericRange.Exclusive[scala.BigDecimal] =
&lt;br&gt;{ /* compiled code */ }
&lt;br&gt;&amp;nbsp; &amp;nbsp; def inclusive(start : scala.Double, end : scala.Double, step :
&lt;br&gt;scala.Double) :
&lt;br&gt;scala.collection.immutable.GenericRange.Inclusive[scala.BigDecimal] =
&lt;br&gt;{ /* compiled code */ }
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&lt;br&gt;From source code, it seems that BigDecimals are used internally. At
&lt;br&gt;output there is conversion, but it fails. So BigDecimal range is used
&lt;br&gt;in result.
&lt;br&gt;&lt;br&gt;Jan
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Ranges.Double-produces-BigDecimal-tp26255817p26255817.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26253955</id>
	<title>Re: trait X extends Y vs trait X {this: Y=&gt; }</title>
	<published>2009-11-08T05:51:16Z</published>
	<updated>2009-11-08T05:51:16Z</updated>
	<author>
		<name>Francois Armand-2</name>
	</author>
	<content type="html">Dimitris Andreou a écrit :
&lt;br&gt;&amp;gt; Hmm. Now I realize that both &amp;quot; this: A =&amp;gt;&amp;quot; and &amp;quot;self: A =&amp;gt;&amp;quot; are there.
&lt;br&gt;&amp;gt; Strange redundancy (assuming they are equivalent). Anyone knows why
&lt;br&gt;&amp;gt; this is so?
&lt;br&gt;&lt;br&gt;It's just a binding name. You can use whatever is meaningful for your 
&lt;br&gt;use case, and &amp;quot;self&amp;quot; or &amp;quot;this&amp;quot; are conventional name.
&lt;br&gt;&lt;br&gt;But you can rebind &amp;quot;this&amp;quot; to something else without the type annotation, 
&lt;br&gt;for example to make reference to that &amp;quot;this&amp;quot; in inner classes.
&lt;br&gt;&lt;br&gt;Ex:
&lt;br&gt;class Outer(name:String) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;outer =&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;class Inner {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;def whoOwnsMe() {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;println( outer.name )
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Francois Armand
&lt;br&gt;&lt;a href=&quot;http://fanf42.blogspot.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://fanf42.blogspot.com&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26253955.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26253730</id>
	<title>Re: trait X extends Y vs trait X {this: Y=&gt; }</title>
	<published>2009-11-08T05:21:30Z</published>
	<updated>2009-11-08T05:21:30Z</updated>
	<author>
		<name>Dimitris Andreou</name>
	</author>
	<content type="html">Hmm. Now I realize that both &amp;quot; this: A =&amp;gt;&amp;quot; and &amp;quot;self: A =&amp;gt;&amp;quot; are there.
&lt;br&gt;Strange redundancy (assuming they are equivalent). Anyone knows why
&lt;br&gt;this is so?
&lt;br&gt;&lt;br&gt;2009/11/7 Daniel Sobral &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26253730&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dcsobral@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Well, let me put it another way. If you say X extends Y, then you are saying
&lt;br&gt;&amp;gt; X has Y's implementation. If you say self: Y =&amp;gt;, you are saying the class
&lt;br&gt;&amp;gt; you are mixed into must implement interface Y.
&lt;br&gt;&amp;gt; In the first case, the class mixing X in can't choose a descendant of Y, in
&lt;br&gt;&amp;gt; the second it can.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Fri, Nov 6, 2009 at 10:35 PM, Ken Scambler &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26253730&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ken.scambler@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Hi everyone,
&lt;br&gt;&amp;gt;&amp;gt; I am a little confused by the two ways to indicate that a trait must form
&lt;br&gt;&amp;gt;&amp;gt; part of a given concrete class: extension versus self-types, as shown in
&lt;br&gt;&amp;gt;&amp;gt; the
&lt;br&gt;&amp;gt;&amp;gt; subject.  I have noticed that there are some differences in behaviour
&lt;br&gt;&amp;gt;&amp;gt; between the two.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Can anyone help explain the difference between them, and what situations
&lt;br&gt;&amp;gt;&amp;gt; benefit from using one or the other?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Thanks for you time,
&lt;br&gt;&amp;gt;&amp;gt; Ken
&lt;br&gt;&amp;gt;&amp;gt; --
&lt;br&gt;&amp;gt;&amp;gt; View this message in context:
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26233138.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26233138.html&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; Sent from the Scala - User mailing list archive at Nabble.com.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Daniel C. Sobral
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Veni, vidi, veterni.
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26253730.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26247920</id>
	<title>Re: trait X extends Y vs trait X {this: Y=&gt; }</title>
	<published>2009-11-07T11:43:36Z</published>
	<updated>2009-11-07T11:43:36Z</updated>
	<author>
		<name>Miles Sabin</name>
	</author>
	<content type="html">On Sat, Nov 7, 2009 at 7:33 PM, Daniel Sobral &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26247920&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dcsobral@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Well, let me put it another way. If you say X extends Y, then you are saying
&lt;br&gt;&amp;gt; X has Y's implementation. If you say self: Y =&amp;gt;, you are saying the class
&lt;br&gt;&amp;gt; you are mixed into must implement interface Y.
&lt;br&gt;&amp;gt; In the first case, the class mixing X in can't choose a descendant of Y, in
&lt;br&gt;&amp;gt; the second it can.
&lt;br&gt;&lt;br&gt;It can in both cases,
&lt;br&gt;&lt;br&gt;scala&amp;gt; class A
&lt;br&gt;defined class A
&lt;br&gt;&lt;br&gt;scala&amp;gt; class B extends A
&lt;br&gt;defined class B
&lt;br&gt;&lt;br&gt;scala&amp;gt; trait C extends A
&lt;br&gt;defined trait C
&lt;br&gt;&lt;br&gt;scala&amp;gt; class D extends B with C
&lt;br&gt;defined class D
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;&lt;br&gt;Miles
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Miles Sabin
&lt;br&gt;tel: +44 (0)7813 944 528
&lt;br&gt;skype: &amp;nbsp;milessabin
&lt;br&gt;&lt;a href=&quot;http://www.chuusai.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.chuusai.com/&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://twitter.com/milessabin&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://twitter.com/milessabin&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26247920.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26247862</id>
	<title>Re: trait X extends Y vs trait X {this: Y=&gt; }</title>
	<published>2009-11-07T11:33:44Z</published>
	<updated>2009-11-07T11:33:44Z</updated>
	<author>
		<name>Daniel Sobral</name>
	</author>
	<content type="html">Well, let me put it another way. If you say X extends Y, then you are saying X has Y&amp;#39;s implementation. If you say self: Y =&amp;gt;, you are saying the class you are mixed into must implement interface Y.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;

In the first case, the class mixing X in can&amp;#39;t choose a descendant of Y, in the second it can.&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Fri, Nov 6, 2009 at 10:35 PM, Ken Scambler &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26247862&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ken.scambler@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;

&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;&lt;br&gt;
Hi everyone,&lt;br&gt;
I am a little confused by the two ways to indicate that a trait must form&lt;br&gt;
part of a given concrete class: extension versus self-types, as shown in the&lt;br&gt;
subject.  I have noticed that there are some differences in behaviour&lt;br&gt;
between the two.&lt;br&gt;
&lt;br&gt;
Can anyone help explain the difference between them, and what situations&lt;br&gt;
benefit from using one or the other?&lt;br&gt;
&lt;br&gt;
Thanks for you time,&lt;br&gt;
Ken&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;--&lt;br&gt;
View this message in context: &lt;a href=&quot;http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26233138.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26233138.html&lt;/a&gt;&lt;br&gt;


Sent from the Scala - User mailing list archive at Nabble.com.&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;Daniel C. Sobral&lt;br&gt;&lt;br&gt;Veni, vidi, veterni.&lt;br&gt;
&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26247862.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26247725</id>
	<title>Re: how does += work</title>
	<published>2009-11-07T11:17:14Z</published>
	<updated>2009-11-07T11:17:14Z</updated>
	<author>
		<name>Sean Corfield</name>
	</author>
	<content type="html">That made me wonder whether the following would work (it doesn't):
&lt;br&gt;&lt;br&gt;scala&amp;gt; class A(var x: Int) { def m_(y:Int) = new A(y) }
&lt;br&gt;defined class A
&lt;br&gt;&lt;br&gt;scala&amp;gt; var a = new A(10)
&lt;br&gt;a: A = A@57baae
&lt;br&gt;&lt;br&gt;scala&amp;gt; a = a m_ 5
&lt;br&gt;a: A = A@6d6c90
&lt;br&gt;&lt;br&gt;scala&amp;gt; a m_= 5
&lt;br&gt;&amp;lt;console&amp;gt;:7: error: value m_= is not a member of A
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a m_= 5
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;^
&lt;br&gt;&lt;br&gt;scala&amp;gt;
&lt;br&gt;&lt;br&gt;(m_= is not an 'operator' so the = magic doesn't apply)
&lt;br&gt;&lt;br&gt;On Sat, Nov 7, 2009 at 7:13 AM, Paul Phillips &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26247725&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paulp@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Sat, Nov 07, 2009 at 07:01:58PM +0530, Himanshu wrote:
&lt;br&gt;&amp;gt;&amp;gt; scala&amp;gt; var a = new A(10)
&lt;br&gt;&amp;gt;&amp;gt; a: A = A@1ca6954
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; scala&amp;gt; a m= 5            *//Notice, this does not work*
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;console&amp;gt;:8: error: reassignment to val
&lt;br&gt;&amp;gt;&amp;gt;        a m= 5
&lt;br&gt;&amp;gt;&amp;gt;           ^
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; m= is not even a legal token.  Operators can only be composed of
&lt;br&gt;&amp;gt; operator characters (see the specification) or if you want to mix
&lt;br&gt;&amp;gt; alphanumerics, they have to be underscore separated liked foo_++.
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/how-does-%2B%3D-work-tp26243077p26247725.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26246972</id>
	<title>Re: 2.8.0 and explicit implicit import fails</title>
	<published>2009-11-07T09:43:58Z</published>
	<updated>2009-11-07T09:43:58Z</updated>
	<author>
		<name>Blair Zajac</name>
	</author>
	<content type="html">On Nov 6, 2009, at 10:09 PM, Blair Zajac wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Using r19410 importing a single implicit def fails:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; scala&amp;gt; import scala.collection.JavaConversions.asMap
&lt;br&gt;&amp;gt; import scala.collection.JavaConversions.asMap
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; scala&amp;gt; val sm : scala.collection.Map[Int,Int] = new java.util.HashMap 
&lt;br&gt;&amp;gt; [Int,Int]
&lt;br&gt;&amp;gt; &amp;lt;console&amp;gt;:5: error: type mismatch;
&lt;br&gt;&amp;gt; found &amp;nbsp; : java.util.HashMap[Int,Int]
&lt;br&gt;&amp;gt; required: scala.collection.Map[Int,Int]
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; val sm : scala.collection.Map[Int,Int] = new java.util.HashMap 
&lt;br&gt;&amp;gt; [Int,Int]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; but importing all the implicits works:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; scala&amp;gt; import scala.collection.JavaConversions._
&lt;br&gt;&amp;gt; import scala.collection.JavaConversions._
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; scala&amp;gt; val sm : scala.collection.Map[Int,Int] = new java.util.HashMap 
&lt;br&gt;&amp;gt; [Int,Int]
&lt;br&gt;&amp;gt; sm: scala.collection.Map[Int,Int] = Map()
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Is this a bug?
&lt;/div&gt;&lt;br&gt;After chatting on IRC, Paul Philips also thought that this may be a &amp;nbsp;
&lt;br&gt;bug, so I opened:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;https://lampsvn.epfl.ch/trac/scala/ticket/2591&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lampsvn.epfl.ch/trac/scala/ticket/2591&lt;/a&gt;&lt;br&gt;&lt;br&gt;Blair
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/2.8.0-and-explicit-implicit-import-fails-tp26242398p26246972.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26246511</id>
	<title>Re: Using actors to access a shared resource</title>
	<published>2009-11-07T08:51:28Z</published>
	<updated>2009-11-07T08:51:28Z</updated>
	<author>
		<name>Grey</name>
	</author>
	<content type="html">One can @synchronized methods in Scala, so your Java example is directly translatable into Scala.  Using the Actor paradigm one would use some sort of Store and Get message.  Both ultimately use monitors to coordinate thread access.  The Actor however has some additional overhead associated with Message construction/deconstruction/queueing/dequeueing.&lt;br&gt;
&lt;br&gt;Both approaches allow one to ensure one and only one thread is accessing state at any given time.  Personally I would not use an Actor whose sole function was no more than synchronizing a collection data structure.  One certainly could however.&lt;br&gt;
&lt;br&gt;On a complete aside I do use Actors frequently and there is a usage pattern I use that I&amp;#39;m not sure I&amp;#39;ve seen mentioned. I&amp;#39;m think its safe. :)  &lt;br&gt;&lt;br&gt;Often my Actor compartmentalizes quite a bit of state and all state updating behaviour occurs via messages.  However, I may have one or more readers of simple internal state such as a counter, FSM state value etc.  The Actor approach requires some variation of the following message set for the Actor {RequestCounterValue, CounterValueResponse, SetCounterValue}.&lt;br&gt;
&lt;br&gt;However if one can ensure that state is mutated by one and only one thread, then multiple readers of state can safely read state values which are volatile.  The single thread mutation constraint is given by the Actor.  So I think the following is safe, but is unpure Actor behavior.&lt;br&gt;
&lt;br&gt;case class SetCounter (x: Int)&lt;br&gt;&lt;br&gt;val a = actor {&lt;br&gt; @volatile private counter: Int&lt;br&gt;&lt;br&gt; def count () = counter&lt;br&gt;&lt;br&gt; def act () {&lt;br&gt;  while (true) {&lt;br&gt;    receive {&lt;br&gt;      case SetCounter (x) =&amp;gt; counter = x&lt;br&gt;
  }&lt;br&gt;}&lt;br&gt;&lt;br&gt;Multiple parallel readers should be able to invoke a.count without requiring a lock and safely read the counter value.  In a sense a low level ReadWriteLock.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;
On Sat, Nov 7, 2009 at 10:58 AM, David Copeland &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26246511&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;davec@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Asked this on stackoverflow, but my example domain kinda got in the way.&lt;br&gt;&lt;br&gt;I wish to hash items and look them up by hash later.  I wish to do this in a mult-threaded context, but have a single shared key/value/hasher.&lt;br&gt;

&lt;br&gt;In Java, I would have something like:&lt;br&gt;&lt;br&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;public class Hasher {&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;  /** Stores and returns hash */&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;

&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;  public synchronized String store(Object o) { /* .. */ }&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;  /** Given hash, gets the stored object */&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;

&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;  public synchronized Object get(String hash) { /* .. */ }&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;}&lt;/span&gt;&lt;br&gt;

&lt;br&gt;I&amp;#39;m told that the actor/message paradigm is a better way to handle concurrency, plus I&amp;#39;d like to learn more about how this works in Scala.&lt;br&gt;&lt;br&gt;So, if the key/value/hasher is an actor that receives messages and sends hashes/objects back to the sender, I see two ways to do this, neither of which is appealing:&lt;br&gt;

&lt;ul&gt;&lt;li&gt;Client uses either a future or !? to block on the return&lt;/li&gt;&lt;li&gt;Client is also an actor that receives hash/Object in his act() method&lt;/li&gt;&lt;/ul&gt;Is there another way, or is this just not something one should do with Actors, or are the two options above not that bad?&lt;br&gt;

&lt;br&gt;&lt;br&gt;Dave&lt;br&gt;&lt;br&gt;---&lt;br&gt;My Blog: &lt;a href=&quot;http://www.naildrivin5.com/blog&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.naildrivin5.com/blog&lt;/a&gt;&lt;br&gt;Scala Tour for Java Developers: &lt;a href=&quot;http://www.naildrivin5.com/scalatour&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.naildrivin5.com/scalatour&lt;/a&gt;&lt;br&gt;

Fork me on Github: &lt;a href=&quot;http://davetron5000.github.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://davetron5000.github.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;The object of life is not to be on the side of the majority, but to escape finding oneself in the ranks of the insane. - Marcus Aurelius &lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Using-actors-to-access-a-shared-resource-tp26246069p26246511.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26246413</id>
	<title>Re: Using actors to access a shared resource</title>
	<published>2009-11-07T08:39:49Z</published>
	<updated>2009-11-07T08:39:49Z</updated>
	<author>
		<name>Kevin Wright-4</name>
	</author>
	<content type="html">If you're using 2.8, there's always
&lt;br&gt;scala.collections.mutable.SynchronizedMap, which gives you the nicely
&lt;br&gt;atomic getOrElseUpdate() method. &amp;nbsp;I'm not sure what the 2.7 equivalent
&lt;br&gt;is.
&lt;br&gt;&lt;br&gt;Out of curiosity, why do you think that neither of your proposed
&lt;br&gt;options is appealing?
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Sat, Nov 7, 2009 at 3:58 PM, David Copeland &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26246413&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;davec@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Asked this on stackoverflow, but my example domain kinda got in the way.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I wish to hash items and look them up by hash later.  I wish to do this in a
&lt;br&gt;&amp;gt; mult-threaded context, but have a single shared key/value/hasher.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In Java, I would have something like:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; public class Hasher {
&lt;br&gt;&amp;gt;   /** Stores and returns hash */
&lt;br&gt;&amp;gt;   public synchronized String store(Object o) { /* .. */ }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;   /** Given hash, gets the stored object */
&lt;br&gt;&amp;gt;   public synchronized Object get(String hash) { /* .. */ }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm told that the actor/message paradigm is a better way to handle
&lt;br&gt;&amp;gt; concurrency, plus I'd like to learn more about how this works in Scala.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So, if the key/value/hasher is an actor that receives messages and sends
&lt;br&gt;&amp;gt; hashes/objects back to the sender, I see two ways to do this, neither of
&lt;br&gt;&amp;gt; which is appealing:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Client uses either a future or !? to block on the return
&lt;br&gt;&amp;gt; Client is also an actor that receives hash/Object in his act() method
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Is there another way, or is this just not something one should do with
&lt;br&gt;&amp;gt; Actors, or are the two options above not that bad?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Dave
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ---
&lt;br&gt;&amp;gt; My Blog: &lt;a href=&quot;http://www.naildrivin5.com/blog&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.naildrivin5.com/blog&lt;/a&gt;&lt;br&gt;&amp;gt; Scala Tour for Java Developers: &lt;a href=&quot;http://www.naildrivin5.com/scalatour&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.naildrivin5.com/scalatour&lt;/a&gt;&lt;br&gt;&amp;gt; Fork me on Github: &lt;a href=&quot;http://davetron5000.github.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://davetron5000.github.com&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Using-actors-to-access-a-shared-resource-tp26246069p26246413.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26246230</id>
	<title>Scala XMPP?</title>
	<published>2009-11-07T08:15:49Z</published>
	<updated>2009-11-07T08:15:49Z</updated>
	<author>
		<name>Justin du coeur</name>
	</author>
	<content type="html">I&amp;#39;ve asked about this once before, but it was more tangentially and some months ago, so let&amp;#39;s check again: has anyone yet written, or is anyone working on, a serious Scala-based XMPP server?  IMO, Scala and XMPP are a natural match -- Scala actors look to be one of the better ways to write a scalable, reliable, modular XMPP server.  But so far, I haven&amp;#39;t found one.&lt;br&gt;
&lt;br&gt;I know that you can use Scala inside Openfire, but frankly, that kinda sucks -- I&amp;#39;ve spent a number of months working in that environment, and the impedance mismatch is pretty serious.  You need a lot of shims to adapt Openfire to actors, and it&amp;#39;s a pain in the ass to translate Openfire&amp;#39;s XML model to and from Scala&amp;#39;s.&lt;br&gt;
&lt;br&gt;There&amp;#39;s ESME, but that doesn&amp;#39;t appear to really be an XMPP server; rather, it seems to be a general protocol-neutral micromessaging infrastructure, which isn&amp;#39;t what I&amp;#39;m looking for here.&lt;br&gt;&lt;br&gt;You can get actor-style behaviour with ejabberd, of course -- but I just plain don&amp;#39;t *like* Erlang.&lt;br&gt;
&lt;br&gt;And Lift appears to have XMPP *client* behaviour in it, but as far as I can tell, it isn&amp;#39;t really an XMPP server.&lt;br&gt;&lt;br&gt;The impetus here is Google Wave.  One aspect of the Wave project is that Google is trying to foster an open protocol, and open-source development of reference servers for that protocol.  The server-to-server protocol is XMPP; there seems to be rough consensus that the client-server protocol should be, as well.  The first cut is written in Java (on Openfire), but many of us feel that we could do better.  Personally, I think a Scala implementation would rock.&lt;br&gt;
&lt;br&gt;So the first step towards that is a raw XMPP server framework -- it would eventually need some of the conventional XMPP capabilities, but a pretty idiosyncratic subset.  Before I start (very slowly) writing that, I want to make sure somebody&amp;#39;s not already working on it.&lt;br&gt;
&lt;br&gt;For that matter, are there folks who would be interested in helping with this, if I started it?  I don&amp;#39;t have much experience creating an open-source project, but this seems like it should definitely be one...&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Scala-XMPP--tp26246230p26246230.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26246069</id>
	<title>Using actors to access a shared resource</title>
	<published>2009-11-07T07:58:13Z</published>
	<updated>2009-11-07T07:58:13Z</updated>
	<author>
		<name>David Copeland</name>
	</author>
	<content type="html">Asked this on stackoverflow, but my example domain kinda got in the way.&lt;br&gt;&lt;br&gt;I wish to hash items and look them up by hash later.  I wish to do this in a mult-threaded context, but have a single shared key/value/hasher.&lt;br&gt;
&lt;br&gt;In Java, I would have something like:&lt;br&gt;&lt;br&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;public class Hasher {&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;  /** Stores and returns hash */&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;  public synchronized String store(Object o) { /* .. */ }&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;  /** Given hash, gets the stored object */&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;
&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;  public synchronized Object get(String hash) { /* .. */ }&lt;/span&gt;&lt;br style=&quot;font-family: courier new,monospace;&quot;&gt;&lt;span style=&quot;font-family: courier new,monospace;&quot;&gt;}&lt;/span&gt;&lt;br&gt;
&lt;br&gt;I&amp;#39;m told that the actor/message paradigm is a better way to handle concurrency, plus I&amp;#39;d like to learn more about how this works in Scala.&lt;br&gt;&lt;br&gt;So, if the key/value/hasher is an actor that receives messages and sends hashes/objects back to the sender, I see two ways to do this, neither of which is appealing:&lt;br&gt;
&lt;ul&gt;&lt;li&gt;Client uses either a future or !? to block on the return&lt;/li&gt;&lt;li&gt;Client is also an actor that receives hash/Object in his act() method&lt;/li&gt;&lt;/ul&gt;Is there another way, or is this just not something one should do with Actors, or are the two options above not that bad?&lt;br&gt;
&lt;br&gt;&lt;br&gt;Dave&lt;br&gt;&lt;br&gt;---&lt;br&gt;My Blog: &lt;a href=&quot;http://www.naildrivin5.com/blog&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.naildrivin5.com/blog&lt;/a&gt;&lt;br&gt;Scala Tour for Java Developers: &lt;a href=&quot;http://www.naildrivin5.com/scalatour&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.naildrivin5.com/scalatour&lt;/a&gt;&lt;br&gt;
Fork me on Github: &lt;a href=&quot;http://davetron5000.github.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://davetron5000.github.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Using-actors-to-access-a-shared-resource-tp26246069p26246069.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26245967</id>
	<title>Re: how does += work</title>
	<published>2009-11-07T07:47:02Z</published>
	<updated>2009-11-07T07:47:02Z</updated>
	<author>
		<name>Kevin Wright-4</name>
	</author>
	<content type="html">Excellent!
&lt;br&gt;Yet another use for our friend the underscore :)
&lt;br&gt;&lt;br&gt;On Sat, Nov 7, 2009 at 3:13 PM, Paul Phillips &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26245967&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paulp@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Sat, Nov 07, 2009 at 07:01:58PM +0530, Himanshu wrote:
&lt;br&gt;&amp;gt;&amp;gt; scala&amp;gt; var a = new A(10)
&lt;br&gt;&amp;gt;&amp;gt; a: A = A@1ca6954
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; scala&amp;gt; a m= 5            *//Notice, this does not work*
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;console&amp;gt;:8: error: reassignment to val
&lt;br&gt;&amp;gt;&amp;gt;        a m= 5
&lt;br&gt;&amp;gt;&amp;gt;           ^
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; m= is not even a legal token.  Operators can only be composed of
&lt;br&gt;&amp;gt; operator characters (see the specification) or if you want to mix
&lt;br&gt;&amp;gt; alphanumerics, they have to be underscore separated liked foo_++.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Paul Phillips      | Every election is a sort of advance auction sale
&lt;br&gt;&amp;gt; Future Perfect     | of stolen goods.
&lt;br&gt;&amp;gt; Empiricist         |     -- H. L. Mencken
&lt;br&gt;&amp;gt; pull his pi pal!   |----------* &lt;a href=&quot;http://www.improving.org/paulp/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.improving.org/paulp/&lt;/a&gt;&amp;nbsp;*----------
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/how-does-%2B%3D-work-tp26243077p26245967.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26245670</id>
	<title>Re: how does += work</title>
	<published>2009-11-07T07:13:54Z</published>
	<updated>2009-11-07T07:13:54Z</updated>
	<author>
		<name>Paul Phillips-3</name>
	</author>
	<content type="html">On Sat, Nov 07, 2009 at 07:01:58PM +0530, Himanshu wrote:
&lt;br&gt;&amp;gt; scala&amp;gt; var a = new A(10)
&lt;br&gt;&amp;gt; a: A = A@1ca6954
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; scala&amp;gt; a m= 5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*//Notice, this does not work*
&lt;br&gt;&amp;gt; &amp;lt;console&amp;gt;:8: error: reassignment to val
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a m= 5
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ^
&lt;br&gt;&lt;br&gt;m= is not even a legal token. &amp;nbsp;Operators can only be composed of 
&lt;br&gt;operator characters (see the specification) or if you want to mix 
&lt;br&gt;alphanumerics, they have to be underscore separated liked foo_++.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Paul Phillips &amp;nbsp; &amp;nbsp; &amp;nbsp;| Every election is a sort of advance auction sale
&lt;br&gt;Future Perfect &amp;nbsp; &amp;nbsp; | of stolen goods. 
&lt;br&gt;Empiricist &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp; -- H. L. Mencken
&lt;br&gt;pull his pi pal! &amp;nbsp; |----------* &lt;a href=&quot;http://www.improving.org/paulp/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.improving.org/paulp/&lt;/a&gt;&amp;nbsp;*----------
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/how-does-%2B%3D-work-tp26243077p26245670.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26244836</id>
	<title>Re: how does += work</title>
	<published>2009-11-07T05:31:58Z</published>
	<updated>2009-11-07T05:31:58Z</updated>
	<author>
		<name>Himanshu-6</name>
	</author>
	<content type="html">Thanks. But looks like my earlier response was not sent properly, anyway here it is again..&lt;br&gt;&lt;br&gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Scala has special handling of operators of the form &amp;quot;?=&amp;quot;, where ? is&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; an operator. Specifically, if there is no ?= method on the LHS, and&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; there is no implicit conversion to an object that has a ?= method,&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; then the expression is treated as &amp;quot;x = x ? y&amp;quot; (but only if that would&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; compile...)&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;&amp;gt; Scala&amp;#39;s rules for lexing splits up &amp;quot;op=&amp;quot; into two tokens, and then&lt;br&gt;

&amp;gt; attempts to compile (a op) = 5. It won&amp;#39;t if &amp;quot;op&amp;quot; is replaced with a&lt;br&gt;
&amp;gt; sequence of operator characters.&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt; &lt;br&gt;Can we explain why following is not working?&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;scala&amp;gt; class A(var x: Int) { def m(y:Int) = new A(y) }&lt;br&gt;defined class A&lt;br&gt;&lt;br&gt;scala&amp;gt; var a = new A(10)&lt;br&gt;
a: A = A@1ca6954&lt;br&gt;&lt;br&gt;scala&amp;gt; a m= 5            &lt;b&gt;//Notice, this does not work&lt;/b&gt;&lt;br&gt;&amp;lt;console&amp;gt;:8: error: reassignment to val&lt;br&gt;       a m= 5&lt;br&gt;          ^&lt;br&gt;&lt;br&gt;scala&amp;gt; (a m) = 5        &lt;b&gt; //This does not work either&lt;/b&gt;&lt;br&gt;
&amp;lt;console&amp;gt;:1: error: &amp;#39;;&amp;#39; expected but &amp;#39;=&amp;#39; found.&lt;br&gt;       (a m) = 5&lt;br&gt;             ^&lt;br&gt;&lt;br&gt;scala&amp;gt; a = a m 5       &lt;b&gt;//But this does.&lt;/b&gt;&lt;br&gt;a: A = A@d1e32d&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/how-does-%2B%3D-work-tp26243077p26244836.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26244075</id>
	<title>Why the Java Code Editor of Java IDE (e.g. Eclipse) can`t detect the  methods (or Functions) of Scala Class ?</title>
	<published>2009-11-07T03:53:40Z</published>
	<updated>2009-11-07T03:53:40Z</updated>
	<author>
		<name>Jin Xu</name>
	</author>
	<content type="html">Hello, friends:&lt;br&gt;    When call the methods write by Scala in Java Code, why the Java Code Editor of  Java IDE (e.g. Eclipse) can`t detect the methods (or Functions) of Scala Class ?&lt;br&gt;&lt;br&gt;    Please see the &lt;span class=&quot;trans&quot;&gt;email attachment.&lt;/span&gt;&lt;br&gt;
&lt;br&gt;-- &lt;br&gt;We are the best ! ! ! !&lt;br&gt;
&lt;br /&gt; &lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;1.jpg&lt;/strong&gt; (52K) &lt;a href=&quot;http://old.nabble.com/attachment/26244075/0/1.jpg&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;2.jpg&lt;/strong&gt; (72K) &lt;a href=&quot;http://old.nabble.com/attachment/26244075/1/2.jpg&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Why-the-Java-Code-Editor-of-Java-IDE-%28e.g.-Eclipse%29-can%60t-detect-the--methods-%28or-Functions%29-of-Scala-Class---tp26244075p26244075.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26243467</id>
	<title>Re: how does += work</title>
	<published>2009-11-07T02:07:43Z</published>
	<updated>2009-11-07T02:07:43Z</updated>
	<author>
		<name>Himanshu-6</name>
	</author>
	<content type="html">sorry, forgot cc&amp;#39;ing scala-user...&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sat, Nov 7, 2009 at 3:33 PM, Himanshu &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26243467&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;g.himanshu@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Thanks David, But why, then following doesn&amp;#39;t work...&lt;br&gt;&lt;br&gt;scala&amp;gt; class A(var x: Int) { def op(y:Int) = new A(y) }&lt;br&gt;defined class A&lt;br&gt;&lt;br&gt;scala&amp;gt; var a = new A(10)&lt;br&gt;a: A = A@914272&lt;br&gt;&lt;br&gt;scala&amp;gt; a op= 5                                //Note that this does not work, even though it should be same as a = a op 5&lt;br&gt;

&amp;lt;console&amp;gt;:6: error: reassignment to val&lt;br&gt;       a op= 5&lt;br&gt;           ^&lt;br&gt;&lt;br&gt;scala&amp;gt; a = a op 5                           //and indeed a =  a op 5 works&lt;br&gt;a: A = A@7691c0&lt;br&gt;&lt;br&gt;scala&amp;gt; a.x&lt;br&gt;res15: Int = 5&lt;div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sat, Nov 7, 2009 at 2:41 PM, David Hall &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26243467&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dlwh@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;

&lt;div&gt;On Sat, Nov 7, 2009 at 1:02 AM, Himanshu &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26243467&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;g.himanshu@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; scala&amp;gt; var x = 10&lt;br&gt;
&amp;gt; x: Int = 10&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; scala&amp;gt; x += 2&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; scala&amp;gt; x&lt;br&gt;
&amp;gt; res12: Int = 12&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; How does += work when It is neither a method defined in Int nor in RichInt ?&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;Scala has special handling of operators of the form &amp;quot;?=&amp;quot;, where ? is&lt;br&gt;
an operator. Specifically, if there is no ?= method on the LHS, and&lt;br&gt;
there is no implicit conversion to an object that has a ?= method,&lt;br&gt;
then the expression is treated as &amp;quot;x = x ? y&amp;quot; (but only if that would&lt;br&gt;
compile...)&lt;br&gt;
&lt;br&gt;
This means that you can define +, and get += (on vars) for free.&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
-- David&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; It seems that one can use any method name suffixed with &amp;#39;=&amp;#39; to do assignment&lt;br&gt;
&amp;gt; but its not clear to me how its happening.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt; Himanshu&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/how-does-%2B%3D-work-tp26243077p26243467.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26243460</id>
	<title>Re: GroupPanel</title>
	<published>2009-11-07T02:07:12Z</published>
	<updated>2009-11-07T02:07:12Z</updated>
	<author>
		<name>Kevin Wright-4</name>
	</author>
	<content type="html">I've done some work in scala.swing. &amp;nbsp;At first glance this looks good
&lt;br&gt;to me, good work Naftoli, this'll be a welcome addition!
&lt;br&gt;&lt;br&gt;Given this brave new world of code reviews I'd be happy to look at it
&lt;br&gt;in more detail later today, but can't see any obvious flaws... :)
&lt;br&gt;&lt;br&gt;On Fri, Nov 6, 2009 at 2:10 PM, martin odersky &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26243460&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;martin.odersky@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Thanks for the contribution, Naftoli. Ingo is currently doing an
&lt;br&gt;&amp;gt; internship, so it might be a while until he can respond. From what I
&lt;br&gt;&amp;gt; can see it looks good to me, but I am not that much of an expert. Can
&lt;br&gt;&amp;gt; other people comment?  In any case the class would need to be
&lt;br&gt;&amp;gt; documented before it can be included.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Cheers
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  -- Martin
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Tue, Nov 3, 2009 at 5:40 AM, Naftoli Gugenheim &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26243460&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;naftoligug@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; I wrote a potential contribution to scala-swing: GroupPanel, a Panel for
&lt;br&gt;&amp;gt;&amp;gt; GroupLayout.
&lt;br&gt;&amp;gt;&amp;gt; Here's my code (demo at the end)
&lt;br&gt;&amp;gt;&amp;gt; package chavrusa.frontend
&lt;br&gt;&amp;gt;&amp;gt; import javax.swing.{JPanel, GroupLayout}
&lt;br&gt;&amp;gt;&amp;gt; import scala.swing._
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; trait GroupPanel extends Panel {
&lt;br&gt;&amp;gt;&amp;gt;   override lazy val peer: javax.swing.JPanel = {
&lt;br&gt;&amp;gt;&amp;gt;     val p = new javax.swing.JPanel with SuperMixin
&lt;br&gt;&amp;gt;&amp;gt;     p.setLayout(new GroupLayout(p))
&lt;br&gt;&amp;gt;&amp;gt;     p
&lt;br&gt;&amp;gt;&amp;gt;   }
&lt;br&gt;&amp;gt;&amp;gt;   private lazy val layout = peer.getLayout.asInstanceOf[GroupLayout]
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   def autoCreateGaps = layout.getAutoCreateGaps()
&lt;br&gt;&amp;gt;&amp;gt;   def autoCreateGaps_=(b: Boolean) = layout.setAutoCreateGaps(b)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   def autoCreateContainerGaps = layout.getAutoCreateContainerGaps
&lt;br&gt;&amp;gt;&amp;gt;   def autoCreateContainerGaps_=(b: Boolean) =
&lt;br&gt;&amp;gt;&amp;gt; layout.setAutoCreateContainerGaps(b)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   sealed case class Size(value: Int)
&lt;br&gt;&amp;gt;&amp;gt;   case object SizePreferred extends Size(GroupLayout.PREFERRED_SIZE)
&lt;br&gt;&amp;gt;&amp;gt;   case object SizeDefault extends Size(GroupLayout.DEFAULT_SIZE)
&lt;br&gt;&amp;gt;&amp;gt;   implicit def intToSize(value: Int) = Size(value)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   case class SizeRange(min: Size, pref: Size, max: Size)
&lt;br&gt;&amp;gt;&amp;gt;   object DefaultSizes extends SizeRange(SizeDefault, SizeDefault,
&lt;br&gt;&amp;gt;&amp;gt; SizeDefault)
&lt;br&gt;&amp;gt;&amp;gt;   def Rigid(size: Size) = SizeRange(size, size, size)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   object ComponentPlacement extends Enumeration {
&lt;br&gt;&amp;gt;&amp;gt;     import javax.swing.LayoutStyle.ComponentPlacement._
&lt;br&gt;&amp;gt;&amp;gt;     val Indent = Value(INDENT.ordinal)
&lt;br&gt;&amp;gt;&amp;gt;     val Related = Value(RELATED.ordinal)
&lt;br&gt;&amp;gt;&amp;gt;     val Unrelated = Value(UNRELATED.ordinal)
&lt;br&gt;&amp;gt;&amp;gt;   }
&lt;br&gt;&amp;gt;&amp;gt;   object Alignment extends Enumeration {
&lt;br&gt;&amp;gt;&amp;gt;     import GroupLayout.Alignment._
&lt;br&gt;&amp;gt;&amp;gt;     val Leading = Value(LEADING.ordinal)
&lt;br&gt;&amp;gt;&amp;gt;     val Trailing = Value(TRAILING.ordinal)
&lt;br&gt;&amp;gt;&amp;gt;     val Center = Value(CENTER.ordinal)
&lt;br&gt;&amp;gt;&amp;gt;     val Baseline = Value(BASELINE.ordinal)
&lt;br&gt;&amp;gt;&amp;gt;   }
&lt;br&gt;&amp;gt;&amp;gt;   implicit def convertAlignment(a: Alignment.Value): GroupLayout.Alignment =
&lt;br&gt;&amp;gt;&amp;gt;     GroupLayout.Alignment.values()(a.id)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   sealed trait GroupItem
&lt;br&gt;&amp;gt;&amp;gt;   sealed trait AnyGroupItem extends GroupItem
&lt;br&gt;&amp;gt;&amp;gt;   sealed trait SeqGroupItem extends GroupItem
&lt;br&gt;&amp;gt;&amp;gt;   sealed trait ParGroupItem extends GroupItem
&lt;br&gt;&amp;gt;&amp;gt;   case class ComponentItem(component: Component, sizes: SizeRange) extends
&lt;br&gt;&amp;gt;&amp;gt; AnyGroupItem
&lt;br&gt;&amp;gt;&amp;gt;   case class BaselineComponentItem(component: Component, sizes: SizeRange)
&lt;br&gt;&amp;gt;&amp;gt; extends SeqGroupItem
&lt;br&gt;&amp;gt;&amp;gt;   case class Gap(sizes: SizeRange) extends AnyGroupItem
&lt;br&gt;&amp;gt;&amp;gt;   case class Subgroup(group: Group) extends AnyGroupItem
&lt;br&gt;&amp;gt;&amp;gt;   case class BaselineSubgroup(group: Group) extends SeqGroupItem
&lt;br&gt;&amp;gt;&amp;gt;   case class ContainerGap(pref: Int, max: Int) extends SeqGroupItem
&lt;br&gt;&amp;gt;&amp;gt;   case class PreferredGap(placement: ComponentPlacement.Value, pref: Int,
&lt;br&gt;&amp;gt;&amp;gt; max: Int) extends SeqGroupItem
&lt;br&gt;&amp;gt;&amp;gt;   case class AlignedComponentItem(component: Component, alignment:
&lt;br&gt;&amp;gt;&amp;gt; Alignment.Value, sizes: SizeRange) extends ParGroupItem
&lt;br&gt;&amp;gt;&amp;gt;   case class AlignedSubgroup(alignment: Alignment.Value, group: Group)
&lt;br&gt;&amp;gt;&amp;gt; extends ParGroupItem
&lt;br&gt;&amp;gt;&amp;gt;   implicit def convertGroup(g: Group): Subgroup = Subgroup(g)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   implicit def componentItem(component: Component): ComponentItem =
&lt;br&gt;&amp;gt;&amp;gt; ComponentItem(component, DefaultSizes)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   case class Group(group: GroupLayout#Group) { self =&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;     def addItem(item: GroupItem): Unit = item match {
&lt;br&gt;&amp;gt;&amp;gt;       case i: AnyGroupItem =&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;         i match {
&lt;br&gt;&amp;gt;&amp;gt;           case ComponentItem(c, SizeRange(Size(min),Size(pref),Size(max)))
&lt;br&gt;&amp;gt;&amp;gt; =&amp;gt; group.addComponent(c.peer, min,pref,max)
&lt;br&gt;&amp;gt;&amp;gt;           case Gap(SizeRange(Size(min), Size(pref), Size(max))) =&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; group.addGap(min, pref, max)
&lt;br&gt;&amp;gt;&amp;gt;           case Subgroup(g) =&amp;gt; group.addGroup(g.group)
&lt;br&gt;&amp;gt;&amp;gt;         }
&lt;br&gt;&amp;gt;&amp;gt;       case _ =&amp;gt; error(&amp;quot;Unhandled GroupItem: &amp;quot; + item)
&lt;br&gt;&amp;gt;&amp;gt;     }
&lt;br&gt;&amp;gt;&amp;gt;     def add(items: GroupItem*) = items foreach addItem
&lt;br&gt;&amp;gt;&amp;gt;   }
&lt;br&gt;&amp;gt;&amp;gt;   class SequentialGroup(override val group: GroupLayout#SequentialGroup)
&lt;br&gt;&amp;gt;&amp;gt; extends Group(group) {
&lt;br&gt;&amp;gt;&amp;gt;     def this() = this(layout.createSequentialGroup)
&lt;br&gt;&amp;gt;&amp;gt;     override def addItem(item: GroupItem) = item match{
&lt;br&gt;&amp;gt;&amp;gt;       case i: SeqGroupItem =&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;         i match {
&lt;br&gt;&amp;gt;&amp;gt;           case BaselineComponentItem(c,
&lt;br&gt;&amp;gt;&amp;gt; SizeRange(Size(min),Size(pref),Size(max))) =&amp;gt; group.addComponent(true,
&lt;br&gt;&amp;gt;&amp;gt; c.peer, min,pref,max)
&lt;br&gt;&amp;gt;&amp;gt;           case BaselineSubgroup(g) =&amp;gt; group.addGroup(true, g.group)
&lt;br&gt;&amp;gt;&amp;gt;           case ContainerGap(pref, max) =&amp;gt; group.addContainerGap(pref,max)
&lt;br&gt;&amp;gt;&amp;gt;           case PreferredGap(placement, pref, max) =&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; group.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.values()(placement.id),
&lt;br&gt;&amp;gt;&amp;gt; pref, max)
&lt;br&gt;&amp;gt;&amp;gt;         }
&lt;br&gt;&amp;gt;&amp;gt;       case _ =&amp;gt; super.addItem(item)
&lt;br&gt;&amp;gt;&amp;gt;     }
&lt;br&gt;&amp;gt;&amp;gt;   }
&lt;br&gt;&amp;gt;&amp;gt;   class ParallelGroup(override val group: GroupLayout#ParallelGroup) extends
&lt;br&gt;&amp;gt;&amp;gt; Group(group) {
&lt;br&gt;&amp;gt;&amp;gt;     def this() = this(layout.createParallelGroup)
&lt;br&gt;&amp;gt;&amp;gt;     override def addItem(item: GroupItem) = item match {
&lt;br&gt;&amp;gt;&amp;gt;       case i: ParGroupItem =&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;         i match {
&lt;br&gt;&amp;gt;&amp;gt;           case AlignedComponentItem(c, align,
&lt;br&gt;&amp;gt;&amp;gt; SizeRange(Size(min),Size(pref),Size(max))) =&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;             group.addComponent(c.peer, align, min,pref,max)
&lt;br&gt;&amp;gt;&amp;gt;           case AlignedSubgroup(align, g) =&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;             group.addGroup(align, g.group)
&lt;br&gt;&amp;gt;&amp;gt;         }
&lt;br&gt;&amp;gt;&amp;gt;       case _ =&amp;gt; super.addItem(item)
&lt;br&gt;&amp;gt;&amp;gt;     }
&lt;br&gt;&amp;gt;&amp;gt;   }
&lt;br&gt;&amp;gt;&amp;gt;   A
&lt;br&gt;&amp;gt;&amp;gt;   def sequential(items: GroupItem*) = new SequentialGroup {
&lt;br&gt;&amp;gt;&amp;gt;     add(items: _*)
&lt;br&gt;&amp;gt;&amp;gt;   }
&lt;br&gt;&amp;gt;&amp;gt;   private type P = (GroupItem*)=&amp;gt;ParallelGroup
&lt;br&gt;&amp;gt;&amp;gt;   private def par(group: GroupLayout#ParallelGroup): P =
&lt;br&gt;&amp;gt;&amp;gt;     items =&amp;gt; new ParallelGroup(group) {
&lt;br&gt;&amp;gt;&amp;gt;       add(items: _*)
&lt;br&gt;&amp;gt;&amp;gt;     }
&lt;br&gt;&amp;gt;&amp;gt;   def parallel(align: Alignment.Value, resize: Boolean): P =
&lt;br&gt;&amp;gt;&amp;gt;     par(layout.createParallelGroup(align, resize))
&lt;br&gt;&amp;gt;&amp;gt;   def parallel(): P = parallel(Alignment.Leading, true)
&lt;br&gt;&amp;gt;&amp;gt;   def parallel(align: Alignment.Value): P = parallel(align, true)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   def baseline(resize: Boolean, anchorTop: Boolean): P =
&lt;br&gt;&amp;gt;&amp;gt;     par(layout.createBaselineGroup(resize,anchorTop))
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   def honorsVisibility = layout.getHonorsVisibility()
&lt;br&gt;&amp;gt;&amp;gt;   def honorsVisibility_=(b: Boolean) = layout.setHonorsVisibility(b)
&lt;br&gt;&amp;gt;&amp;gt;   def honorsVisibility_=(c: Component, b: Option[Boolean]) =
&lt;br&gt;&amp;gt;&amp;gt;     layout.setHonorsVisibility(c.peer, b match {
&lt;br&gt;&amp;gt;&amp;gt;       case None =&amp;gt; null
&lt;br&gt;&amp;gt;&amp;gt;       case Some(true) =&amp;gt; java.lang.Boolean.TRUE
&lt;br&gt;&amp;gt;&amp;gt;       case Some(false) =&amp;gt; java.lang.Boolean.FALSE
&lt;br&gt;&amp;gt;&amp;gt;     })
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   def replace(c1: Component, c2: Component) = layout.replace(c1.peer,
&lt;br&gt;&amp;gt;&amp;gt; c2.peer)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   def linkSizes(cs: Component*) = layout.linkSize(cs.map(_.peer): _*)
&lt;br&gt;&amp;gt;&amp;gt;   def linkWidths(cs: Component*) =
&lt;br&gt;&amp;gt;&amp;gt; layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, cs.map(_.peer): _*)
&lt;br&gt;&amp;gt;&amp;gt;   def linkHeights(cs: Component*) =
&lt;br&gt;&amp;gt;&amp;gt; layout.linkSize(javax.swing.SwingConstants.VERTICAL, cs.map(_.peer): _*)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;   def horizontalGroup(g: Group) = layout.setHorizontalGroup(g.group)
&lt;br&gt;&amp;gt;&amp;gt;   def verticalGroup(g: Group) = layout.setVerticalGroup(g.group)
&lt;br&gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; object TestGroupPanel extends SimpleGUIApplication {
&lt;br&gt;&amp;gt;&amp;gt;   val top = new Frame {
&lt;br&gt;&amp;gt;&amp;gt;     contents = new GroupPanel {
&lt;br&gt;&amp;gt;&amp;gt;       val label1 = new Label(&amp;quot;Label 1&amp;quot;)
&lt;br&gt;&amp;gt;&amp;gt;       val label2 = new Label(&amp;quot;Label 2&amp;quot;)
&lt;br&gt;&amp;gt;&amp;gt;       val text1 = new TextField
&lt;br&gt;&amp;gt;&amp;gt;       val text2 = new TextField
&lt;br&gt;&amp;gt;&amp;gt;       autoCreateGaps = true
&lt;br&gt;&amp;gt;&amp;gt;       autoCreateContainerGaps = true
&lt;br&gt;&amp;gt;&amp;gt;       horizontalGroup {
&lt;br&gt;&amp;gt;&amp;gt;         sequential(
&lt;br&gt;&amp;gt;&amp;gt;           parallel()(label1, label2),
&lt;br&gt;&amp;gt;&amp;gt;           parallel()(text1, text2)
&lt;br&gt;&amp;gt;&amp;gt;         )
&lt;br&gt;&amp;gt;&amp;gt;       }
&lt;br&gt;&amp;gt;&amp;gt;       verticalGroup {
&lt;br&gt;&amp;gt;&amp;gt;         sequential(
&lt;br&gt;&amp;gt;&amp;gt;           parallel(Alignment.Baseline)(label1, text1),
&lt;br&gt;&amp;gt;&amp;gt;           parallel(Alignment.Baseline)(label2, text2)
&lt;br&gt;&amp;gt;&amp;gt;         )
&lt;br&gt;&amp;gt;&amp;gt;       }
&lt;br&gt;&amp;gt;&amp;gt;     }
&lt;br&gt;&amp;gt;&amp;gt;   }
&lt;br&gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/GroupPanel-tp26174847p26243460.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26243122</id>
	<title>Re: how does += work</title>
	<published>2009-11-07T01:11:52Z</published>
	<updated>2009-11-07T01:11:52Z</updated>
	<author>
		<name>David Hall-17</name>
	</author>
	<content type="html">On Sat, Nov 7, 2009 at 1:02 AM, Himanshu &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26243122&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;g.himanshu@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; scala&amp;gt; var x = 10
&lt;br&gt;&amp;gt; x: Int = 10
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; scala&amp;gt; x += 2
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; scala&amp;gt; x
&lt;br&gt;&amp;gt; res12: Int = 12
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; How does += work when It is neither a method defined in Int nor in RichInt ?
&lt;/div&gt;&lt;br&gt;Scala has special handling of operators of the form &amp;quot;?=&amp;quot;, where ? is
&lt;br&gt;an operator. Specifically, if there is no ?= method on the LHS, and
&lt;br&gt;there is no implicit conversion to an object that has a ?= method,
&lt;br&gt;then the expression is treated as &amp;quot;x = x ? y&amp;quot; (but only if that would
&lt;br&gt;compile...)
&lt;br&gt;&lt;br&gt;This means that you can define +, and get += (on vars) for free.
&lt;br&gt;&lt;br&gt;-- David
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It seems that one can use any method name suffixed with '=' to do assignment
&lt;br&gt;&amp;gt; but its not clear to me how its happening.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; Himanshu
&lt;br&gt;&amp;gt;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/how-does-%2B%3D-work-tp26243077p26243122.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26243077</id>
	<title>how does += work</title>
	<published>2009-11-07T01:02:31Z</published>
	<updated>2009-11-07T01:02:31Z</updated>
	<author>
		<name>Himanshu-6</name>
	</author>
	<content type="html">&lt;br&gt;scala&amp;gt; var x = 10&lt;br&gt;x: Int = 10&lt;br&gt;&lt;br&gt;scala&amp;gt; x += 2&lt;br&gt;&lt;br&gt;scala&amp;gt; x&lt;br&gt;res12: Int = 12&lt;br&gt;&lt;br&gt;How does += work when It is neither a method defined in Int nor in RichInt ?&lt;br&gt;&lt;br&gt;It seems that one can use any method name suffixed with &amp;#39;=&amp;#39; to do assignment but its not clear to me how its happening.&lt;br&gt;
&lt;br&gt;Thanks,&lt;br&gt;Himanshu&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/how-does-%2B%3D-work-tp26243077p26243077.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26242472</id>
	<title>Re: trait X extends Y vs trait X {this: Y=&gt; }</title>
	<published>2009-11-06T22:33:35Z</published>
	<updated>2009-11-06T22:33:35Z</updated>
	<author>
		<name>David Hall-17</name>
	</author>
	<content type="html">On Fri, Nov 6, 2009 at 4:47 PM, Josh Suereth &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26242472&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joshua.suereth@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; The self type only enforces that you are *mixed-into* a particular type.  A
&lt;br&gt;&amp;gt; trait that extends another could possibly be used standalone.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I would reserve self-types for things that truly are just mixins, and a
&lt;br&gt;&amp;gt; &amp;quot;class instantiation concern&amp;quot;.  This means the following:
&lt;br&gt;&lt;br&gt;It can also be used to influence the linearization order of the
&lt;br&gt;traits. Maybe one should be careful in using this feature, but notice
&lt;br&gt;the difference in:
&lt;br&gt;&lt;br&gt;scala&amp;gt; trait Foo { def foo = println(&amp;quot;Foo&amp;quot;) }
&lt;br&gt;defined trait Foo
&lt;br&gt;&lt;br&gt;scala&amp;gt; trait Bar extends Foo { override def foo { println(&amp;quot;Bar&amp;quot;); super.foo } }
&lt;br&gt;defined trait Bar
&lt;br&gt;&lt;br&gt;scala&amp;gt; trait Baz extends Foo { this : Bar =&amp;gt; override def foo {
&lt;br&gt;println(&amp;quot;Baz&amp;quot;); super.foo; } }
&lt;br&gt;defined trait Baz
&lt;br&gt;&lt;br&gt;scala&amp;gt; val a = new Bar with Baz;
&lt;br&gt;a: java.lang.Object with Bar with Baz = $anon$1@ee13d0
&lt;br&gt;&lt;br&gt;scala&amp;gt; a.foo
&lt;br&gt;Baz
&lt;br&gt;Bar
&lt;br&gt;Foo
&lt;br&gt;&lt;br&gt;scala&amp;gt; val b = new Baz with Bar;
&lt;br&gt;b: java.lang.Object with Baz with Bar = $anon$1@4deff4f
&lt;br&gt;&lt;br&gt;scala&amp;gt; b.foo
&lt;br&gt;Bar
&lt;br&gt;Baz
&lt;br&gt;Foo
&lt;br&gt;&lt;br&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;Versus&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&lt;br&gt;scala&amp;gt; trait Foo2 &amp;nbsp;{ def foo = println(&amp;quot;foo&amp;quot;); }
&lt;br&gt;defined trait Foo2
&lt;br&gt;&lt;br&gt;scala&amp;gt; trait Bar2 extends Foo2 { override def foo { println(&amp;quot;bar&amp;quot;);
&lt;br&gt;super.foo } }
&lt;br&gt;defined trait Bar2
&lt;br&gt;&lt;br&gt;scala&amp;gt; trait Baz2 extends Bar2 { override def foo { println(&amp;quot;baz&amp;quot;);
&lt;br&gt;super.foo } }
&lt;br&gt;defined trait Baz2
&lt;br&gt;&lt;br&gt;scala&amp;gt; new Bar2 with Baz2 foo
&lt;br&gt;baz
&lt;br&gt;bar
&lt;br&gt;foo
&lt;br&gt;&lt;br&gt;scala&amp;gt; new Baz2 with Bar2 foo
&lt;br&gt;baz
&lt;br&gt;bar
&lt;br&gt;foo
&lt;br&gt;&lt;br&gt;-- David
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; trait X extends Y // X *is a* Y
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; trait X { self : Y =&amp;gt; ... }    // X is a helper that can be used with a Y.
&lt;br&gt;&amp;gt; I would tend to prefer this over aspects for specific kinds of mixin
&lt;br&gt;&amp;gt; functionality.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; An example from EJB (yes... I know)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; trait BaseDataAccessEJB {
&lt;br&gt;&amp;gt;    def tx : UserTransaction
&lt;br&gt;&amp;gt;    def entityManager : EntityManager
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; trait TransactionHelper { self : BaseDataAccessEJB =&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;    //This is a toy implementation, in reality there are far more concerns to
&lt;br&gt;&amp;gt; worry about in this method
&lt;br&gt;&amp;gt;    def transactional(f : =&amp;gt; A) : A = {
&lt;br&gt;&amp;gt;           tx.start()
&lt;br&gt;&amp;gt;          try {
&lt;br&gt;&amp;gt;               f
&lt;br&gt;&amp;gt;           } finally {
&lt;br&gt;&amp;gt;               tx.commit()
&lt;br&gt;&amp;gt;           }
&lt;br&gt;&amp;gt;    }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Then when creating a new EJB I can do   class MyEJB extends
&lt;br&gt;&amp;gt; BaseDataAccessEJB with TransactionHelper
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I hope that helps,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; - Josh
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Fri, Nov 6, 2009 at 7:35 PM, Ken Scambler &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26242472&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ken.scambler@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Hi everyone,
&lt;br&gt;&amp;gt;&amp;gt; I am a little confused by the two ways to indicate that a trait must form
&lt;br&gt;&amp;gt;&amp;gt; part of a given concrete class: extension versus self-types, as shown in
&lt;br&gt;&amp;gt;&amp;gt; the
&lt;br&gt;&amp;gt;&amp;gt; subject.  I have noticed that there are some differences in behaviour
&lt;br&gt;&amp;gt;&amp;gt; between the two.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Can anyone help explain the difference between them, and what situations
&lt;br&gt;&amp;gt;&amp;gt; benefit from using one or the other?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Thanks for you time,
&lt;br&gt;&amp;gt;&amp;gt; Ken
&lt;br&gt;&amp;gt;&amp;gt; --
&lt;br&gt;&amp;gt;&amp;gt; View this message in context:
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26233138.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26233138.html&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; Sent from the Scala - User mailing list archive at Nabble.com.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26242472.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26242398</id>
	<title>2.8.0 and explicit implicit import fails</title>
	<published>2009-11-06T22:09:56Z</published>
	<updated>2009-11-06T22:09:56Z</updated>
	<author>
		<name>Blair Zajac</name>
	</author>
	<content type="html">Using r19410 importing a single implicit def fails:
&lt;br&gt;&lt;br&gt;&lt;br&gt;scala&amp;gt; import scala.collection.JavaConversions.asMap
&lt;br&gt;import scala.collection.JavaConversions.asMap
&lt;br&gt;&lt;br&gt;scala&amp;gt; val sm : scala.collection.Map[Int,Int] = new java.util.HashMap[Int,Int]
&lt;br&gt;&amp;lt;console&amp;gt;:5: error: type mismatch;
&lt;br&gt;&amp;nbsp; found &amp;nbsp; : java.util.HashMap[Int,Int]
&lt;br&gt;&amp;nbsp; required: scala.collection.Map[Int,Int]
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; val sm : scala.collection.Map[Int,Int] = new java.util.HashMap[Int,Int]
&lt;br&gt;&lt;br&gt;&lt;br&gt;but importing all the implicits works:
&lt;br&gt;&lt;br&gt;&lt;br&gt;scala&amp;gt; import scala.collection.JavaConversions._
&lt;br&gt;import scala.collection.JavaConversions._
&lt;br&gt;&lt;br&gt;scala&amp;gt; val sm : scala.collection.Map[Int,Int] = new java.util.HashMap[Int,Int]
&lt;br&gt;sm: scala.collection.Map[Int,Int] = Map()
&lt;br&gt;&lt;br&gt;&lt;br&gt;Is this a bug?
&lt;br&gt;&lt;br&gt;Could this be due to the fact that there are two asMap's defined in 
&lt;br&gt;scala.collection.JavaConversions?
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Blair
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Blair Zajac, Ph.D.
&lt;br&gt;CTO, OrcaWare Technologies
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26242398&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;blair@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Subversion training, consulting and support
&lt;br&gt;&lt;a href=&quot;http://www.orcaware.com/svn/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.orcaware.com/svn/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/2.8.0-and-explicit-implicit-import-fails-tp26242398p26242398.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26241033</id>
	<title>Re: trait X extends Y vs trait X {this: Y=&gt; }</title>
	<published>2009-11-06T16:47:32Z</published>
	<updated>2009-11-06T16:47:32Z</updated>
	<author>
		<name>Josh Suereth</name>
	</author>
	<content type="html">The self type only enforces that you are *mixed-into* a particular type.  A trait that extends another could possibly be used standalone.&lt;br&gt;&lt;br&gt;I would reserve self-types for things that truly are just mixins, and a &amp;quot;class instantiation concern&amp;quot;.  This means the following:&lt;br&gt;
&lt;br&gt;trait X extends Y // X *is a* Y&lt;br&gt;&lt;br&gt;trait X { self : Y =&amp;gt; ... }    // X is a helper that can be used with a Y.   I would tend to prefer this over aspects for specific kinds of mixin functionality.&lt;br&gt;&lt;br&gt;An example from EJB (yes... I know)&lt;br&gt;
&lt;br&gt;trait BaseDataAccessEJB {&lt;br&gt;   def tx : UserTransaction&lt;br&gt;   def entityManager : EntityManager&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;br&gt;trait TransactionHelper { self : BaseDataAccessEJB =&amp;gt;&lt;br&gt;&lt;br&gt;   //This is a toy implementation, in reality there are far more concerns to worry about in this method&lt;br&gt;
   def transactional(f : =&amp;gt; A) : A = {&lt;br&gt;          tx.start()&lt;br&gt;         try {&lt;br&gt;              f&lt;br&gt;          } finally {&lt;br&gt;              tx.commit()&lt;br&gt;          }&lt;br&gt;   }&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;br&gt;Then when creating a new EJB I can do   class MyEJB extends BaseDataAccessEJB with TransactionHelper&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;I hope that helps,&lt;br&gt;&lt;br&gt;- Josh&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Fri, Nov 6, 2009 at 7:35 PM, Ken Scambler &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26241033&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ken.scambler@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;&lt;br&gt;
Hi everyone,&lt;br&gt;
I am a little confused by the two ways to indicate that a trait must form&lt;br&gt;
part of a given concrete class: extension versus self-types, as shown in the&lt;br&gt;
subject.  I have noticed that there are some differences in behaviour&lt;br&gt;
between the two.&lt;br&gt;
&lt;br&gt;
Can anyone help explain the difference between them, and what situations&lt;br&gt;
benefit from using one or the other?&lt;br&gt;
&lt;br&gt;
Thanks for you time,&lt;br&gt;
Ken&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;--&lt;br&gt;
View this message in context: &lt;a href=&quot;http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26233138.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26233138.html&lt;/a&gt;&lt;br&gt;

Sent from the Scala - User mailing list archive at Nabble.com.&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26241033.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26233138</id>
	<title>trait X extends Y vs trait X {this: Y=&gt; }</title>
	<published>2009-11-06T16:35:06Z</published>
	<updated>2009-11-06T16:35:06Z</updated>
	<author>
		<name>Ken Scambler</name>
	</author>
	<content type="html">Hi everyone,
&lt;br&gt;I am a little confused by the two ways to indicate that a trait must form part of a given concrete class: extension versus self-types, as shown in the subject. &amp;nbsp;I have noticed that there are some differences in behaviour between the two. 
&lt;br&gt;&lt;br&gt;Can anyone help explain the difference between them, and what situations benefit from using one or the other?
&lt;br&gt;&lt;br&gt;Thanks for you time,
&lt;br&gt;Ken</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/trait-X-extends-Y-vs-trait-X-%7Bthis%3A-Y%3D%3E-%7D-tp26233138p26233138.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26240238</id>
	<title>[ANN] CfP: &quot;Multiparadigm Programming&quot; Special Issue of IEEE Software</title>
	<published>2009-11-06T15:24:53Z</published>
	<updated>2009-11-06T15:24:53Z</updated>
	<author>
		<name>Dean Wampler-2</name>
	</author>
	<content type="html">I&amp;#39;m one of the guest editors for a special issue of IEEE Software on &amp;quot;Multiparadigm Programming&amp;quot;. This community knows something about that topic ;)&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://www.computer.org/portal/web/computingnow/swcfp5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.computer.org/portal/web/computingnow/swcfp5&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Please consider submitting a paper. Feel free to email me directly with questions. We&amp;#39;re also looking for reviewers.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thanks,&lt;/div&gt;&lt;div&gt;Dean&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;Dean Wampler&lt;br&gt;
coauthor of &amp;quot;Programming Scala&amp;quot; (O&amp;#39;Reilly)&lt;br&gt;-  &lt;a href=&quot;http://programmingscala.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://programmingscala.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;twitter: @deanwampler, @chicagoscala&lt;br&gt;Chicago-Area Scala Enthusiasts (CASE):&lt;br&gt;
-  &lt;a href=&quot;http://groups.google.com/group/chicagoscala&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://groups.google.com/group/chicagoscala&lt;/a&gt;&lt;br&gt;-  &lt;a href=&quot;http://www.meetup.com/chicagoscala/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.meetup.com/chicagoscala/&lt;/a&gt; (Meetings)&lt;br&gt;&lt;a href=&quot;http://www.linkedin.com/in/deanwampler&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.linkedin.com/in/deanwampler&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://www.polyglotprogramming.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.polyglotprogramming.com&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://aquarium.rubyforge.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://aquarium.rubyforge.org&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.contract4j.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.contract4j.org&lt;/a&gt;&lt;br&gt;

&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-ANN--CfP%3A-%22Multiparadigm-Programming%22-Special-Issue-of-IEEE-Software-tp26240238p26240238.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26239439</id>
	<title>Re: Is there a Scala equivalent of package-info.java?</title>
	<published>2009-11-06T14:13:54Z</published>
	<updated>2009-11-06T14:13:54Z</updated>
	<author>
		<name>phkoester</name>
	</author>
	<content type="html">&amp;gt; You need to use Scala 2.8 to gain access to package objects.
&lt;br&gt;&lt;br&gt;Yeah I know. I do use the latest 2.8 nightly I think. Package objects 
&lt;br&gt;seem to compile, and they don't seem to require a file named 
&lt;br&gt;`package.scala'. Only I don't know how to use annotations for package 
&lt;br&gt;objects. I believe it just doesn't work ...
&lt;br&gt;&lt;br&gt;---Ph.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Is-there-a-Scala-equivalent-of-package-info.java--tp26233028p26239439.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26239178</id>
	<title>Re: Is there a Scala equivalent of package-info.java?</title>
	<published>2009-11-06T13:55:20Z</published>
	<updated>2009-11-06T13:55:20Z</updated>
	<author>
		<name>David Flemström</name>
	</author>
	<content type="html">You need to use Scala 2.8 to gain access to package objects.
&lt;br&gt;&lt;br&gt;On Friday 06 November 2009 21:16:46 Philip Köster wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt; Package objects must be in files named &amp;quot;package.scala&amp;quot;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I don't get this to compile. Here is my `package.scala':
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	package com.phrood
&lt;br&gt;&amp;gt; 	@javax.annotation.Resource // Just a test
&lt;br&gt;&amp;gt; 	package object scarab
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Compiler says:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 	C:\Users\phkoester\Data\phrood\scarab\src\main\java\com\phrood\scarab\pack
&lt;br&gt;&amp;gt; age.scala:3: error: expected start of definition
&lt;br&gt;&amp;gt; 	package object scarab
&lt;br&gt;&amp;gt; 	^
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Is-there-a-Scala-equivalent-of-package-info.java--tp26233028p26239178.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26238377</id>
	<title>Re: Is there a Scala equivalent of package-info.java?</title>
	<published>2009-11-06T12:48:48Z</published>
	<updated>2009-11-06T12:48:48Z</updated>
	<author>
		<name>phkoester</name>
	</author>
	<content type="html">&amp;gt; I don't get this to compile. Here is my `package.scala':
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; package com.phrood
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; @javax.annotation.Resource // Just a test
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; package object scarab
&lt;br&gt;&lt;br&gt;On a side note, the `Resource' annotation cannot be applied to packages, 
&lt;br&gt;but that's not the reason why compiling fails. I just checked it with a 
&lt;br&gt;custom annotation that is capable of annoting packages, and the result 
&lt;br&gt;is the same.
&lt;br&gt;&lt;br&gt;---Ph.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Is-there-a-Scala-equivalent-of-package-info.java--tp26233028p26238377.html" />
</entry>

</feed>
