summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2004-02-05 12:02:37 +0000
committerburaq <buraq@epfl.ch>2004-02-05 12:02:37 +0000
commitf40e29b44cd2d2f46313eb5122eca3ed3ee5c22e (patch)
tree28412609c4b8aecc33d67d88d8a63c8a82699747 /doc
parent1c315aa6235dc49c9828a568679c4c007d02eea1 (diff)
downloadscala-f40e29b44cd2d2f46313eb5122eca3ed3ee5c22e.tar.gz
scala-f40e29b44cd2d2f46313eb5122eca3ed3ee5c22e.tar.bz2
scala-f40e29b44cd2d2f46313eb5122eca3ed3ee5c22e.zip
moved to website directory
Diffstat (limited to 'doc')
-rw-r--r--doc/faq/Makefile2
-rw-r--r--doc/faq/faq.xml197
-rw-r--r--doc/faq/scala-faq.dtd32
-rw-r--r--doc/faq/scala-faq.xhtml.xsl106
-rw-r--r--doc/faq/xhtml.templates.xsl19
5 files changed, 0 insertions, 356 deletions
diff --git a/doc/faq/Makefile b/doc/faq/Makefile
deleted file mode 100644
index 9c35547a92..0000000000
--- a/doc/faq/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-faq.html: faq.xml
- xsltproc -o $@ $^
diff --git a/doc/faq/faq.xml b/doc/faq/faq.xml
deleted file mode 100644
index 193bba12ed..0000000000
--- a/doc/faq/faq.xml
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<?xml-stylesheet type="text/xsl" href="scala-faq.xhtml.xsl"?>
-<!DOCTYPE faq PUBLIC "-//lamp.epfl.ch//DTD Scala FAQ//EN"
- "scala-faq.dtd">
-
-<!-- This file is a collection of frequently asked questions on Scala -->
-
-<!-- You can link to entries in this document by using id attributes. -->
-<!-- Within the document, use the 'seealso' tag for this -->
-
-<!-- You can validate this file using C-c C-v. in [X]Emacs -->
-
-<faq>
-
- <!-- zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz -->
- <!-- General -->
- <!-- zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz -->
-
- <section title="General">
-
- <entry id="why">
- <question>Why another programming language ?</question>
- <answer>Read the rationale available on the <a
- href="http://scala.epfl.ch">Scala homepage</a></answer>
- </entry>
-
- <entry>
- <question>How can I get an executable program ?</question>
- <answer><p><em>First option</em>: use the Application mixin. Example:<code>
-class Foo with Application {
- ... // the code
-}
-</code></p>
-
- <p><em>Second option</em>: use an object that has a main method. E.g.
-<code><![CDATA[
-object Foo {
- def main(args:Array[String]):Unit = {
- ... //the code
- }
-}]]></code>
-Of course you can leave away the specification of the result type. In
-that case you should take care that your main function does not return
-something else. The latter would result in the virtual machine not finding
-your function.
-</p>
-</answer>
-
- </entry>
-
- <entry>
- <question>Is Scala stable enough to generate correct code for a
- larger scale real life projects? Isn't it dangerous to relay on a
- fresh project?</question>
-
- <answer>You should give it a try. It's quite stable and if you
-encounter an issue, you can submit the bug and we try to fix it as
-quickly as possible. As a workaround you can always implement the
-problematic part in Java.</answer>
-</entry>
-<entry>
-<question>
-What's the licensing conditions of the available Scala code? Does the Scala team endorse a specific license?
-</question>
-<answer>
-Currently, Scala is distributed under a BSD-style
-license. Consequently, there are almost no implications
-when redistributing the Scala binaries.
-</answer>
-</entry>
-
-<entry>
- <question>Is it possible to package the generated program so that the
-user does not have to install the full Scala environment? <p/>
-Basically, I just want to give the user a jar
-file which can be started by java -jar ... </question>
-<answer>
-The Scala distribution comes with several jar files
-in the lib subdirectory. If you want to package your
-Scala application in a way that doesn't require the
-user to install the full Scala environment, you simply
-have to distribute a copy of the lib/scala.jar file
-together with your application. You can even copy the
-content of the scala.jar file into your own jar file
-if you prefer this.
-
-</answer>
-</entry> </section>
-
- <section title="Programming">
- <entry>
- <question>
- What is the "standard" way to write a simple loop in
-Scala?
-<code>
- for (val i &lt;- Iterator.range(1,1000000)
-</code>
-or
-<code>
- var i = 1;
- while (i&lt;=1000000){ ...; i=i+1; }
-</code>
-</question>
-<answer>
-Both are fine, but in the current implementation the second one should be more efficient. </answer>
- </entry>
-
-<entry>
-<question>how can I catch exceptions in Scala?</question>
-
-<answer> You have to use standard pattern matching here (Java's
-"catch" clauses are really nothing more than a limited form of pattern
-matching).
-
-<code>
- try {
- ...
- } catch {
- case e: Exception => ...
- case e:IOException => ...
- }
-</code>
-</answer>
-</entry>
-
- </section>
-
-
-
- <!-- zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz -->
- <!-- Java InterOp -->
- <!-- zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz -->
- <section title="Java Interoperability">
- <entry>
-
-
- <question>
-I am currently implementing an application in Java. If I go over
-to Scala, can I use the existing stuff and link it with the new
-Scala code?</question>
-
-<answer>
-Accessing Java classes from Scala code is no problem at all. Using a Scala
-class from Java can get tricky, in particular if your Scala class uses
-advanced features like generics, polymorphic methods, or abstract types.
-Since Java doesn't have such language features, you have to know something
-about the encoding scheme of Scala classes. Otherwise, there should be
-no problems.
-</answer>
- </entry>
-
-<entry>
-<question>How easy is it to convert Java data structures to Scala, and vice versa?</question>
-
-<answer>
-You do not have to convert Java data structures at all for using them
-in Scala. You can use them "as is". For instance, Scala classes can
-subclass Java classes, you can instantiate Java classes in Scala, you
-can access methods, fields (even if they are static), etc.
-</answer>
-
-</entry>
- </section>
-
- <!-- zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz -->
- <!-- Less General -->
- <!-- zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz -->
-
- <section title="Limitations">
-<entry>
-<question>I want to use the Ord interface to handle Double, Int, and Char. Why doesn't it work ?</question>
-
-<answer>Currently, the class scala.Double (and all other value classes) are
-*not* a subclass of scala.Ord. This is an implementation restriction
-of our compiler. </answer>
-</entry>
-<!--
- <entry>
- <question>What were the first reactions when you released your language ?</question>
- <answer>
-<p>&quot;Wow! This is the coolest thing since Haskell and Ruby!&quot;</p>
-<p>&quot;Thanks, this is so cool, I can hardly believe it's true&quot;</p>
-<p>&quot;I have seen that Scala addresses the right questions. It will be interesting to see whether it also gives the right answers&quot;</p>
-
-<p>&quot;It seems somebody had the strong desire to do functional programming and still access Java and .NET classes</p>
-
-</answer>
- </entry>
--->
- <entry>
- <question>Why is feature XYZ not integrated ?</question>
- <answer>Convince us that it is useful. Make sure you read
- <seealso ref="why"/> before </answer>
- </entry>
- </section>
-
-</faq> \ No newline at end of file
diff --git a/doc/faq/scala-faq.dtd b/doc/faq/scala-faq.dtd
deleted file mode 100644
index b292e28ece..0000000000
--- a/doc/faq/scala-faq.dtd
+++ /dev/null
@@ -1,32 +0,0 @@
-<!ELEMENT faq (section)+>
-
-<!ELEMENT section (entry)+>
-<!ATTLIST section
- title CDATA #REQUIRED>
-
-<!ELEMENT entry (question,answer)>
-<!ATTLIST entry
- id ID #IMPLIED>
-
-<!ELEMENT question (#PCDATA)>
-<!ELEMENT answer (#PCDATA|a|code|p|seealso|ul)*>
-
-<!ELEMENT code (#PCDATA)>
-
-<!ELEMENT seealso EMPTY>
-<!ATTLIST seealso
- ref IDREF #REQUIRED>
-
-<!-- xhtml tags -->
-
-<!ELEMENT a (#PCDATA)>
-<!ATTLIST a
- href CDATA #REQUIRED>
-
-<!ELEMENT em (#PCDATA)>
-
-<!ELEMENT p (#PCDATA|a|em|ul|code)*>
-
-<!ELEMENT ul (li+)>
-<!ELEMENT li (#PCDATA|a|em)*>
-
diff --git a/doc/faq/scala-faq.xhtml.xsl b/doc/faq/scala-faq.xhtml.xsl
deleted file mode 100644
index 9695c88764..0000000000
--- a/doc/faq/scala-faq.xhtml.xsl
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
- <xsl:include href="xhtml.templates.xsl"/>
- <xsl:output method="html"/>
-
- <xsl:template match="/">
- <html>
- <h1>The Scala F.A.Q.</h1>
- <body bgcolor="#FFFFFF">
- <xsl:apply-templates/>
- </body>
- </html>
-
- </xsl:template>
-
- <xsl:template match="faq">
- <table>
- <tr><th>Table of Contents</th></tr>
- <xsl:for-each select="./section">
- <tr>
- <td>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat('#',generate-id(.))"/>
- </xsl:attribute>
- <xsl:number/>. <xsl:value-of select="@title"/>
-
- </a>
- </td>
- </tr>
- <xsl:for-each select="./entry">
- <tr>
- <td>
- <a>
- <xsl:attribute name="href">
- #<xsl:call-template name="entry.getId"/>
- </xsl:attribute>
- <xsl:call-template name="entry.fullName"/>
- </a>
- </td>
- </tr>
- </xsl:for-each>
- </xsl:for-each>
- </table>
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="section">
- <p/><p/>
- <xsl:param name="id"/>
- <b><a>
- <xsl:attribute name="name">
- <xsl:value-of select="generate-id()"/>
- </xsl:attribute>
- <xsl:number/>. <xsl:value-of select="@title"/>
- </a></b>
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="entry">
- <p><b>
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="entry.getId"/>
- </xsl:attribute>
- <xsl:call-template name="entry.fullName"/>
- </a></b>
- <br/>
- <xsl:apply-templates select="./answer"/>
- </p>
- </xsl:template>
-
- <xsl:template match="seealso">
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat('#',@ref)"/>
- </xsl:attribute>
- <xsl:for-each select="id(@ref)">
- <xsl:call-template name="entry.fullName"/>
- </xsl:for-each>
- </a>
- </xsl:template>
-
- <xsl:template match="code">
- <pre><xsl:value-of select="."/></pre>
- </xsl:template>
-
- <xsl:template name="entry.fullName">
- <xsl:number level="multiple" count="section|entry"/>.
- <xsl:value-of select="./question"/>
- </xsl:template>
-
- <xsl:template name="entry.getId">
- <xsl:choose>
- <xsl:when test="string(@id)">
- <xsl:value-of select="@id"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="generate-id()"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-</xsl:stylesheet>
diff --git a/doc/faq/xhtml.templates.xsl b/doc/faq/xhtml.templates.xsl
deleted file mode 100644
index 10ae56f7d8..0000000000
--- a/doc/faq/xhtml.templates.xsl
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
- <xsl:template match="a">
- <a><xsl:attribute name="href">
- <xsl:value-of select="@href"/>
- </xsl:attribute><xsl:value-of select="."/></a></xsl:template>
-
- <xsl:template match="em"><em><xsl:value-of select="."/></em></xsl:template>
-
- <xsl:template match="p"><p><xsl:apply-templates/></p></xsl:template>
-
- <xsl:template match="ul"><ul><xsl:apply-templates/></ul></xsl:template>
-
- <xsl:template match="li"><li><xsl:apply-templates/></li></xsl:template>
-
-</xsl:stylesheet> \ No newline at end of file