diff options
Diffstat (limited to 'doc/faq')
-rw-r--r-- | doc/faq/faq.xml | 45 | ||||
-rw-r--r-- | doc/faq/scala-faq.dtd | 2 | ||||
-rw-r--r-- | doc/faq/scala-faq.xhtml.xsl | 13 |
3 files changed, 52 insertions, 8 deletions
diff --git a/doc/faq/faq.xml b/doc/faq/faq.xml index 65f5f6bfeb..fd9bf1e1de 100644 --- a/doc/faq/faq.xml +++ b/doc/faq/faq.xml @@ -3,19 +3,58 @@ <!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 rational on the <a + <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> + </section> + <!-- zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz --> + <!-- Less General --> + <!-- zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz --> + <section title="Less General"> <entry> - <question>Why is feature XYZ not integrated</question> + <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> diff --git a/doc/faq/scala-faq.dtd b/doc/faq/scala-faq.dtd index 1604489d4d..b292e28ece 100644 --- a/doc/faq/scala-faq.dtd +++ b/doc/faq/scala-faq.dtd @@ -25,7 +25,7 @@ <!ELEMENT em (#PCDATA)> -<!ELEMENT p (#PCDATA|a|em|ul)*> +<!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 index 94620fba8e..5f8ed82ec2 100644 --- a/doc/faq/scala-faq.xhtml.xsl +++ b/doc/faq/scala-faq.xhtml.xsl @@ -6,6 +6,7 @@ <xsl:template match="/"> <html> + <h1>The Scala F.A.Q.</h1> <body bgcolor="#FFFFFF"> <xsl:apply-templates/> </body> @@ -48,23 +49,23 @@ <xsl:template match="section"> <p/><p/> <xsl:param name="id"/> - <a> + <b><a> <xsl:attribute name="name"> <xsl:value-of select="generate-id()"/> </xsl:attribute> <xsl:number/>. <xsl:value-of select="@title"/> - </a> + </a></b> <xsl:apply-templates/> </xsl:template> <xsl:template match="entry"> - <p> + <p><b> <a> <xsl:attribute name="name"> <xsl:call-template name="entry.getId"/> </xsl:attribute> <xsl:call-template name="entry.fullName"/> - </a> + </a></b> <br/> <xsl:apply-templates select="./answer"/> </p> @@ -81,6 +82,10 @@ </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"/> |