background preloader

Scala Standard Library 2.8.0.final

InfoQ: Scala & Spring: Combine the best of both worlds Introduction Scala is a great programming language combining a concise and legible syntax with a seamless fusion of the object-oriented and functional programming paradigm that is fully compatible with Java. The latter makes it possible to combine Scala with Java APIs and frameworks that Java developers are familiar with. By doing so, the usage of existing Java frameworks can be improved and simplified. In addition to that, the threshold to learn Scala is also lowered because it can easily easily be integrated with the “well-known world of Java”. In this article I will show how Spring, one of the most popular frameworks, can be leveraged by means of Scala. In order to demonstrate how Scala compliments Spring this article is based on a simple sample application. The domain model resembles a mini version of a social networking application. Step 1 val p1 = new Person(“Rod Johnson”) val p2 = dao.findByName(“Martin Odersky”) p1.link(p2) personDao.save(p1) Step 2 Step 3 Requirements Implementation

'scala' tag wiki implicit.ly - Scala software, hot off the presses Introduction Scala 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. Scala is object-oriented Scala is a pure object-oriented language in the sense that every value is an object. Types and behavior of objects are described by classes and traits. Classes are extended by subclassing and a flexible mixin-based composition mechanism as a clean replacement for multiple inheritance. Scala is functional Scala is also a functional language in the sense that every function is a value. Furthermore, Scala’s notion of pattern matching naturally extends to the processing of XML data with the help of right-ignoring sequence patterns. Scala is statically typed Scala is equipped with an expressive type system that enforces statically that abstractions are used in a safe and coherent manner. Scala is extensible Scala interoperates with Java and .NET.

Roundup: Scala for Java Refugees - Code Commit 13 Feb 2008 To be honest, I’m somewhat kicking myself for writing this post. As I’ve said many times: roundup posts are for people who are too lazy to write real content. I can’t tell you how many blogs I’ve come across which have a roundup-to-post ratio of easily 3:1. Meta-roundups aside, I decided (after much deliberation) that a single post linking to all six parts of the series would be useful to one or two people. Of course it’s always possible that you subscribe to my way of looking at things. Part 1: main(String[]) Introductory article giving motivation for learning Scala and some first steps to “get your feet wet” in the language. Part 2: Basic OOP Looking at Scala’s syntax in a little more detail. Part 3: Methods and Statics Scala’s method syntax is far too powerful to cover in a single post. Part 4: Pattern Matching and Exceptions Pattern matching is one of the most useful constructs in the entire language. Part 5: Traits and Types Part 6: Getting Over Java

Scala School Other Languages: About Scala school started as a series of lectures at Twitter to prepare experienced engineers to be productive Scala programmers. Scala is a relatively new language, but draws on many familiar concepts. Thus, these lectures assumed the audience knew the concepts and showed how to use them in Scala. We found this an effective way of getting new engineers up to speed quickly. Approach We think it makes the most sense to approach teaching Scala not as if it were an improved Java but instead as a new language. Most of the lessons require no software other than a Scala REPL. Also You can learn more elsewhere:

Programming in Scala, First Edition Programming in Scala, First Editionby Martin Odersky, Lex Spoon, and Bill VennersDecember 10, 2008 Martin Odersky made a huge impact on the Java world with his design of the Pizza language. Although Pizza itself never became popular, it demonstrated that object-oriented and functional language features, when combined with skill and taste, form a natural and powerful combination. Since that time, we at Sun tried to simplify program development by extending the language with piecemeal solutions to particular problems, like the for-each loop, enums, and autoboxing. Lately, there has been a backlash against statically typed languages. Scala is a tastefully typed language: it is statically typed, but explicit types appear in just the right places. Will Scala be the next great language? Neal Gafter San Jose, California September 3, 2008 Many people have contributed to this book and to the material it covers. Scala itself has been a collective effort of many people. Who should read this book

Scala in Depth Scala in Depth is a unique new book designed to help you integrate Scala effectively into your development process. By presenting the emerging best practices and designs from the Scala community, it guides you through dozens of powerful techniques example by example. Scala is a powerful JVM language that blends the functional and OO programming models. You'll have no trouble getting introductions to Scala in books or online, but it's hard to find great examples and insights from experienced practitioners. You'll find them in Scala in Depth. There's little heavy-handed theory here—just dozens of crisp, practical techniques for coding in Scala. Josh Suereth is a software developer with Typesafe. “A book that will help you transition from tinkering in Scala to professionally programming with it.” “A thorough treatment of the subject ... best suited for those who strive to become experts in Scala.”

The Scala Programming Language The Python Tutorial — Python v2.7.4 documentation Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python Web site, and may be freely distributed. The same site also contains distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation. The Python interpreter is easily extended with new functions and data types implemented in C or C++ (or other languages callable from C). This tutorial introduces the reader informally to the basic concepts and features of the Python language and system.

Scala Documentation - Scala Documentation Compile Scala to JavaScript With Scala.js At the Scala Day last week, Sébastien Doeraene presented Scala.js, a Scala to JavaScript compiler. The compiler supports the full Scala language allowing its users to build web applications front to back in Scala and potentially reuse code between the server and the client. Scala code written for Scala.js can interact with existing JavaScript code either in a dynamically typed manner, or in a statically typed manner. The former is more flexible: access is provided to the global (window) object and arbitrary properties can be accessed and method called. These types are used by the compiler to do type checking and to provide code completion in IDEs. .Here's an example of using jQuery from Scala.js, the example attaches an on-click handler to a button with id "button", and once clicked appends a paragraph tag to a div with id "pane": jQuery("#button").click { () => val paragraph = jQuery("<p>").html("Hello World!") It is also possible to call Scala generated code from JavaScript.

sbt eclipse Scala: the flying sandwich parts JavaScript existed since 1995 long before 'JavaScript: The Good Parts' (2008), jQuery (2006), and V8 (2008) happened. The interesting thing about Douglas Crockford's 'The Good Parts' is that unlike the other additive work, it's a book about subtracting features from the language. I've been thinking about exploring a subset of Scala in a wonderland setting without the "real world" constraints such as Java familiarity and interoperability. If using Scala as an alternative Java is acceptable, why not try using it as an alternative functional programming language? values What talk you of the posy or the value? The Scala Language Specification describes a value as follows: A value definition val x: T = e defines x as a name of the value that results from the evaluation of e. In TFSP, do not omit the type annotation T inside the body of traits and classes. lazy vals The order in which the values are defined is critical when using plain vals. pattern definition avoid vars expressions literals no nulls

Related: