<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-14147</id>
	<title>Nabble - Scala</title>
	<updated>2009-11-10T06:26:58Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/Scala-f14147.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Scala-f14147.html" />
	<subtitle type="html">&lt;a href=&quot;http://scala.epfl.ch/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Scala&lt;/a&gt;&amp;nbsp;is a modern multi-paradigm programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages.</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26284339</id>
	<title>Re: [scala] Scala Servlets</title>
	<published>2009-11-10T06:26:58Z</published>
	<updated>2009-11-10T06:26:58Z</updated>
	<author>
		<name>Andrew Gaydenko</name>
	</author>
	<content type="html">On Tuesday 10 November 2009 17:19:54 Stepan Koltsov wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Tue, Nov 10, 2009 at 11:52, Christian Helmbold
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26284339&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;christian.helmbold@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; Dave, you and Stephan are right. My API doesn't add much value to the
&lt;br&gt;&amp;gt; &amp;gt; original API but brings new trouble (as Stephan showed). This API was
&lt;br&gt;&amp;gt; &amp;gt; only my first thought.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; How would the Servlet API look like if it would be rewritten from scratch
&lt;br&gt;&amp;gt; &amp;gt; in Scala?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Why rewrite Servlets API from scratch in Scala? Servlets API need not
&lt;br&gt;&amp;gt; to be rewritten. Servlets do well what are they supposed to do.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Probably, you want to design another web framework on top of servlets API.
&lt;/div&gt;&lt;br&gt;...or regardless servlets at all :-)
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; S.
&lt;br&gt;&amp;gt; 
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Scala-Servlets-tp26272965p26284339.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26284259</id>
	<title>Re: [scala] Scala Servlets</title>
	<published>2009-11-10T06:19:54Z</published>
	<updated>2009-11-10T06:19:54Z</updated>
	<author>
		<name>Stepan Koltsov-5</name>
	</author>
	<content type="html">On Tue, Nov 10, 2009 at 11:52, Christian Helmbold
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26284259&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;christian.helmbold@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Dave, you and Stephan are right. My API doesn't add much value to the
&lt;br&gt;&amp;gt; original API but brings new trouble (as Stephan showed). This API was
&lt;br&gt;&amp;gt; only my first thought.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; How would the Servlet API look like if it would be rewritten from scratch in Scala?
&lt;br&gt;&lt;br&gt;Why rewrite Servlets API from scratch in Scala? Servlets API need not
&lt;br&gt;to be rewritten. Servlets do well what are they supposed to do.
&lt;br&gt;&lt;br&gt;Probably, you want to design another web framework on top of servlets API.
&lt;br&gt;&lt;br&gt;S.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Scala-Servlets-tp26272965p26284259.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26284235</id>
	<title>[scala]  a code walkthrough of the CleanUp phase of scalac</title>
	<published>2009-11-10T06:16:11Z</published>
	<updated>2009-11-10T06:16:11Z</updated>
	<author>
		<name>Miguel Garcia</name>
	</author>
	<content type="html">&lt;br&gt;Hi,
&lt;br&gt;&lt;br&gt;I've been meaning for a while to get a clearer picture of the CleanUp phase 
&lt;br&gt;of scalac, and as a side-effect I've drafted the attached notes to (1) offer 
&lt;br&gt;a tutorial for future compiler-plugin authors; and (2) share information 
&lt;br&gt;with those interested in learning more about the internals of scalac. 
&lt;br&gt;Because of these different audiences, I'm cross-posting these notes to both 
&lt;br&gt;the scala and scala.internals mailing lists.
&lt;br&gt;&lt;br&gt;Comments, extensions and corrections are welcome.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Miguel
&lt;br&gt;&lt;a href=&quot;http://www.sts.tu-harburg.de/people/mi.garcia/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sts.tu-harburg.de/people/mi.garcia/&lt;/a&gt;&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;CleanUpCodeWalkthrough.pdf&lt;/strong&gt; (1000K) &lt;a href=&quot;http://old.nabble.com/attachment/26284235/0/CleanUpCodeWalkthrough.pdf&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/-scala---a-code-walkthrough-of-the-CleanUp-phase-of-scalac-tp26284235p26284235.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26282380</id>
	<title>Re: [scala] A small change to compiler phases</title>
	<published>2009-11-10T04:11:08Z</published>
	<updated>2009-11-10T04:11:08Z</updated>
	<author>
		<name>Kevin Wright-4</name>
	</author>
	<content type="html">On Tue, Nov 10, 2009 at 7:48 AM, Kevin Wright
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26282380&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kev.lee.wright@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Tue, Nov 10, 2009 at 6:07 AM, Stephen Haberman
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26282380&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stephen@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I'd prefer an optional phase of &amp;quot;please typer don't complain I WILL
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; fix this tree for you, but may ask you to run again, oh and on that
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; second run could you please add the following synthetics in&amp;quot;. This
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; would allow for the case where you need the type information from
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; typers (as per my plugin) but would like to add synthetics.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Speaking with absolutely zero knowledge how of scala compiler plugins
&lt;br&gt;&amp;gt;&amp;gt; work, this sounds vaguely like JDK6 annotation processors.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; E.g. I can manually write some code that depends on a non-existent
&lt;br&gt;&amp;gt;&amp;gt; FooClass, and so fails to compile on the first round. But then the
&lt;br&gt;&amp;gt;&amp;gt; javac compiler runs the annotation processor, which creates the
&lt;br&gt;&amp;gt;&amp;gt; FooClass.java source, so the compiler starts a 2nd round to compile
&lt;br&gt;&amp;gt;&amp;gt; FooClass.java -&amp;gt; FooClass.class. Having done that, the compiler then
&lt;br&gt;&amp;gt;&amp;gt; re-compiles/fixes the &amp;quot;FooClass not found&amp;quot; error from the first round,
&lt;br&gt;&amp;gt;&amp;gt; and everything is now fine.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; javac would even start up a 3rd round if the FooClass.java source that
&lt;br&gt;&amp;gt;&amp;gt; the first annotation processor generated happened to have annotations
&lt;br&gt;&amp;gt;&amp;gt; that triggered another annotation processor to generate yet more source
&lt;br&gt;&amp;gt;&amp;gt; code. It keeps going until no more source files have been generated.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; No idea whether multiple rounds makes sense for scala compiler plugins,
&lt;br&gt;&amp;gt;&amp;gt; but in my experience it has worked well for annotation processors.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; - Stephen
&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;&amp;gt; I can imagine something like this working for a range of issues:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; - During typer, postpone the display of any error messages
&lt;br&gt;&amp;gt; - Create an new phase typeSynthetics, immediately before superaccessors
&lt;br&gt;&amp;gt; - A unit can be flagged for re-compilation by any phase before this
&lt;br&gt;&amp;gt;  (so plugins would runAfter typer, but before typeSynthetics)
&lt;br&gt;&amp;gt; - In typeSynthetics, reprocess (namer--&amp;gt;typeSynthetics) any flagged unit
&lt;br&gt;&amp;gt; - Report any outstanding typer failures
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;Thinking about this further, I'd also like to be able to REMOVE
&lt;br&gt;methods via a compiler plugin.
&lt;br&gt;&lt;br&gt;The specific goal I have in mind is an annotation that indicates which
&lt;br&gt;JVMs a particular method is valid on (i.e. a method implemented in
&lt;br&gt;JDK7 could have a fallback available in a scala Rich wrapper, which is
&lt;br&gt;only compiled for JDK &amp;lt;= 6, handy for the IO stuff). &amp;nbsp;This could also
&lt;br&gt;be handled very cleanly by running a second pass of the namer/typer
&lt;br&gt;phases.
&lt;br&gt;&lt;br&gt;For now, I'm looking to see if I can write a compiler plugin to run
&lt;br&gt;after parser which will perform a local run of namer/typer, do its
&lt;br&gt;stuff in the AST, then throw away the localised symbol/type info and
&lt;br&gt;proceed naturally onto namer and subsequent phases in global. &amp;nbsp;I
&lt;br&gt;suspect that minimising the amount of naming/typing performed in this
&lt;br&gt;first pass (for reasons of performance) is going to be one of my
&lt;br&gt;bigger challenges here, I'll have to look at what's possible in nsc by
&lt;br&gt;way of building a dependency graph.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--A-small-change-to-compiler-phases-tp26268455p26282380.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26281097</id>
	<title>Re: AW: [scala] Scala Servlets</title>
	<published>2009-11-10T02:17:47Z</published>
	<updated>2009-11-10T02:17:47Z</updated>
	<author>
		<name>Tony Morris-4</name>
	</author>
	<content type="html">&lt;br&gt;Christian Helmbold wrote:
&lt;br&gt;&amp;gt; How would the Servlet API look like if it would be rewritten from scratch in Scala?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;case class WebApplication[IN[_], OUT[_]](f: Request[IN] =&amp;gt; Response[OUT])
&lt;br&gt;&lt;br&gt;If you want lots of problems, start where most &amp;quot;web frameworks&amp;quot; do:
&lt;br&gt;case class WebApplication(f: (Request, Response) =&amp;gt; Unit)
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Tony Morris
&lt;br&gt;&lt;a href=&quot;http://tmorris.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tmorris.net/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Scala-Servlets-tp26272965p26281097.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26280915</id>
	<title>Re: [scala] Scala Servlets</title>
	<published>2009-11-10T02:00:57Z</published>
	<updated>2009-11-10T02:00:57Z</updated>
	<author>
		<name>Kevin Wright-4</name>
	</author>
	<content type="html">I like the approach that Lift has taken, where they abstracted out the
&lt;br&gt;idea of a request and a response that don't have to be a
&lt;br&gt;ServletRequest and Servlet response, thus opening up a whole new world
&lt;br&gt;of alternate possibilities. &amp;nbsp;Of course, given the title of this thread
&lt;br&gt;I suspect that's not what you're looking for :)
&lt;br&gt;&lt;br&gt;Perhaps the crucial issue is that Scala tends to favour immutability
&lt;br&gt;and functional programming far more than java, so it could be
&lt;br&gt;interesting to consider an immutable RequestReponse object and then
&lt;br&gt;implement doGet as:
&lt;br&gt;&lt;br&gt;doGet(rr:RequestResponse) : RequestResponse
&lt;br&gt;&lt;br&gt;This would help with testing and in implementing filters, helper
&lt;br&gt;methods, etc. &amp;nbsp;Although it would require a very different style of
&lt;br&gt;programming to use efficiently (i.e. as any method modifying the
&lt;br&gt;response would necessarily create a new RequestResponse object, you
&lt;br&gt;wouldn't write direct to response, but instead to something like a
&lt;br&gt;mutable ResponseBuilder, the + operator on RequestResponse could then
&lt;br&gt;be implemented to take a ResponseBuilder and return a new
&lt;br&gt;RequestResponse)
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Tue, Nov 10, 2009 at 8:52 AM, Christian Helmbold
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26280915&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;christian.helmbold@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Dave, you and Stephan are right. My API doesn't add much value to the
&lt;br&gt;&amp;gt; original API but brings new trouble (as Stephan showed). This API was
&lt;br&gt;&amp;gt; only my first thought.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; How would the Servlet API look like if it would be rewritten from scratch in Scala?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Christian
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; __________________________________________________
&lt;br&gt;&amp;gt; Do You Yahoo!?
&lt;br&gt;&amp;gt; Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails.
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://mail.yahoo.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mail.yahoo.com&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Scala-Servlets-tp26272965p26280915.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26280720</id>
	<title>Re: [scala] Scala Servlets</title>
	<published>2009-11-10T01:42:53Z</published>
	<updated>2009-11-10T01:42:53Z</updated>
	<author>
		<name>Viktor Klang</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Tue, Nov 10, 2009 at 9:52 AM, Christian Helmbold &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26280720&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;christian.helmbold@...&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;
Dave, you and Stephan are right. My API doesn&amp;#39;t add much value to the&lt;br&gt;
original API but brings new trouble (as Stephan showed). This API was&lt;br&gt;
only my first thought.&lt;br&gt;
&lt;br&gt;
How would the Servlet API look like if it would be rewritten from scratch in Scala?&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;I kinda like the JAX-RS approach&lt;br&gt; &lt;/div&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;font color=&quot;#888888&quot;&gt;&lt;br&gt;
Christian&lt;br&gt;
&lt;/font&gt;&lt;div class=&quot;hm&quot;&gt;&lt;br&gt;
__________________________________________________&lt;br&gt;
Do You Yahoo!?&lt;br&gt;
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails.&lt;br&gt;
&lt;a href=&quot;http://mail.yahoo.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://mail.yahoo.com&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;Viktor Klang&lt;br&gt;| &amp;quot;A complex system that works is invariably &lt;br&gt;| found to have evolved from a simple system &lt;br&gt;| that worked.&amp;quot; - John Gall&lt;br&gt;&lt;br&gt;Blog: &lt;a href=&quot;http://klangism.blogspot.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;klangism.blogspot.com&lt;/a&gt;&lt;br&gt;
Twttr: &lt;a href=&quot;http://twitter.com/viktorklang&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;twitter.com/viktorklang&lt;/a&gt;&lt;br&gt;Code: &lt;a href=&quot;http://github.com/viktorklang&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;github.com/viktorklang&lt;/a&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Scala-Servlets-tp26272965p26280720.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26280117</id>
	<title>AW: [scala] Scala Servlets</title>
	<published>2009-11-10T00:52:14Z</published>
	<updated>2009-11-10T00:52:14Z</updated>
	<author>
		<name>Christian Helmbold-2</name>
	</author>
	<content type="html">Dave, you and Stephan are right. My API doesn't add much value to the
&lt;br&gt;original API but brings new trouble (as Stephan showed). This API was
&lt;br&gt;only my first thought.
&lt;br&gt;&lt;br&gt;How would the Servlet API look like if it would be rewritten from scratch in Scala?
&lt;br&gt;&lt;br&gt;Christian
&lt;br&gt;&lt;br&gt;__________________________________________________
&lt;br&gt;Do You Yahoo!?
&lt;br&gt;Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
&lt;br&gt;&lt;a href=&quot;http://mail.yahoo.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mail.yahoo.com&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Scala-Servlets-tp26272965p26280117.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26279533</id>
	<title>Re: [scala] A small change to compiler phases</title>
	<published>2009-11-09T23:48:19Z</published>
	<updated>2009-11-09T23:48:19Z</updated>
	<author>
		<name>Kevin Wright-4</name>
	</author>
	<content type="html">On Tue, Nov 10, 2009 at 6:07 AM, Stephen Haberman
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26279533&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;stephen@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I'd prefer an optional phase of &amp;quot;please typer don't complain I WILL
&lt;br&gt;&amp;gt;&amp;gt; fix this tree for you, but may ask you to run again, oh and on that
&lt;br&gt;&amp;gt;&amp;gt; second run could you please add the following synthetics in&amp;quot;. This
&lt;br&gt;&amp;gt;&amp;gt; would allow for the case where you need the type information from
&lt;br&gt;&amp;gt;&amp;gt; typers (as per my plugin) but would like to add synthetics.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Speaking with absolutely zero knowledge how of scala compiler plugins
&lt;br&gt;&amp;gt; work, this sounds vaguely like JDK6 annotation processors.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; E.g. I can manually write some code that depends on a non-existent
&lt;br&gt;&amp;gt; FooClass, and so fails to compile on the first round. But then the
&lt;br&gt;&amp;gt; javac compiler runs the annotation processor, which creates the
&lt;br&gt;&amp;gt; FooClass.java source, so the compiler starts a 2nd round to compile
&lt;br&gt;&amp;gt; FooClass.java -&amp;gt; FooClass.class. Having done that, the compiler then
&lt;br&gt;&amp;gt; re-compiles/fixes the &amp;quot;FooClass not found&amp;quot; error from the first round,
&lt;br&gt;&amp;gt; and everything is now fine.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; javac would even start up a 3rd round if the FooClass.java source that
&lt;br&gt;&amp;gt; the first annotation processor generated happened to have annotations
&lt;br&gt;&amp;gt; that triggered another annotation processor to generate yet more source
&lt;br&gt;&amp;gt; code. It keeps going until no more source files have been generated.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; No idea whether multiple rounds makes sense for scala compiler plugins,
&lt;br&gt;&amp;gt; but in my experience it has worked well for annotation processors.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; - Stephen
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;I can imagine something like this working for a range of issues:
&lt;br&gt;&lt;br&gt;- During typer, postpone the display of any error messages
&lt;br&gt;- Create an new phase typeSynthetics, immediately before superaccessors
&lt;br&gt;- A unit can be flagged for re-compilation by any phase before this
&lt;br&gt;&amp;nbsp; (so plugins would runAfter typer, but before typeSynthetics)
&lt;br&gt;- In typeSynthetics, reprocess (namer--&amp;gt;typeSynthetics) any flagged unit
&lt;br&gt;- Report any outstanding typer failures
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--A-small-change-to-compiler-phases-tp26268455p26279533.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26278768</id>
	<title>Re: [scala] A small change to compiler phases</title>
	<published>2009-11-09T22:07:03Z</published>
	<updated>2009-11-09T22:07:03Z</updated>
	<author>
		<name>Stephen Haberman</name>
	</author>
	<content type="html">&lt;br&gt;&amp;gt; I'd prefer an optional phase of &amp;quot;please typer don't complain I WILL
&lt;br&gt;&amp;gt; fix this tree for you, but may ask you to run again, oh and on that
&lt;br&gt;&amp;gt; second run could you please add the following synthetics in&amp;quot;. This
&lt;br&gt;&amp;gt; would allow for the case where you need the type information from
&lt;br&gt;&amp;gt; typers (as per my plugin) but would like to add synthetics.
&lt;br&gt;&lt;br&gt;Speaking with absolutely zero knowledge how of scala compiler plugins
&lt;br&gt;work, this sounds vaguely like JDK6 annotation processors.
&lt;br&gt;&lt;br&gt;E.g. I can manually write some code that depends on a non-existent
&lt;br&gt;FooClass, and so fails to compile on the first round. But then the
&lt;br&gt;javac compiler runs the annotation processor, which creates the
&lt;br&gt;FooClass.java source, so the compiler starts a 2nd round to compile
&lt;br&gt;FooClass.java -&amp;gt; FooClass.class. Having done that, the compiler then
&lt;br&gt;re-compiles/fixes the &amp;quot;FooClass not found&amp;quot; error from the first round,
&lt;br&gt;and everything is now fine.
&lt;br&gt;&lt;br&gt;javac would even start up a 3rd round if the FooClass.java source that
&lt;br&gt;the first annotation processor generated happened to have annotations
&lt;br&gt;that triggered another annotation processor to generate yet more source
&lt;br&gt;code. It keeps going until no more source files have been generated.
&lt;br&gt;&lt;br&gt;No idea whether multiple rounds makes sense for scala compiler plugins,
&lt;br&gt;but in my experience it has worked well for annotation processors.
&lt;br&gt;&lt;br&gt;- Stephen
&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--A-small-change-to-compiler-phases-tp26268455p26278768.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26278688</id>
	<title>Re: [scala] A small change to compiler phases</title>
	<published>2009-11-09T21:54:07Z</published>
	<updated>2009-11-09T21:54:07Z</updated>
	<author>
		<name>Chris Twiner</name>
	</author>
	<content type="html">On Mon, Nov 9, 2009 at 4:38 PM, Kevin Wright
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26278688&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kev.lee.wright@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; It seems that there's an important class of compiler plugins that
&lt;br&gt;&amp;gt; struggle under the current setup.
&lt;br&gt;&amp;gt; Specifically, those that generate entirely synthetic classes, or
&lt;br&gt;&amp;gt; synthetic methods on existing classes.
&lt;br&gt;&lt;br&gt;I have such a plugin and I am sure there are others.
&lt;br&gt;&lt;br&gt;&amp;gt; these generated constructs, there's nothing unusual in them) but the
&lt;br&gt;&amp;gt; tight coupling of the namer/typer phases prevents me from doing this.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Would it therefore be possible to have &amp;quot;typer runsAfter namer&amp;quot; instead
&lt;br&gt;&amp;gt; of &amp;quot;typer runsRightAfter namer&amp;quot; ?
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;Of course I realise this would be tough to do, but whilst we are
&lt;br&gt;asking for compiler changes...
&lt;br&gt;&lt;br&gt;I'd prefer an optional phase of &amp;quot;please typer don't complain I WILL
&lt;br&gt;fix this tree for you, but may ask you to run again, oh and on that
&lt;br&gt;second run could you please add the following synthetics in&amp;quot;. This
&lt;br&gt;would allow for the case where you need the type information from
&lt;br&gt;typers (as per my plugin) but would like to add synthetics.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--A-small-change-to-compiler-phases-tp26268455p26278688.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26275157</id>
	<title>Re: [scala] Scala Servlets</title>
	<published>2009-11-09T14:47:39Z</published>
	<updated>2009-11-09T14:47:39Z</updated>
	<author>
		<name>Dave  Griffith</name>
	</author>
	<content type="html">&lt;br&gt;Additional problems:
