- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Feel of Scala on Parleys
Thu, 2009-03-26, 23:51
Hi All,
The Feel of Scala talk that I gave at Devoxx last December went up on
Parleys today:
http://www.parleys.com/display/PARLEYS/Home#slide=1;title=The%20Feel%20O...
This is the same basic talk I plan to give at JavaOne, and is
essentially my one-hour elevator pitch for Scala. I'm curious what
people think, if you have suggestions, because I want to do something
at least slightly different at JavaOne. Some people may have watched
the Devoxx video, so I don't want to just repeat it.
Thanks.
Bill
Sat, 2009-03-28, 16:27
#2
Re: Feel of Scala on Parleys
Hi Luc,
I think the strings you're talking about are probably the "test" or
"example" names, which in Spec would tend to start with "should" or
"must". So those are just strings. Something like:
it("should pop values in last-in-first-out order") {
val stack = new Stack[Int]
stack.push(1)
stack.push(2)
stack.pop() should equal (2)
stack.pop() should equal (1)
}
The last two expressions inside the block, which have should in them
are executable code which could be deterministically refactored. If
you change the stack method pop to popTheTop, then this would require
an update these expressions. Is that what you were talking about?
But to answer your general question about plugins, you could indeed
have a compiler plugin that checks strings. One use case would be to
check regular expression strings at compile time, to make sure they
are valid regular expressions. Another might be to check SQL strings,
to make sure they are valid SQL.
Thanks.
Bill
On Sat, Mar 28, 2009 at 10:23 PM, Luc Duponcheel
wrote:
> Bill,
>
> somewhere in the middle of your talk you switched
> from language level sentences : xyz should be abc
> to strings : "xyz should be abc"
>
> a natural question that came into my mind is:
> (1) does this support deterministic refactoring
>
> and, if the answer for (1) is no,
>
> (2) is it possible
> (like you showed for turning heuristic refactoring into
> deterministic factoring with the backtick trick for calling
> private methods) to use a compiler plugin to support
> deterministic refactoring
>
> if the answer for (2) [or, maybe, (1)] is yes,
> then I would certainly mention that during the JavaOne talk
>
> especially since you (rightly, of course) are putting
> so much emphasis on type safeness
>
>
>
> Luc
>
> --
> __~O
> -\ <,
> (*)/ (*)
>
> reality goes far beyond imagination
>
>
somewhere in the middle of your talk you switched
from language level sentences : xyz should be abc
to strings : "xyz should be abc"
a natural question that came into my mind is:
(1) does this support deterministic refactoring
and, if the answer for (1) is no,
(2) is it possible
(like you showed for turning heuristic refactoring into
deterministic factoring with the backtick trick for calling
private methods) to use a compiler plugin to support
deterministic refactoring
if the answer for (2) [or, maybe, (1)] is yes,
then I would certainly mention that during the JavaOne talk
especially since you (rightly, of course) are putting
so much emphasis on type safeness
Luc
--
__~O
-\ <,
(*)/ (*)
reality goes far beyond imagination