<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Scala Forum - Miscellaneous</title>
    <subtitle></subtitle>
    <link rel="self" href="http://scala-forum.org/feed.php?8,type=atom" />
    <id>http://scala-forum.org/list.php?8</id>
    <updated>2010-09-05T22:30:54+02:00</updated>
    <generator>Phorum 5.2.13</generator>
    <entry>
        <title type="html">name conventions (2 replies)</title>
        <link href="http://scala-forum.org/read.php?8,1860,1860#msg-1860" />
        <category term="Miscellaneous" />
        <published>2010-07-30T10:19:26+02:00</published>
        <updated>2010-07-30T21:35:00+02:00</updated>
        <id>http://scala-forum.org/read.php?8,1860,1860#msg-1860</id>
        <author>
            <name>Knopf</name>
        </author>
        <summary type="html"><![CDATA[ Hello,<br />
<br />
do you know, if there exists official name-conventions in scala?<br />
<br />
for example: I have an java interface X. There exists an java class XImpl.<br />
and now, I would like to write an scala trait instead of XImpl, which should extend X. What could be the name?<br />
<br />
Barbara]]></summary>
    </entry>
    <entry>
        <title type="html">Comparison Scala - Java (6 replies)</title>
        <link href="http://scala-forum.org/read.php?8,1813,1813#msg-1813" />
        <category term="Miscellaneous" />
        <published>2010-07-26T12:18:56+02:00</published>
        <updated>2010-07-29T10:38:35+02:00</updated>
        <id>http://scala-forum.org/read.php?8,1813,1813#msg-1813</id>
        <author>
            <name>Knopf</name>
        </author>
        <summary type="html"><![CDATA[ Hallo,<br />
<br />
at the moment I write my bachelorthesis to complete my study of computer science.<br />
The theme of my thesis is to improve how integration of Scala works with a system which is based on spring, hibernate and jsf. In one part of my thesis I have to reimplement complex Java code with Scala to simplify it and make it more functional.<br />
<br />
Now I have the problem, that I have to compare in an objective way the old java-Code with my new Scala code. Because my time very limited I can't make benchmarks to test, that the new code is simpler -&gt; hass less bugs, for example. But I need a scientific way to compare.<br />
<br />
Has anyone here some experience in that or any ideas to compare?<br />
<br />
Thanks indeed for your help!<br />
<br />
Barbara]]></summary>
    </entry>
    <entry>
        <title type="html">Tail call support in JVM 7 ? (no replies)</title>
        <link href="http://scala-forum.org/read.php?8,837,837#msg-837" />
        <category term="Miscellaneous" />
        <published>2009-12-21T10:26:57+01:00</published>
        <updated>2009-12-21T10:26:57+01:00</updated>
        <id>http://scala-forum.org/read.php?8,837,837#msg-837</id>
        <author>
            <name>Landei</name>
        </author>
        <summary type="html"><![CDATA[ [<a href="http://weblogs.java.net/blog/forax/archive/2009/12/18/tailcall-anyone" rel="nofollow" >weblogs.java.net</a>]]]></summary>
    </entry>
    <entry>
        <title type="html">How to tell the interpreter to skip first script line? (4 replies)</title>
        <link href="http://scala-forum.org/read.php?8,741,741#msg-741" />
        <category term="Miscellaneous" />
        <published>2009-11-25T17:57:55+01:00</published>
        <updated>2010-07-16T23:53:34+02:00</updated>
        <id>http://scala-forum.org/read.php?8,741,741#msg-741</id>
        <author>
            <name>xylo</name>
        </author>
        <summary type="html"><![CDATA[ Hello,<br />
<br />
I'm currently writing some Scala scripts with long classpaths. Therefore I put the scala command into the scala script as the first line to avoid writing the whole line on the console. The script is set executable and works so far, but of course the first line is a shell command and not valid scala code. Therefore the interpreter always claims about this line. Is there a way to tell Scala it shall ignore the first line?<br />
<br />
Cheers,<br />
Stefan]]></summary>
    </entry>
    <entry>
        <title type="html">Closures in Java7??? (4 replies)</title>
        <link href="http://scala-forum.org/read.php?8,730,730#msg-730" />
        <category term="Miscellaneous" />
        <published>2009-11-19T10:40:24+01:00</published>
        <updated>2009-11-24T17:53:52+01:00</updated>
        <id>http://scala-forum.org/read.php?8,730,730#msg-730</id>
        <author>
            <name>Landei</name>
        </author>
        <summary type="html"><![CDATA[ [<a href="http://puredanger.com/tech/2009/11/18/closures-after-all/" rel="nofollow" >puredanger.com</a>]<br />
<br />
Of course I'd like it, but the circumstances make me think &quot;WTF???&quot;]]></summary>
    </entry>
    <entry>
        <title type="html">Scala usage (1 reply)</title>
        <link href="http://scala-forum.org/read.php?8,582,582#msg-582" />
        <category term="Miscellaneous" />
        <published>2009-10-08T23:43:39+02:00</published>
        <updated>2009-10-09T10:44:13+02:00</updated>
        <id>http://scala-forum.org/read.php?8,582,582#msg-582</id>
        <author>
            <name>manfred</name>
        </author>
        <summary type="html"><![CDATA[ Hi.<br />
<br />
Interesting that Scala is actually used quite frequently.<br />
Also interesting that Scala is much wider in use than Groovy.<br />
<br />
[<a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html" rel="nofollow" >www.tiobe.com</a>]<br />
<br />
<br />
Manfred]]></summary>
    </entry>
    <entry>
        <title type="html">Best method name to add an action to a controller? (7 replies)</title>
        <link href="http://scala-forum.org/read.php?8,360,360#msg-360" />
        <category term="Miscellaneous" />
        <published>2009-08-07T16:03:50+02:00</published>
        <updated>2009-08-11T22:49:46+02:00</updated>
        <id>http://scala-forum.org/read.php?8,360,360#msg-360</id>
        <author>
            <name>christian</name>
        </author>
        <summary type="html"><![CDATA[ I'm working on a small web framework (yes I know, the world is full of them ...). And I'm thinking about how to add actions to a controller in this framework.<br />
<br />
A Controller would look like this:<br />
<pre class="scala bbcode_geshi" style="font-family:monospace;"><div class="head">Language: Scala</div><a href="http://scala-lang.org"><span class="kw1">class</span></a> MyController <a href="http://scala-lang.org"><span class="kw1">extends</span></a> Controller<span class="br0">&#123;</span>
&nbsp;
	mount<span class="br0">&#40;</span><span class="st0">&quot;blog/&quot;</span>, <a href="http://scala-lang.org"><span class="kw1">new</span></a> BlogController<span class="br0">&#41;</span>
&nbsp;
	mount<span class="br0">&#40;</span>GET, <span class="st0">&quot;comment/$id&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
		<a href="http://scala-lang.org"><span class="kw1">val</span></a> c <span class="sy0">=</span> fetchComment<span class="br0">&#40;</span>params<span class="br0">&#40;</span><span class="st0">&quot;id&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
		<a href="http://scala-lang.org"><span class="kw1">new</span></a> Answer<span class="br0">&#40;</span>c<span class="br0">&#41;</span>
	<span class="br0">&#125;</span>
&nbsp;
<span class="br0">&#125;</span></pre>
<br />
The first &quot;mount&quot; registers a sub-controller with the name &quot;blog/&quot;. The second &quot;mount&quot; registers an action listening to HTTP GET and the path &quot;comment/$id&quot;. I think &quot;mount&quot; is a good name to register a controller. But should the method to add an action share the same name?<br />
	<br />
The method could also be named &quot;mountAction&quot; or &quot;add&quot; ... Furthermore the name can indicate the HTTP method to listen to. What of these method names do you like best?	<br />
<pre class="scala bbcode_geshi" style="font-family:monospace;"><div class="head">Language: Scala</div>mount<span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span> ...
&nbsp;
<span class="me1">mountAction</span><span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span> ...
&nbsp;
<span class="me1">mountGetAction</span><span class="br0">&#40;</span><span class="st0">&quot;path/$id&quot;</span> ...
&nbsp;
<span class="me1">onGet</span><span class="br0">&#40;</span><span class="st0">&quot;path/$id&quot;</span> ...
&nbsp;
<span class="me1">handleGet</span><span class="br0">&#40;</span><span class="st0">&quot;path/$id&quot;</span> ...
&nbsp;
<span class="me1">handle</span><span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span> ...
&nbsp;
<span class="me1">add</span><span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span> ...
&nbsp;
<span class="me1">addAction</span><span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span> ...
&nbsp;
<span class="me1">addGetAction</span><span class="br0">&#40;</span><span class="st0">&quot;path/$id&quot;</span> ...</pre>
<br />
Other ideas?<br />
<br />
Each action closure should get a request object which could be passed explicitly <br />
<pre class="scala bbcode_geshi" style="font-family:monospace;"><div class="head">Language: Scala</div>methodName<span class="br0">&#40;</span><span class="st0">&quot;path&quot;</span>, <span class="br0">&#40;</span>request<span class="br0">&#41;</span> <span class="sy0">=&gt;</span> <span class="br0">&#123;</span>
	<a href="http://scala-lang.org"><span class="kw1">val</span></a> result <span class="sy0">=</span> doIt<span class="br0">&#40;</span>request<span class="br0">&#41;</span>
	<a href="http://scala-lang.org"><span class="kw1">new</span></a> Answer<span class="br0">&#40;</span>result<span class="br0">&#41;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span></pre>
.. or implicitely<br />
<pre class="scala bbcode_geshi" style="font-family:monospace;"><div class="head">Language: Scala</div>methodName<span class="br0">&#40;</span><span class="st0">&quot;path&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
	<a href="http://scala-lang.org"><span class="kw1">val</span></a> result <span class="sy0">=</span> doIt<span class="br0">&#40;</span>request<span class="br0">&#41;</span>
	<a href="http://scala-lang.org"><span class="kw1">new</span></a> Answer<span class="br0">&#40;</span>result<span class="br0">&#41;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span></pre>
<br />
The first approach makes obvious what is happening. The advantage of implicit passing is the more concise code. What do you like better?<br />
<br />
My ideas expanded:<br />
<pre class="scala bbcode_geshi" style="font-family:monospace;"><div class="head">Language: Scala</div>mount<span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span>, <span class="br0">&#40;</span>request<span class="br0">&#41;</span> <span class="sy0">=&gt;</span> <span class="br0">&#123;</span>
...
<span class="br0">&#125;</span><span class="br0">&#41;</span>
&nbsp;
mountAction<span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span>, <span class="br0">&#40;</span>request<span class="br0">&#41;</span> <span class="sy0">=&gt;</span> <span class="br0">&#123;</span>
...
<span class="br0">&#125;</span><span class="br0">&#41;</span>
&nbsp;
mountGetAction<span class="br0">&#40;</span><span class="st0">&quot;path/$id&quot;</span>, <span class="br0">&#40;</span>request<span class="br0">&#41;</span> <span class="sy0">=&gt;</span> <span class="br0">&#123;</span>
...
<span class="br0">&#125;</span><span class="br0">&#41;</span>
&nbsp;
onGet<span class="br0">&#40;</span><span class="st0">&quot;path/$id&quot;</span>, <span class="br0">&#40;</span>request<span class="br0">&#41;</span> <span class="sy0">=&gt;</span> <span class="br0">&#123;</span>
...
<span class="br0">&#125;</span><span class="br0">&#41;</span>
&nbsp;
handleGet<span class="br0">&#40;</span><span class="st0">&quot;path/$id&quot;</span>, <span class="br0">&#40;</span>request<span class="br0">&#41;</span> <span class="sy0">=&gt;</span> <span class="br0">&#123;</span>
...
<span class="br0">&#125;</span><span class="br0">&#41;</span>
&nbsp;
handleGet<span class="br0">&#40;</span><span class="st0">&quot;path/$id&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
...
<span class="br0">&#125;</span>
&nbsp;
handle<span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
...
<span class="br0">&#125;</span>
&nbsp;
add<span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span>, <span class="br0">&#40;</span>request<span class="br0">&#41;</span> <span class="sy0">=&gt;</span> <span class="br0">&#123;</span>
...
<span class="br0">&#125;</span><span class="br0">&#41;</span>
&nbsp;
addAction<span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span>, <span class="br0">&#40;</span>request<span class="br0">&#41;</span> <span class="sy0">=&gt;</span> <span class="br0">&#123;</span>
...
<span class="br0">&#125;</span><span class="br0">&#41;</span>
&nbsp;
addGetAction<span class="br0">&#40;</span><span class="st0">&quot;path/$id&quot;</span>, <span class="br0">&#40;</span>request<span class="br0">&#41;</span> <span class="sy0">=&gt;</span> <span class="br0">&#123;</span>
...
<span class="br0">&#125;</span><span class="br0">&#41;</span>
&nbsp;
mount<span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
...
<span class="br0">&#125;</span>
&nbsp;
mountAction<span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
...
<span class="br0">&#125;</span>
&nbsp;
mountGetAction<span class="br0">&#40;</span><span class="st0">&quot;path/$id&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
...
<span class="br0">&#125;</span>
&nbsp;
onGet<span class="br0">&#40;</span><span class="st0">&quot;path/$id&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
...
<span class="br0">&#125;</span>
&nbsp;
add<span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
...
<span class="br0">&#125;</span>
&nbsp;
addAction<span class="br0">&#40;</span>GET, <span class="st0">&quot;path/$id&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
...
<span class="br0">&#125;</span>
&nbsp;
addGetAction<span class="br0">&#40;</span><span class="st0">&quot;path/$id&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
...
<span class="br0">&#125;</span></pre>
<br />
What is your favourite?]]></summary>
    </entry>
    <entry>
        <title type="html">Scala vs Javascript? (no replies)</title>
        <link href="http://scala-forum.org/read.php?8,169,169#msg-169" />
        <category term="Miscellaneous" />
        <published>2009-06-21T17:40:44+02:00</published>
        <updated>2009-06-21T17:40:44+02:00</updated>
        <id>http://scala-forum.org/read.php?8,169,169#msg-169</id>
        <author>
            <name>marcusdowning</name>
        </author>
        <summary type="html"><![CDATA[ Am I the only one that keeps writing <b>val</b> rather than <b>var</b> in Javascript and failing to see why it doesn't work?]]></summary>
    </entry>
</feed>