&lt;br&gt;&lt;br&gt;It keeps the return null if absent pattern of the original API, rather than wrapping with Option.
&lt;br&gt;&lt;br&gt;It keeps the ludicrous &amp;quot;two ways to ask for a session&amp;quot; from the original API. &amp;nbsp;It wasn't a particularly good design choice back in '97, but it's really dated now.
&lt;br&gt;&lt;br&gt;But the big failure is that it simply doesn't add much value. &amp;nbsp;Most of the really tedious operations on the Servlet API are still exactly as tedious. &amp;nbsp;Which is probably why I never use the Servlet API any more, and write service servlets using the JAX-RS API. &amp;nbsp; &amp;nbsp;Now a full featured Scala wrapper around those would be pretty sweet.
&lt;br&gt;&lt;br&gt;--Dave Griffith
&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Scala-Servlets-tp26272965p26275157.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26274469</id>
	<title>Re: [scala] Scala Servlets</title>
	<published>2009-11-09T13:59:33Z</published>
	<updated>2009-11-09T13:59:33Z</updated>
	<author>
		<name>Stepan Koltsov-5</name>
	</author>
	<content type="html">It is worse then original server API, because it wraps servlet API,
&lt;br&gt;and does not provide significant value.
&lt;br&gt;&lt;br&gt;&amp;gt; The main difference to Java Servlets is the way the response is returned:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; // Java
&lt;br&gt;&amp;gt; doGet(HttpServletRequest req, HttpServletResponse resp)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; // Scala
&lt;br&gt;&amp;gt; get(req: HttpServletRequest): HttpServletResponse
&lt;br&gt;&lt;br&gt;If you think it is a shortcoming, you shoud study servlets better.
&lt;br&gt;&lt;br&gt;def doGet(req, resp) = {
&lt;br&gt;&amp;nbsp; resp.addCookie(&amp;quot;zz&amp;quot;, &amp;quot;yy&amp;quot;)
&lt;br&gt;&amp;nbsp; req.getServletContext.getRequestDispatcher(&amp;quot;/another-url&amp;quot;).forward(req, resp)
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;is not possible in your API.
&lt;br&gt;&lt;br&gt;S.
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Mon, Nov 9, 2009 at 23:14, Christian Helmbold
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26274469&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;christian.helmbold@...&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; the Servlet API is perhaps the most popular Java EE API and
&lt;br&gt;&amp;gt; my idea is to make this API available as a Scala-like API. I published
&lt;br&gt;&amp;gt; my idea at &lt;a href=&quot;http://scala-forum.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://scala-forum.org/&lt;/a&gt;&amp;nbsp;and was asked to bring it to a wider audience (to this list).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The main difference to Java Servlets is the way the response is returned:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; // Java
&lt;br&gt;&amp;gt; doGet(HttpServletRequest req, HttpServletResponse resp)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; // Scala
&lt;br&gt;&amp;gt; get(req: HttpServletRequest): HttpServletResponse
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You can find a detailed description of the API at &lt;a href=&quot;http://scala-forum.org/read.php?4,687&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://scala-forum.org/read.php?4,687&lt;/a&gt;&amp;nbsp;.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; What do you think about it?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'd prefer answers there, but of corse answers are also welcome here.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards
&lt;br&gt;&amp;gt; Christian
&lt;br&gt;&amp;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/-scala--Scala-Servlets-tp26272965p26274469.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26272965</id>
	<title>[scala] Scala Servlets</title>
	<published>2009-11-09T12:14:42Z</published>
	<updated>2009-11-09T12:14:42Z</updated>
	<author>
		<name>Christian Helmbold-2</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;the Servlet API is perhaps the most popular Java EE API and
&lt;br&gt;my idea is to make this API available as a Scala-like API. I published
&lt;br&gt;my idea at &lt;a href=&quot;http://scala-forum.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://scala-forum.org/&lt;/a&gt;&amp;nbsp;and was asked to bring it to a wider audience (to this list).
&lt;br&gt;&lt;br&gt;The main difference to Java Servlets is the way the response is returned:
&lt;br&gt;&lt;br&gt;// Java
&lt;br&gt;doGet(HttpServletRequest req, HttpServletResponse resp)
&lt;br&gt;&lt;br&gt;// Scala
&lt;br&gt;get(req: HttpServletRequest): HttpServletResponse
&lt;br&gt;&lt;br&gt;You can find a detailed description of the API at &lt;a href=&quot;http://scala-forum.org/read.php?4,687&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://scala-forum.org/read.php?4,687&lt;/a&gt;&amp;nbsp;. 
&lt;br&gt;&lt;br&gt;What do you think about it?
&lt;br&gt;&lt;br&gt;I'd prefer answers there, but of corse answers are also welcome here.
&lt;br&gt;&lt;br&gt;Regards
&lt;br&gt;Christian
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Scala-Servlets-tp26272965p26272965.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26272327</id>
	<title>[scala] nominal versus positional access</title>
	<published>2009-11-09T11:33:03Z</published>
	<updated>2009-11-09T11:33:03Z</updated>
	<author>
		<name>Meredith Gregory</name>
	</author>
	<content type="html">Dear Scalarazzi,&lt;br&gt;&lt;br&gt;i noticed that you can use the derivative of data types to build a bridge between nominal and positional access. i&amp;#39;ve written about it &lt;a href=&quot;http://biosimilarity.blogspot.com/2009/11/bridge-between-nominal-and-positional.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. The kernel of the idea can be illustrated in two simple equations.&lt;br&gt;
&lt;br&gt;T[N] = N + [N =&amp;gt; T[N]] + T[N] x T[N]&lt;br&gt;N = ∂T[N]&lt;br&gt;&lt;br&gt;The first equation is a domain equation for the data type of lambda terms. The second equation says that names (aka variables) must be contexts in lambda terms. This leads to a whole host of interesting new questions. Further, the technique is quite general and applies to a wide range of situations, not just nominal presentations of computational calculi.&lt;br&gt;
&lt;br&gt;Best wishes,&lt;br&gt;&lt;br&gt;--greg&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;L.G. Meredith&lt;br&gt;Managing Partner&lt;br&gt;Biosimilarity LLC&lt;br&gt;1219 NW 83rd St &lt;br&gt;Seattle, WA 98117&lt;br&gt;&lt;br&gt;+1 206.650.3740&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://biosimilarity.blogspot.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://biosimilarity.blogspot.com&lt;/a&gt;&lt;br&gt;

</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--nominal-versus-positional-access-tp26272327p26272327.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26268455</id>
	<title>[scala] A small change to compiler phases</title>
	<published>2009-11-09T07:38:49Z</published>
	<updated>2009-11-09T07:38:49Z</updated>
	<author>
		<name>Kevin Wright-4</name>
	</author>
	<content type="html">It seems that there's an important class of compiler plugins that
&lt;br&gt;struggle under the current setup.
&lt;br&gt;Specifically, those that generate entirely synthetic classes, or
&lt;br&gt;synthetic methods on existing classes.
&lt;br&gt;&lt;br&gt;This is possible to do if no type or symbol information is needed by
&lt;br&gt;the plugin (it can run between parser and namer), but it's impossible
&lt;br&gt;to synthesise methods after the typer phase unless those methods are
&lt;br&gt;overrides, as any classes then trying to use these methods will
&lt;br&gt;already have failed to compile.
&lt;br&gt;&lt;br&gt;A quick look at the existing architecture shows how this issue is
&lt;br&gt;handled with other code already being synthesised by the compiler:
&lt;br&gt;&lt;br&gt;case classes: the companion object is generated in the namer. &amp;nbsp;In
&lt;br&gt;addition the generated hashCode and equals methods are overrides from
&lt;br&gt;the Any class
&lt;br&gt;@BeanProperty: synthesis is mostly in namer, with some support for
&lt;br&gt;setters in typer
&lt;br&gt;@specialized: after typer, but (crucially) the code is valid and
&lt;br&gt;type-checks before specialisation
&lt;br&gt;&lt;br&gt;It seems that the best place to handle a lot of synthesis is
&lt;br&gt;immediately before typer, but this option is not available to a plugin
&lt;br&gt;as typer is set runRightAfter namer.
&lt;br&gt;&lt;br&gt;I'm attempting to write a plugin that could very easily adopt a
&lt;br&gt;similar approach to @BeanProperty, and I'm able to synthesize the
&lt;br&gt;necessary entries in the AST with only symbol information (I'm
&lt;br&gt;perfectly happy to allow the typer to then do its normal thing on
&lt;br&gt;these generated constructs, there's nothing unusual in them) but the
&lt;br&gt;tight coupling of the namer/typer phases prevents me from doing this.
&lt;br&gt;&lt;br&gt;Would it therefore be possible to have &amp;quot;typer runsAfter namer&amp;quot; instead
&lt;br&gt;of &amp;quot;typer runsRightAfter namer&amp;quot; ?
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--A-small-change-to-compiler-phases-tp26268455p26268455.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26264525</id>
	<title>[scala]  Re: understanding generated bytecode</title>
	<published>2009-11-09T03:00:18Z</published>
	<updated>2009-11-09T03:00:18Z</updated>
	<author>
		<name>Miguel Garcia</name>
	</author>
	<content type="html">&lt;br&gt;Johannes,
&lt;br&gt;&lt;br&gt;Yes, javap and scalap show what's inside the generated .class files but 
&lt;br&gt;still I would prefer an IDE-level bytecode browser (with navigation, too?). 
&lt;br&gt;So I might settle on the Eclipse plugin for Soot, which can for example 
&lt;br&gt;display bytecode using the Grimp notation (well, the following screenshot 
&lt;br&gt;shows Jimple, but conveys the idea):
&lt;br&gt;&lt;a href=&quot;http://www.sable.mcgill.ca/soot/eclipse/ca.mcgill.sable.soot/doc/concepts/jimple_editor.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sable.mcgill.ca/soot/eclipse/ca.mcgill.sable.soot/doc/concepts/jimple_editor.html&lt;/a&gt;&lt;br&gt;unless someone suggests sthg better.
&lt;br&gt;&lt;br&gt;After getting an overview of some (not all :-) of the name mangling and 
&lt;br&gt;codegen patterns, I *would like* later to try some bytecode-level automatic 
&lt;br&gt;verfication techniques, e.g.
&lt;br&gt;&lt;a href=&quot;http://www-sop.inria.fr/everest/BML/Introduction.html#Introduction&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www-sop.inria.fr/everest/BML/Introduction.html#Introduction&lt;/a&gt;&lt;br&gt;or the aforementioned Findbugs.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Miguel
&lt;br&gt;&lt;a href=&quot;http://www.sts.tu-harburg.de/people/mi.garcia&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sts.tu-harburg.de/people/mi.garcia&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala---understanding-generated-bytecode-tp26264005p26264525.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26264388</id>
	<title>Re: [scala] Re: recent changes in 2.8 nightly classpath management</title>
	<published>2009-11-09T02:52:55Z</published>
	<updated>2009-11-09T02:52:55Z</updated>
	<author>
		<name>Lukas Rytz</name>
	</author>
	<content type="html">Hello Daniel, Eric&lt;br&gt;&lt;br&gt;this behavior is expected, there was a change in the way the &amp;quot;classpath&amp;quot; setting is defined.&lt;br&gt;&lt;br&gt;Before, the value of &amp;quot;-classpath&amp;quot; was defined by:&lt;br&gt; 1) the user-specified value (&amp;quot;-classpath x&amp;quot;), or else&lt;br&gt;
 2) the value of the &amp;quot;CLASSPATH&amp;quot; environment variable, or else&lt;br&gt; 3) the value of the java property &amp;quot;&lt;span&gt;java.class.path&amp;quot;, which is the &amp;quot;-classpath x&amp;quot; given to the java command, or else&lt;br&gt;
 4) the current directroy.&lt;br&gt;&lt;br&gt;&lt;br&gt;We decided to remove 3) as this can put unexpected things on scalac&amp;#39;s classpath.&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://lampsvn.epfl.ch/trac/scala/changeset/19285/scala/trunk/src/compiler/scala/tools/nsc/Settings.scala&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lampsvn.epfl.ch/trac/scala/changeset/19285/scala/trunk/src/compiler/scala/tools/nsc/Settings.scala&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;You can make the example below work by adding&lt;br&gt;&lt;br&gt;       settings.classpath.value = System.getProperty(&amp;quot;java.class.path&amp;quot;)&lt;br&gt;&lt;br&gt;  &lt;br&gt;&lt;/span&gt;&lt;br&gt;Cheers: Lukas&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;
On Mon, Nov 9, 2009 at 00:15, 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=26264388&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ewilligers@...&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;
I&amp;#39;ve been experiencing the same problem.&lt;br&gt;
&lt;br&gt;
Here&amp;#39;s an example that used to work:-&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
// Compile.scala&lt;br&gt;
&lt;br&gt;
import scala.tools.nsc.{Global, Settings}&lt;br&gt;
import scala.tools.nsc.reporters.ConsoleReporter&lt;br&gt;
&lt;br&gt;
object Compile&lt;br&gt;
{&lt;br&gt;
    def main(args: Array[String]): Unit =&lt;br&gt;
    {&lt;br&gt;
        val settings = new Settings()&lt;br&gt;
&lt;br&gt;
        settings.target.value = &amp;quot;jvm-1.5&amp;quot;&lt;br&gt;
        settings.deprecation.value = true // enable detailed deprecation warnings&lt;br&gt;
        settings.unchecked.value = true // enable detailed unchecked warnings&lt;br&gt;
        settings.outdir.value = &amp;quot;.&amp;quot;&lt;br&gt;
        val reporter = new ConsoleReporter(settings)&lt;br&gt;
&lt;br&gt;
        val compiler = new Global(settings, reporter)&lt;br&gt;
        val run = (new compiler.Run)&lt;br&gt;
        run.compile(List(&amp;quot;Test.scala&amp;quot;))&lt;br&gt;
&lt;br&gt;
        reporter.printSummary&lt;br&gt;
        if (reporter.hasErrors || reporter.WARNING.count &amp;gt; 0)&lt;br&gt;
        {&lt;br&gt;
            error(&amp;quot;Errors or warnings detecting during compile&amp;quot;)&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
touch Test.scala&lt;br&gt;
&lt;br&gt;
rm -f *.class&lt;br&gt;
2.8.0.r18678-b20090910020815/bin/scalac Compile.scala&lt;br&gt;
java -cp &amp;quot;2.8.0.r18678-b20090910020815\lib\scala-library.jar;2.8.0.r18678-b20090910020815\lib\scala-compiler.jar;.&amp;quot; Compile&lt;br&gt;
  (success)&lt;br&gt;
&lt;br&gt;
rm -f *.class&lt;br&gt;
2.8.0.r19410-b20091106023416/bin/scalac Compile.scala&lt;br&gt;
java -cp &amp;quot;2.8.0.r19410-b20091106023416\lib\scala-library.jar;2.8.0.r19410-b20091106023416\lib\scala-compiler.jar;.&amp;quot; Compile&lt;br&gt;
  Exception in thread &amp;quot;main&amp;quot; scala.tools.nsc.MissingRequirementError:&lt;br&gt;
  object scala not found.&lt;br&gt;
&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/-scala--recent-changes-in-2.8-nightly-classpath-management-tp26233977p26264388.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26264263</id>
	<title>Re: [scala] understanding generated bytecode</title>
	<published>2009-11-09T02:41:03Z</published>
	<updated>2009-11-09T02:41:03Z</updated>
	<author>
		<name>Johannes Rudolph-2</name>
	</author>
	<content type="html">On Mon, Nov 9, 2009 at 11:21 AM, Miguel Garcia &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26264263&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;miguel.garcia@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; I've been exploring what the nsc generated bytecode looks like, using the
&lt;br&gt;&amp;gt; following decompiler
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  McGill's &amp;quot;Dava&amp;quot; Java Decompiler &lt;a href=&quot;http://www.sable.mcgill.ca/dava/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sable.mcgill.ca/dava/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; One of the explicit goals of Dava is to generate compilable Java from
&lt;br&gt;&amp;gt; non-Java bytecode (that's the idea).
&lt;br&gt;&amp;gt; Some things work and others don't. Has anybody tried other ways to get a
&lt;br&gt;&amp;gt; high-level view of nsc-generated bytecode?
&lt;br&gt;&lt;br&gt;You can use scalac -Xprint:&amp;lt;phase&amp;gt; to get an idea of what scalac is
&lt;br&gt;doing. Especially using -Xprint:jvm should give something very close
&lt;br&gt;to bytecodes. Low-level inspection tools are javap and scalap (though,
&lt;br&gt;I don't know what the latter one does exactly. IMO it just prints the
&lt;br&gt;serialized scala signatures).
&lt;br&gt;&lt;br&gt;What do you expect from a high-level view of bytecodes?
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Johannes
&lt;br&gt;&lt;br&gt;-----------------------------------------------
&lt;br&gt;Johannes Rudolph
&lt;br&gt;&lt;a href=&quot;http://virtual-void.net&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://virtual-void.net&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala---understanding-generated-bytecode-tp26264005p26264263.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26264005</id>
	<title>[scala]  understanding generated bytecode</title>
	<published>2009-11-09T02:21:03Z</published>
	<updated>2009-11-09T02:21:03Z</updated>
	<author>
		<name>Miguel Garcia</name>
	</author>
	<content type="html">&lt;br&gt;Hi,
&lt;br&gt;&lt;br&gt;I've been exploring what the nsc generated bytecode looks like, using the 
&lt;br&gt;following decompiler
&lt;br&gt;&lt;br&gt;&amp;nbsp; McGill's &amp;quot;Dava&amp;quot; Java Decompiler &lt;a href=&quot;http://www.sable.mcgill.ca/dava/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sable.mcgill.ca/dava/&lt;/a&gt;&lt;br&gt;&lt;br&gt;One of the explicit goals of Dava is to generate compilable Java from 
&lt;br&gt;non-Java bytecode (that's the idea).
&lt;br&gt;Some things work and others don't. Has anybody tried other ways to get a 
&lt;br&gt;high-level view of nsc-generated bytecode?
&lt;br&gt;Soot itself provides bytecode-level languages (Grimp in particular), 
&lt;br&gt;comments on that are also welcome.
&lt;br&gt;&lt;br&gt;Somewhat related to the above, there's an enhancement ticket:
&lt;br&gt;FindBugs should be run during nightly tests, 
&lt;br&gt;&lt;a href=&quot;http://lampsvn.epfl.ch/trac/scala/ticket/571&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lampsvn.epfl.ch/trac/scala/ticket/571&lt;/a&gt;&lt;br&gt;Experience reports on that would also be welcome :-)
&lt;br&gt;&lt;br&gt;&lt;br&gt;Miguel
&lt;br&gt;&lt;a href=&quot;http://www.sts.tu-harburg.de/people/mi.garcia&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sts.tu-harburg.de/people/mi.garcia&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala---understanding-generated-bytecode-tp26264005p26264005.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26262124</id>
	<title>Re: [scala] Using generalised type constraints in 2.8 collections</title>
	<published>2009-11-08T23:15:33Z</published>
	<updated>2009-11-08T23:15:33Z</updated>
	<author>
		<name>_retronym</name>
	</author>
	<content type="html">Sorry, hit send too soon. Here&amp;#39;s working code:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://gist.github.com/229756&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/229756&lt;/a&gt;&lt;br&gt;&lt;br&gt;sealed abstract class &amp;lt;:&amp;lt;[-From, +To] extends (From =&amp;gt; To)&lt;br&gt;object &amp;lt;:&amp;lt; {&lt;br&gt;
  implicit def conforms[A]: A &amp;lt;:&amp;lt; A = new (A &amp;lt;:&amp;lt; A) {def apply(x: A) = x}&lt;br&gt;}&lt;br&gt;&lt;br&gt;sealed abstract class ==[From, To] extends (From =&amp;gt; To)&lt;br&gt;object == {&lt;br&gt;  implicit def tpEquals[A]: A == A = new (A == A) {def apply(x: A) = x}&lt;br&gt;
}&lt;br&gt;&lt;br&gt;sealed abstract class &amp;lt;%&amp;lt;[-From, +To] extends (From =&amp;gt; To)&lt;br&gt;object &amp;lt;%&amp;lt; {&lt;br&gt;  implicit def conformsOrViewsAs[A &amp;lt;% B, B]: A &amp;lt;%&amp;lt; B = new (A &amp;lt;%&amp;lt; B) {def apply(x: A) = x}&lt;br&gt;}&lt;br&gt;&lt;br&gt;trait A&lt;br&gt;
trait B&lt;br&gt;implicit def AToB(a: A): B = new B {}&lt;br&gt;&lt;br&gt;println(implicitly[Int == Int], implicitly[Int &amp;lt;:&amp;lt; Any], implicitly[A &amp;lt;%&amp;lt; B])&lt;br&gt;&lt;br&gt;//object Predef {&lt;br&gt;  implicit def identity[A](a: A): A = a&lt;br&gt;//}&lt;br&gt;
&lt;br&gt;println((implicitly[Int =&amp;gt; Int], implicitly[Int =&amp;gt; Any]))&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Nov 9, 2009 at 8:02 AM, Jason Zaugg &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26262124&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jzaugg@...&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;It occurs to me that defining implicits to generate &amp;lt;:&amp;lt;, &amp;lt;%&amp;lt; and == in Predef would lead to ambiguity if you required A =&amp;gt; B. So &amp;lt;%&amp;lt; and == should be defined on the companion objects:&lt;/blockquote&gt;
&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Using-generalised-type-constraints-in-2.8-collections-tp26249516p26262124.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26262023</id>
	<title>Re: [scala] Using generalised type constraints in 2.8 collections</title>
	<published>2009-11-08T23:02:51Z</published>
	<updated>2009-11-08T23:02:51Z</updated>
	<author>
		<name>_retronym</name>
	</author>
	<content type="html">It occurs to me that defining implicits to generate &amp;lt;:&amp;lt;, &amp;lt;%&amp;lt; and == in Predef would lead to ambiguity if you required A =&amp;gt; B. So &amp;lt;%&amp;lt; and == should be defined on the companion objects:&lt;br&gt;&lt;br&gt;sealed abstract class &amp;lt;:&amp;lt;[-From, +To] extends (From =&amp;gt; To)&lt;br&gt;
object &amp;lt;:&amp;lt; { &lt;br&gt;implicit def conforms[A]: A &amp;lt;:&amp;lt; A = new (A &amp;lt;:&amp;lt; A) {def apply(x: A) = x} }&lt;br&gt;&lt;br&gt;&lt;br&gt;sealed abstract class =:=[A, B]&lt;br&gt;&lt;div&gt;object =:= {&lt;/div&gt;
&lt;div&gt;  implicit def tpEq[A]: A =:= A = new (A =:= A) { def apply(a: A): A = a }&lt;br&gt;&lt;/div&gt;
&lt;div&gt;}&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;div&gt;sealed abstract class &amp;lt;%&amp;lt;[A, B]&lt;br&gt;object &amp;lt;%&amp;lt; {&lt;/div&gt;
&lt;div&gt;  implicit def tpView[A &amp;lt;% B, B]: A &amp;lt;%&amp;lt; B = new (A &amp;lt;%&amp;lt; B) { def apply(a: A): B = a }&lt;br&gt;&lt;/div&gt;
&lt;div&gt;}&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sun, Nov 8, 2009 at 9:50 PM, Jason Zaugg &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26262023&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jzaugg@...&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;
In general, the flexibility to choose &amp;lt;:&amp;lt; or &amp;lt;%&amp;lt; would be
useful. The former ought to be the default choice for a type-fearing API designer, but consideration of backwards compatibility and flexibility could swing the decision other way.
I guess you could even sit on the fence, make the type abstract and let
the user decide :)&lt;br&gt;
&lt;br&gt;
For completeness, perhaps ==[A, B] should be included: &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.scala.user/18879&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://article.gmane.org/gmane.comp.lang.scala.user/18879&lt;/a&gt;&lt;br&gt;

&lt;br&gt;

In this particular case, I would find one of the following more intention revealing.&lt;br&gt;
&lt;br&gt;

  List(Some(1), None).filterMap { case Some(x) =&amp;gt; x }&lt;br&gt;

&lt;br&gt;

Which perhaps warrants its own function:&lt;br&gt;

&lt;br&gt;
  Option.somes(List(Some(5), None))&lt;br&gt;
&lt;br&gt;
or, granting Option  a(nother) ticket into TraversibleLike:&lt;br&gt;
&lt;br&gt;
  List(Some(5), None).somes&lt;br&gt;&lt;font color=&quot;#888888&quot;&gt;
&lt;br&gt;

-jason&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sun, Nov 8, 2009 at 9:47 PM, Viktor Klang &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26262023&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;viktor.klang@...&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;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sun, Nov 8, 2009 at 9:02 PM, Adriaan Moors &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26262023&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;adriaan.moors@...&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;
good point. it&amp;#39;s a tricky design decision -- do we want subtyping or convertibility?&lt;div&gt;we could introduce &amp;lt;?&amp;lt; (or something better ascii-art welcome), but I&amp;#39;m definitely against going back to =&amp;gt;, as it conflates views and bounds (as witnessed by implicit values)&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;?&amp;lt; would include &amp;lt;:&amp;lt;, as well as conversions such Option[A] &amp;lt;?&amp;lt; Traversable[A]&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&amp;lt;%&amp;lt; ?&lt;br&gt; &lt;/div&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;&lt;br&gt;&lt;/div&gt;&lt;div&gt;adriaan&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;On Sun, Nov 8, 2009 at 8:45 PM, Paul Phillips &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26262023&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paulp@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;




&lt;/div&gt;&lt;/div&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;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;On Sun, Nov 08, 2009 at 07:40:05PM +0100, Adriaan Moors wrote:&lt;br&gt;



&amp;gt; &amp;gt;  def flatten[B](implicit asTraversable: A =&amp;gt; /*&amp;lt;:&amp;lt;!!!*/ Traversable[B]):&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&lt;/div&gt;&lt;div&gt;&amp;gt; it didn&amp;#39;t work back then because there were some subtleties with the&lt;br&gt;
&amp;gt; coup d&amp;#39;état that removed identity from its implicit pedestal in&lt;br&gt;
&amp;gt; favour of &amp;lt;:&amp;lt; (bootstrapping issues, as you might imagine).&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;Hmmm.  Such a definition excludes Option, which is as we know too well&lt;br&gt;
not actually a Traversable, but converts to one.&lt;br&gt;
&lt;br&gt;
So my oft-used List(Some(5), None).flatten no longer compiles.&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
--&lt;br&gt;
Paul Phillips      | A national political campaign is better than the&lt;br&gt;
Apatheist          | best circus ever heard of, with a mass baptism and&lt;br&gt;
Empiricist         | a couple of hangings thrown in.&lt;br&gt;
pal, i pill push   |     -- H. L. Mencken&lt;br&gt;
&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;
&lt;br&gt;
Disclaimer: &lt;a href=&quot;http://www.kuleuven.be/cwis/email_disclaimer.htm&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.kuleuven.be/cwis/email_disclaimer.htm&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;-- &lt;br&gt;Viktor Klang&lt;br&gt;| &amp;quot;A complex system that works is invariably &lt;br&gt;| found to have evolved from a simple system &lt;br&gt;| that worked.&amp;quot; - John Gall&lt;br&gt;&lt;br&gt;

Blog: &lt;a href=&quot;http://klangism.blogspot.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;klangism.blogspot.com&lt;/a&gt;&lt;br&gt;
Twttr: &lt;a href=&quot;http://twitter.com/viktorklang&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;twitter.com/viktorklang&lt;/a&gt;&lt;br&gt;Code: &lt;a href=&quot;http://github.com/viktorklang&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;github.com/viktorklang&lt;/a&gt;&lt;br&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/-scala--Using-generalised-type-constraints-in-2.8-collections-tp26249516p26262023.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26259118</id>
	<title>[scala]  Re: recent changes in 2.8 nightly classpath management</title>
	<published>2009-11-08T15:15:28Z</published>
	<updated>2009-11-08T15:15:28Z</updated>
	<author>
		<name>Eric Willigers</name>
	</author>
	<content type="html">I've been experiencing the same problem.
&lt;br&gt;&lt;br&gt;Here's an example that used to work:-
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;// Compile.scala
&lt;br&gt;&lt;br&gt;import scala.tools.nsc.{Global, Settings}
&lt;br&gt;import scala.tools.nsc.reporters.ConsoleReporter
&lt;br&gt;&lt;br&gt;object Compile
&lt;br&gt;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;def main(args: Array[String]): Unit =
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;val settings = new Settings()
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;settings.target.value = &amp;quot;jvm-1.5&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;settings.deprecation.value = true // enable detailed 
&lt;br&gt;deprecation warnings
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;settings.unchecked.value = true // enable detailed unchecked 
&lt;br&gt;warnings
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;settings.outdir.value = &amp;quot;.&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;val reporter = new ConsoleReporter(settings)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;val compiler = new Global(settings, reporter)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;val run = (new compiler.Run)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;run.compile(List(&amp;quot;Test.scala&amp;quot;))
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;reporter.printSummary
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (reporter.hasErrors || reporter.WARNING.count &amp;gt; 0)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;error(&amp;quot;Errors or warnings detecting during compile&amp;quot;)
&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;touch Test.scala
&lt;br&gt;&lt;br&gt;rm -f *.class
&lt;br&gt;2.8.0.r18678-b20090910020815/bin/scalac Compile.scala
&lt;br&gt;java -cp 
&lt;br&gt;&amp;quot;2.8.0.r18678-b20090910020815\lib\scala-library.jar;2.8.0.r18678-b20090910020815\lib\scala-compiler.jar;.&amp;quot; 
&lt;br&gt;Compile
&lt;br&gt;&amp;nbsp; &amp;nbsp;(success)
&lt;br&gt;&lt;br&gt;rm -f *.class
&lt;br&gt;2.8.0.r19410-b20091106023416/bin/scalac Compile.scala
&lt;br&gt;java -cp 
&lt;br&gt;&amp;quot;2.8.0.r19410-b20091106023416\lib\scala-library.jar;2.8.0.r19410-b20091106023416\lib\scala-compiler.jar;.&amp;quot; 
&lt;br&gt;Compile
&lt;br&gt;&amp;nbsp; &amp;nbsp;Exception in thread &amp;quot;main&amp;quot; scala.tools.nsc.MissingRequirementError:
&lt;br&gt;&amp;nbsp; &amp;nbsp;object scala not found.
&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--recent-changes-in-2.8-nightly-classpath-management-tp26233977p26259118.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26257824</id>
	<title>Re: [scala] Using generalised type constraints in 2.8 collections</title>
	<published>2009-11-08T12:50:16Z</published>
	<updated>2009-11-08T12:50:16Z</updated>
	<author>
		<name>_retronym</name>
	</author>
	<content type="html">In general, the flexibility to choose &amp;lt;:&amp;lt; or &amp;lt;%&amp;lt; would be
useful. The former ought to be the default choice for a type-fearing API designer, but consideration of backwards compatibility and flexibility could swing the decision other way.
I guess you could even sit on the fence, make the type abstract and let
the user decide :)&lt;br&gt;
&lt;br&gt;
For completeness, perhaps ==[A, B] should be included: &lt;a href=&quot;http://article.gmane.org/gmane.comp.lang.scala.user/18879&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://article.gmane.org/gmane.comp.lang.scala.user/18879&lt;/a&gt;&lt;br&gt;

&lt;br&gt;

In this particular case, I would find one of the following more intention revealing.&lt;br&gt;
&lt;br&gt;

  List(Some(1), None).filterMap { case Some(x) =&amp;gt; x }&lt;br&gt;

&lt;br&gt;

Which perhaps warrants its own function:&lt;br&gt;

&lt;br&gt;
  Option.somes(List(Some(5), None))&lt;br&gt;
&lt;br&gt;
or, granting Option  a(nother) ticket into TraversibleLike:&lt;br&gt;
&lt;br&gt;
  List(Some(5), None).somes&lt;br&gt;
&lt;br&gt;

-jason&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sun, Nov 8, 2009 at 9:47 PM, Viktor Klang &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26257824&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;viktor.klang@...&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;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sun, Nov 8, 2009 at 9:02 PM, Adriaan Moors &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26257824&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;adriaan.moors@...&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;
good point. it&amp;#39;s a tricky design decision -- do we want subtyping or convertibility?&lt;div&gt;we could introduce &amp;lt;?&amp;lt; (or something better ascii-art welcome), but I&amp;#39;m definitely against going back to =&amp;gt;, as it conflates views and bounds (as witnessed by implicit values)&lt;/div&gt;



&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;?&amp;lt; would include &amp;lt;:&amp;lt;, as well as conversions such Option[A] &amp;lt;?&amp;lt; Traversable[A]&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&amp;lt;%&amp;lt; ?&lt;br&gt; &lt;/div&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;&lt;br&gt;&lt;/div&gt;&lt;div&gt;adriaan&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;On Sun, Nov 8, 2009 at 8:45 PM, Paul Phillips &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26257824&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paulp@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;



&lt;/div&gt;&lt;/div&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;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;On Sun, Nov 08, 2009 at 07:40:05PM +0100, Adriaan Moors wrote:&lt;br&gt;


&amp;gt; &amp;gt;  def flatten[B](implicit asTraversable: A =&amp;gt; /*&amp;lt;:&amp;lt;!!!*/ Traversable[B]):&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&lt;/div&gt;&lt;div&gt;&amp;gt; it didn&amp;#39;t work back then because there were some subtleties with the&lt;br&gt;
&amp;gt; coup d&amp;#39;état that removed identity from its implicit pedestal in&lt;br&gt;
&amp;gt; favour of &amp;lt;:&amp;lt; (bootstrapping issues, as you might imagine).&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;Hmmm.  Such a definition excludes Option, which is as we know too well&lt;br&gt;
not actually a Traversable, but converts to one.&lt;br&gt;
&lt;br&gt;
So my oft-used List(Some(5), None).flatten no longer compiles.&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
--&lt;br&gt;
Paul Phillips      | A national political campaign is better than the&lt;br&gt;
Apatheist          | best circus ever heard of, with a mass baptism and&lt;br&gt;
Empiricist         | a couple of hangings thrown in.&lt;br&gt;
pal, i pill push   |     -- H. L. Mencken&lt;br&gt;
&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;
&lt;br&gt;
Disclaimer: &lt;a href=&quot;http://www.kuleuven.be/cwis/email_disclaimer.htm&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.kuleuven.be/cwis/email_disclaimer.htm&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;-- &lt;br&gt;Viktor Klang&lt;br&gt;| &amp;quot;A complex system that works is invariably &lt;br&gt;| found to have evolved from a simple system &lt;br&gt;| that worked.&amp;quot; - John Gall&lt;br&gt;&lt;br&gt;
Blog: &lt;a href=&quot;http://klangism.blogspot.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;klangism.blogspot.com&lt;/a&gt;&lt;br&gt;
Twttr: &lt;a href=&quot;http://twitter.com/viktorklang&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;twitter.com/viktorklang&lt;/a&gt;&lt;br&gt;Code: &lt;a href=&quot;http://github.com/viktorklang&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;github.com/viktorklang&lt;/a&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/-scala--Using-generalised-type-constraints-in-2.8-collections-tp26249516p26257824.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26257791</id>
	<title>Re: [scala] Using generalised type constraints in 2.8 collections</title>
	<published>2009-11-08T12:47:04Z</published>
	<updated>2009-11-08T12:47:04Z</updated>
	<author>
		<name>Viktor Klang</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sun, Nov 8, 2009 at 9:02 PM, Adriaan Moors &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26257791&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;adriaan.moors@...&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;
good point. it&amp;#39;s a tricky design decision -- do we want subtyping or convertibility?&lt;div&gt;we could introduce &amp;lt;?&amp;lt; (or something better ascii-art welcome), but I&amp;#39;m definitely against going back to =&amp;gt;, as it conflates views and bounds (as witnessed by implicit values)&lt;/div&gt;


&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;?&amp;lt; would include &amp;lt;:&amp;lt;, as well as conversions such Option[A] &amp;lt;?&amp;lt; Traversable[A]&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&amp;lt;%&amp;lt; ?&lt;br&gt; &lt;/div&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;&lt;br&gt;&lt;/div&gt;&lt;div&gt;adriaan&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;On Sun, Nov 8, 2009 at 8:45 PM, Paul Phillips &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26257791&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paulp@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;


&lt;/div&gt;&lt;/div&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;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;div&gt;On Sun, Nov 08, 2009 at 07:40:05PM +0100, Adriaan Moors wrote:&lt;br&gt;

&amp;gt; &amp;gt;  def flatten[B](implicit asTraversable: A =&amp;gt; /*&amp;lt;:&amp;lt;!!!*/ Traversable[B]):&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&lt;/div&gt;&lt;div&gt;&amp;gt; it didn&amp;#39;t work back then because there were some subtleties with the&lt;br&gt;
&amp;gt; coup d&amp;#39;état that removed identity from its implicit pedestal in&lt;br&gt;
&amp;gt; favour of &amp;lt;:&amp;lt; (bootstrapping issues, as you might imagine).&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;Hmmm.  Such a definition excludes Option, which is as we know too well&lt;br&gt;
not actually a Traversable, but converts to one.&lt;br&gt;
&lt;br&gt;
So my oft-used List(Some(5), None).flatten no longer compiles.&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
--&lt;br&gt;
Paul Phillips      | A national political campaign is better than the&lt;br&gt;
Apatheist          | best circus ever heard of, with a mass baptism and&lt;br&gt;
Empiricist         | a couple of hangings thrown in.&lt;br&gt;
pal, i pill push   |     -- H. L. Mencken&lt;br&gt;
&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;
&lt;br&gt;
Disclaimer: &lt;a href=&quot;http://www.kuleuven.be/cwis/email_disclaimer.htm&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.kuleuven.be/cwis/email_disclaimer.htm&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;Viktor Klang&lt;br&gt;| &amp;quot;A complex system that works is invariably &lt;br&gt;| found to have evolved from a simple system &lt;br&gt;| that worked.&amp;quot; - John Gall&lt;br&gt;&lt;br&gt;Blog: &lt;a href=&quot;http://klangism.blogspot.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;klangism.blogspot.com&lt;/a&gt;&lt;br&gt;
Twttr: &lt;a href=&quot;http://twitter.com/viktorklang&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;twitter.com/viktorklang&lt;/a&gt;&lt;br&gt;Code: &lt;a href=&quot;http://github.com/viktorklang&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;github.com/viktorklang&lt;/a&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Using-generalised-type-constraints-in-2.8-collections-tp26249516p26257791.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26257356</id>
	<title>Re: [scala] Using generalised type constraints in 2.8 collections</title>
	<published>2009-11-08T12:02:32Z</published>
	<updated>2009-11-08T12:02:32Z</updated>
	<author>
		<name>Adriaan Moors-2</name>
	</author>
	<content type="html">good point. it&amp;#39;s a tricky design decision -- do we want subtyping or convertibility?&lt;div&gt;we could introduce &amp;lt;?&amp;lt; (or something better ascii-art welcome), but I&amp;#39;m definitely against going back to =&amp;gt;, as it conflates views and bounds (as witnessed by implicit values)&lt;/div&gt;

&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;?&amp;lt; would include &amp;lt;:&amp;lt;, as well as conversions such Option[A] &amp;lt;?&amp;lt; Traversable[A]&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;adriaan&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sun, Nov 8, 2009 at 8:45 PM, Paul Phillips &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26257356&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paulp@...&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;div class=&quot;im&quot;&gt;On Sun, Nov 08, 2009 at 07:40:05PM +0100, Adriaan Moors wrote:&lt;br&gt;
&amp;gt; &amp;gt;  def flatten[B](implicit asTraversable: A =&amp;gt; /*&amp;lt;:&amp;lt;!!!*/ Traversable[B]):&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&lt;/div&gt;&lt;div class=&quot;im&quot;&gt;&amp;gt; it didn&amp;#39;t work back then because there were some subtleties with the&lt;br&gt;
&amp;gt; coup d&amp;#39;état that removed identity from its implicit pedestal in&lt;br&gt;
&amp;gt; favour of &amp;lt;:&amp;lt; (bootstrapping issues, as you might imagine).&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;Hmmm.  Such a definition excludes Option, which is as we know too well&lt;br&gt;
not actually a Traversable, but converts to one.&lt;br&gt;
&lt;br&gt;
So my oft-used List(Some(5), None).flatten no longer compiles.&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
--&lt;br&gt;
Paul Phillips      | A national political campaign is better than the&lt;br&gt;
Apatheist          | best circus ever heard of, with a mass baptism and&lt;br&gt;
Empiricist         | a couple of hangings thrown in.&lt;br&gt;
pal, i pill push   |     -- H. L. Mencken&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
&lt;br&gt;
Disclaimer: &lt;a href=&quot;http://www.kuleuven.be/cwis/email_disclaimer.htm&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.kuleuven.be/cwis/email_disclaimer.htm&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Using-generalised-type-constraints-in-2.8-collections-tp26249516p26257356.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26257204</id>
	<title>Re: [scala] Using generalised type constraints in 2.8 collections</title>
	<published>2009-11-08T11:45:23Z</published>
	<updated>2009-11-08T11:45:23Z</updated>
	<author>
		<name>Paul Phillips-3</name>
	</author>
	<content type="html">On Sun, Nov 08, 2009 at 07:40:05PM +0100, Adriaan Moors wrote:
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp;def flatten[B](implicit asTraversable: A =&amp;gt; /*&amp;lt;:&amp;lt;!!!*/ Traversable[B]):
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; it didn't work back then because there were some subtleties with the 
&lt;br&gt;&amp;gt; coup d'état that removed identity from its implicit pedestal in 
&lt;br&gt;&amp;gt; favour of &amp;lt;:&amp;lt; (bootstrapping issues, as you might imagine).
&lt;br&gt;&lt;br&gt;Hmmm. &amp;nbsp;Such a definition excludes Option, which is as we know too well 
&lt;br&gt;not actually a Traversable, but converts to one.
&lt;br&gt;&lt;br&gt;So my oft-used List(Some(5), None).flatten no longer compiles.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Paul Phillips &amp;nbsp; &amp;nbsp; &amp;nbsp;| A national political campaign is better than the
&lt;br&gt;Apatheist &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| best circus ever heard of, with a mass baptism and
&lt;br&gt;Empiricist &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | a couple of hangings thrown in. 
&lt;br&gt;pal, i pill push &amp;nbsp; | &amp;nbsp; &amp;nbsp; -- H. L. Mencken
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Using-generalised-type-constraints-in-2.8-collections-tp26249516p26257204.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26256560</id>
	<title>Re: [scala] Using generalised type constraints in 2.8 collections</title>
	<published>2009-11-08T10:40:05Z</published>
	<updated>2009-11-08T10:40:05Z</updated>
	<author>
		<name>Adriaan Moors-2</name>
	</author>
	<content type="html">&lt;div class=&quot;gmail_quote&quot;&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;I&amp;#39;m sure you&amp;#39;ll both notice if you haven&amp;#39;t already that the current type&lt;br&gt;
signature of flatten is:&lt;br&gt;
&lt;br&gt;
  def flatten[B](implicit asTraversable: A =&amp;gt; /*&amp;lt;:&amp;lt;!!!*/ Traversable[B]): CC[B] = {&lt;br&gt;
&lt;br&gt;
which has that definite ring of &amp;quot;didn&amp;#39;t work for some reason.&amp;quot;&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;it didn&amp;#39;t work back then because there were some subtleties with the coup d&amp;#39;état that removed identity from its implicit pedestal in favour of &amp;lt;:&amp;lt; (bootstrapping issues, as you might imagine). &lt;/div&gt;

&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;That&amp;#39;s history now, so nothing (should be) stopping you (or me, of course) from doing the obvious search/replace.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;adriaan&lt;/div&gt;&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Using-generalised-type-constraints-in-2.8-collections-tp26249516p26256560.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26256478</id>
	<title>Re: [scala] Using generalised type constraints in 2.8 collections</title>
	<published>2009-11-08T10:31:53Z</published>
	<updated>2009-11-08T10:31:53Z</updated>
	<author>
		<name>Paul Phillips-3</name>
	</author>
	<content type="html">On Sun, Nov 08, 2009 at 05:44:19PM +0100, Adriaan Moors wrote:
&lt;br&gt;&amp;gt; &amp;gt; - Should List.flatten be tightened to accept 'implicit ev: A &amp;lt;:&amp;lt;
&lt;br&gt;&amp;gt; &amp;gt; Iterable[B]' rather than 'implicit f : A =&amp;gt; Iterable[B]'?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; nope! nail: meet hammer; hammer: meet flatten
&lt;br&gt;&lt;br&gt;I'm sure you'll both notice if you haven't already that the current type 
&lt;br&gt;signature of flatten is:
&lt;br&gt;&lt;br&gt;&amp;nbsp; def flatten[B](implicit asTraversable: A =&amp;gt; /*&amp;lt;:&amp;lt;!!!*/ Traversable[B]): CC[B] = {
&lt;br&gt;&lt;br&gt;which has that definite ring of &amp;quot;didn't work for some reason.&amp;quot;
&lt;br&gt;&lt;br&gt;To the question about what &amp;lt;:&amp;lt; enables, all kinds of goodness. &amp;nbsp;One that 
&lt;br&gt;I checked in not too long ago is on Either, which has long suffered from 
&lt;br&gt;having methods which conceptually belong on the instance having to be 
&lt;br&gt;defined on the object because the types could not be inferred.
&lt;br&gt;&lt;br&gt;For example:
&lt;br&gt;&lt;br&gt;scala&amp;gt; val x: Either[Either[Int, String], String] = Left(Right(&amp;quot;a&amp;quot;))
&lt;br&gt;x: Either[Either[Int,String],String] = Left(Right(a))
&lt;br&gt;&lt;br&gt;Without some means to limit the type of A &amp;quot;from the inside&amp;quot;, flattening 
&lt;br&gt;had to be done like this:
&lt;br&gt;&lt;br&gt;scala&amp;gt; Either.joinLeft(x)
&lt;br&gt;res1: Either[Int,String] = Right(a)
&lt;br&gt;&lt;br&gt;Now the method is on the instance:
&lt;br&gt;&lt;br&gt;scala&amp;gt; x.joinLeft
&lt;br&gt;res0: Either[Int,String] = Right(a)
&lt;br&gt;&lt;br&gt;With this signature:
&lt;br&gt;&lt;br&gt;&amp;nbsp; def joinLeft[A1 &amp;gt;: A, B1 &amp;gt;: B, C](implicit ev: A1 &amp;lt;:&amp;lt; Either[C, B1]): Either[C, B1]
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Paul Phillips &amp;nbsp; &amp;nbsp; &amp;nbsp;| A Sunday school is a prison in which children do
&lt;br&gt;Protagonist &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| penance for the evil conscience of their parents. 
&lt;br&gt;Empiricist &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp; -- H. L. Mencken
&lt;br&gt;pal, i pill push &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/-scala--Using-generalised-type-constraints-in-2.8-collections-tp26249516p26256478.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26255415</id>
	<title>Re: [scala] Using generalised type constraints in 2.8 collections</title>
	<published>2009-11-08T08:44:19Z</published>
	<updated>2009-11-08T08:44:19Z</updated>
	<author>
		<name>Adriaan Moors-2</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sun, Nov 8, 2009 at 12:08 AM, Jason Zaugg &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26255415&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jzaugg@...&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;

In light of generalised type constraints:&lt;br&gt;&lt;br&gt;- Should List.flatten be tightened to accept &amp;#39;implicit ev: A &amp;lt;:&amp;lt;
Iterable[B]&amp;#39; rather than &amp;#39;implicit f : A =&amp;gt; Iterable[B]&amp;#39;?&lt;br&gt;- Could we have Option.flatten, along the lines of: &lt;a href=&quot;http://gist.github.com/228927&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/228927&lt;/a&gt;  ?&lt;br&gt;

&lt;br&gt;Or am I just wielding a shiny new hammer in search of things resembilng nails?&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;nope! nail: meet hammer; hammer: meet flatten&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;i&amp;#39;ll look into it in the next couple of days&lt;/div&gt;

&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;thanks!&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;adriaan&lt;/div&gt;&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Using-generalised-type-constraints-in-2.8-collections-tp26249516p26255415.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26255215</id>
	<title>Re: [scala] Using generalised type constraints in 2.8 collections</title>
	<published>2009-11-08T08:21:39Z</published>
	<updated>2009-11-08T08:21:39Z</updated>
	<author>
		<name>_retronym</name>
	</author>
	<content type="html">Here&amp;#39;s a demo of what they enable, showing the equivalent Scala 2.7 code. &lt;a href=&quot;http://gist.github.com/229163&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/229163&lt;/a&gt;&lt;br&gt;&lt;br&gt;In 2.7 and 2.8, &amp;lt;: allows you to constraint type parameters of the current method. But to constrain other in-scope abstract types, you needed to add an implicit parameter to the method (see List.flatten.)&lt;br&gt;
&lt;br&gt;In 2.7, you could require an implicit of type (A =&amp;gt; B) and expect this implicit to be provided by Predef.identity. But it could also come from other in scope implicit conversion functions. Requiring a parameter of (A &amp;lt;:&amp;lt; B) is stricter because the instances can only be generated if A conforms to B.&lt;br&gt;
&lt;br&gt;As far as I can tell, it is just a library change to Predef, no compiler magic at all.&lt;br&gt;&lt;br&gt;2.7:&lt;br&gt;
Predef.scala&lt;br&gt;
  implicit def identity[A](x: A): A = x&lt;br&gt;
&lt;br&gt;
2.8&lt;br&gt;
Predef.scala&lt;br&gt;
  sealed abstract class &amp;lt;:&amp;lt;[-From, +To] extends (From =&amp;gt; To)&lt;br&gt;
  implicit def conforms[A]: A &amp;lt;:&amp;lt; A = new (A &amp;lt;:&amp;lt; A) {def apply(x: A) = x}&lt;br&gt;
&lt;br&gt;-jason&lt;br&gt;&lt;br&gt;On Sun, Nov 8, 2009 at 4:35 PM, Johannes Rudolph &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26255215&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;johannes.rudolph@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;div class=&quot;gmail_quote&quot;&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 Sun, Nov 8, 2009 at 12:08 AM, Jason Zaugg &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26255215&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jzaugg@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;


&amp;gt; In light of generalised type constraints:&lt;br&gt;
&lt;/div&gt;Are these somewhere documented? What do they do?&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
--&lt;br&gt;
Johannes&lt;br&gt;
&lt;br&gt;
-----------------------------------------------&lt;br&gt;
Johannes Rudolph&lt;br&gt;
&lt;a href=&quot;http://virtual-void.net&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://virtual-void.net&lt;/a&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/-scala--Using-generalised-type-constraints-in-2.8-collections-tp26249516p26255215.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26254998</id>
	<title>Re: [scala] structural type example from paper not compiling</title>
	<published>2009-11-08T07:55:32Z</published>
	<updated>2009-11-08T07:55:32Z</updated>
	<author>
		<name>Viktor Klang</name>
	</author>
	<content type="html">Also, if you want to return some kind of result:&lt;br&gt;&lt;br&gt;object d {&lt;br&gt;     type Close = { def close() : Unit }&lt;br&gt;     def safe[R,T &amp;lt;: Close](t : T)(run : T =&amp;gt; R) : R = try { run(t) } finally { t.close }&lt;br&gt;}&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sun, Nov 8, 2009 at 4:37 PM, Luc Duponcheel &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26254998&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;luc.duponcheel@...&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;
what about&lt;br&gt;&lt;br&gt;import java.io._&lt;div class=&quot;im&quot;&gt;&lt;br&gt;&lt;br&gt;object d {&lt;br&gt;&lt;br&gt; type Close =  { def close(): Unit }&lt;br&gt;&lt;br&gt;&lt;/div&gt; def autoclose[X &amp;lt;: Close](x: X)(run: X =&amp;gt; Unit): Unit = {&lt;br&gt;   try { run(x) }&lt;br&gt;   finally { x.close }&lt;br&gt;
 }&lt;br&gt;
&lt;br&gt; autoclose[FileInputStream](new FileInputStream(&amp;quot;test.txt&amp;quot;))(&lt;div class=&quot;im&quot;&gt;&lt;br&gt;   { file =&amp;gt;&lt;br&gt;     var byte: Int = file.read();&lt;br&gt;     while(byte &amp;gt; -1) {&lt;br&gt;       print(byte.toChar)&lt;br&gt;       byte = file.read()&lt;br&gt;

     }&lt;br&gt;   }&lt;br&gt; )&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sun, Nov 8, 2009 at 4:20 PM, Miguel Garcia &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26254998&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;miguel.garcia@...&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,&lt;br&gt;
&lt;br&gt;
I&amp;#39;m having trouble getting to compile with 2.8 the example appearing in   the paper&lt;br&gt;
&lt;br&gt;
Compiling structural types on the JVM: a comparison of reflective and generative techniques from Scala&amp;#39;s perspective&lt;br&gt;
&lt;a href=&quot;http://infoscience.epfl.ch/record/138931/files/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://infoscience.epfl.ch/record/138931/files/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
i.e. this snippet:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
import java.io.FileInputStream&lt;br&gt;
&lt;br&gt;
object d {&lt;br&gt;
&lt;br&gt;
  type Close =  { def close(): Unit }&lt;br&gt;
&lt;br&gt;
  def autoclose(t: Close)(run: Close =&amp;gt; Unit): Unit = {&lt;br&gt;
    try { run(t) }&lt;br&gt;
    finally { t.close }&lt;br&gt;
  }&lt;br&gt;
&lt;br&gt;
  autoclose(new FileInputStream(&amp;quot;test.txt&amp;quot;))(&lt;br&gt;
    { file =&amp;gt;&lt;br&gt;
      var byte: Int = file.read();&lt;br&gt;
      while(byte &amp;gt; -1) {&lt;br&gt;
        print(byte.toChar)&lt;br&gt;
        byte = file.read()&lt;br&gt;
      }&lt;br&gt;
    }&lt;br&gt;
  )&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
because of a type mismatch: the 2nd argument to the autoclose invocation, with actual type FileInputStream =&amp;gt; Unit, is taken to have type Close =&amp;gt; Unit, and thus file.read() is rejected because &amp;quot;value read is not a member of d.Close&amp;quot;&lt;br&gt;


&lt;br&gt;
&lt;br&gt;
The type of &amp;quot;file&amp;quot; in &amp;quot;file =&amp;gt; ...&amp;quot; is not inferred based on the preceding actual argument. Any way out of this?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Miguel&lt;br&gt;
&lt;a href=&quot;http://www.sts.tu-harburg.de/people/mi.garcia/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.sts.tu-harburg.de/people/mi.garcia/&lt;/a&gt;&lt;br&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;/div&gt;&lt;/div&gt;&lt;font color=&quot;#888888&quot;&gt;-- &lt;br&gt;   __~O&lt;br&gt;  -\ &amp;lt;,&lt;br&gt;(*)/ (*)&lt;br&gt;&lt;br&gt;reality goes far beyond imagination&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;Viktor Klang&lt;br&gt;| &amp;quot;A complex system that works is invariably &lt;br&gt;| found to have evolved from a simple system &lt;br&gt;| that worked.&amp;quot; - John Gall&lt;br&gt;&lt;br&gt;Blog: &lt;a href=&quot;http://klangism.blogspot.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;klangism.blogspot.com&lt;/a&gt;&lt;br&gt;
Twttr: &lt;a href=&quot;http://twitter.com/viktorklang&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;twitter.com/viktorklang&lt;/a&gt;&lt;br&gt;Code: &lt;a href=&quot;http://github.com/viktorklang&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;github.com/viktorklang&lt;/a&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala---structural-type-example-from-paper-not-compiling-tp26254700p26254998.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26254819</id>
	<title>Re: [scala] structural type example from paper not compiling</title>
	<published>2009-11-08T07:37:08Z</published>
	<updated>2009-11-08T07:37:08Z</updated>
	<author>
		<name>Luc Duponcheel</name>
	</author>
	<content type="html">what about&lt;br&gt;&lt;br&gt;import java.io._&lt;br&gt;&lt;br&gt;object d {&lt;br&gt;&lt;br&gt; type Close =  { def close(): Unit }&lt;br&gt;&lt;br&gt; def autoclose[X &amp;lt;: Close](x: X)(run: X =&amp;gt; Unit): Unit = {&lt;br&gt;   try { run(x) }&lt;br&gt;   finally { x.close }&lt;br&gt; }&lt;br&gt;
&lt;br&gt; autoclose[FileInputStream](new FileInputStream(&amp;quot;test.txt&amp;quot;))(&lt;br&gt;   { file =&amp;gt;&lt;br&gt;     var byte: Int = file.read();&lt;br&gt;     while(byte &amp;gt; -1) {&lt;br&gt;       print(byte.toChar)&lt;br&gt;       byte = file.read()&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 Sun, Nov 8, 2009 at 4:20 PM, Miguel Garcia &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26254819&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;miguel.garcia@...&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,&lt;br&gt;
&lt;br&gt;
I&amp;#39;m having trouble getting to compile with 2.8 the example appearing in   the paper&lt;br&gt;
&lt;br&gt;
Compiling structural types on the JVM: a comparison of reflective and generative techniques from Scala&amp;#39;s perspective&lt;br&gt;
&lt;a href=&quot;http://infoscience.epfl.ch/record/138931/files/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://infoscience.epfl.ch/record/138931/files/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
i.e. this snippet:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
import java.io.FileInputStream&lt;br&gt;
&lt;br&gt;
object d {&lt;br&gt;
&lt;br&gt;
  type Close =  { def close(): Unit }&lt;br&gt;
&lt;br&gt;
  def autoclose(t: Close)(run: Close =&amp;gt; Unit): Unit = {&lt;br&gt;
    try { run(t) }&lt;br&gt;
    finally { t.close }&lt;br&gt;
  }&lt;br&gt;
&lt;br&gt;
  autoclose(new FileInputStream(&amp;quot;test.txt&amp;quot;))(&lt;br&gt;
    { file =&amp;gt;&lt;br&gt;
      var byte: Int = file.read();&lt;br&gt;
      while(byte &amp;gt; -1) {&lt;br&gt;
        print(byte.toChar)&lt;br&gt;
        byte = file.read()&lt;br&gt;
      }&lt;br&gt;
    }&lt;br&gt;
  )&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
because of a type mismatch: the 2nd argument to the autoclose invocation, with actual type FileInputStream =&amp;gt; Unit, is taken to have type Close =&amp;gt; Unit, and thus file.read() is rejected because &amp;quot;value read is not a member of d.Close&amp;quot;&lt;br&gt;

&lt;br&gt;
&lt;br&gt;
The type of &amp;quot;file&amp;quot; in &amp;quot;file =&amp;gt; ...&amp;quot; is not inferred based on the preceding actual argument. Any way out of this?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Miguel&lt;br&gt;
&lt;a href=&quot;http://www.sts.tu-harburg.de/people/mi.garcia/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.sts.tu-harburg.de/people/mi.garcia/&lt;/a&gt;&lt;br&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;   __~O&lt;br&gt;  -\ &amp;lt;,&lt;br&gt;(*)/ (*)&lt;br&gt;&lt;br&gt;reality goes far beyond imagination&lt;br&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala---structural-type-example-from-paper-not-compiling-tp26254700p26254819.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26254805</id>
	<title>Re: [scala] Using generalised type constraints in 2.8 collections</title>
	<published>2009-11-08T07:35:39Z</published>
	<updated>2009-11-08T07:35:39Z</updated>
	<author>
		<name>Johannes Rudolph-2</name>
	</author>
	<content type="html">On Sun, Nov 8, 2009 at 12:08 AM, Jason Zaugg &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26254805&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jzaugg@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; In light of generalised type constraints:
&lt;br&gt;Are these somewhere documented? What do they do?
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Johannes
&lt;br&gt;&lt;br&gt;-----------------------------------------------
&lt;br&gt;Johannes Rudolph
&lt;br&gt;&lt;a href=&quot;http://virtual-void.net&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://virtual-void.net&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala--Using-generalised-type-constraints-in-2.8-collections-tp26249516p26254805.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26254700</id>
	<title>[scala]  structural type example from paper not compiling</title>
	<published>2009-11-08T07:20:06Z</published>
	<updated>2009-11-08T07:20:06Z</updated>
	<author>
		<name>Miguel Garcia</name>
	</author>
	<content type="html">&lt;br&gt;Hi,
&lt;br&gt;&lt;br&gt;I'm having trouble getting to compile with 2.8 the example appearing in 
&lt;br&gt;&amp;nbsp; &amp;nbsp;the paper
&lt;br&gt;&lt;br&gt;Compiling structural types on the JVM: a comparison of reflective and 
&lt;br&gt;generative techniques from Scala's perspective
&lt;br&gt;&lt;a href=&quot;http://infoscience.epfl.ch/record/138931/files/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://infoscience.epfl.ch/record/138931/files/&lt;/a&gt;&lt;br&gt;&lt;br&gt;i.e. this snippet:
&lt;br&gt;&lt;br&gt;&lt;br&gt;import java.io.FileInputStream
&lt;br&gt;&lt;br&gt;object d {
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;type Close = &amp;nbsp;{ def close(): Unit }
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;def autoclose(t: Close)(run: Close =&amp;gt; Unit): Unit = {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;try { run(t) }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;finally { t.close }
&lt;br&gt;&amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;autoclose(new FileInputStream(&amp;quot;test.txt&amp;quot;))(
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{ file =&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var byte: Int = file.read();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while(byte &amp;gt; -1) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(byte.toChar)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byte = file.read()
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp;)
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;&lt;br&gt;because of a type mismatch: the 2nd argument to the autoclose 
&lt;br&gt;invocation, with actual type FileInputStream =&amp;gt; Unit, is taken to have 
&lt;br&gt;type Close =&amp;gt; Unit, and thus file.read() is rejected because &amp;quot;value read 
&lt;br&gt;is not a member of d.Close&amp;quot;
&lt;br&gt;&lt;br&gt;&lt;br&gt;The type of &amp;quot;file&amp;quot; in &amp;quot;file =&amp;gt; ...&amp;quot; is not inferred based on the 
&lt;br&gt;preceding actual argument. Any way out of this?
&lt;br&gt;&lt;br&gt;&lt;br&gt;Miguel
&lt;br&gt;&lt;a href=&quot;http://www.sts.tu-harburg.de/people/mi.garcia/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sts.tu-harburg.de/people/mi.garcia/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-scala---structural-type-example-from-paper-not-compiling-tp26254700p26254700.html" />
</entry>

</feed>
