
18 juin 2010 à 11 h 05
Samuel Tardieu dans
Cours
pre.code {
border:1px dashed #ccc;
background-color:#f5f5f5;
padding:5px;
font-size:150%;
color:#000000;
}
.NULL {
color: #000000;
}
.COMMENT1 {
color: #cc0000;
}
.COMMENT2 {
color: #ff8400;
}
.COMMENT3 {
color: #6600cc;
}
.COMMENT4 {
color: #cc6600;
}
.DIGIT {
color: #ff0000;
}
.FUNCTION {
color: #9966ff;
}
.INVALID {
background: #ffffcc;
color: #ff0066;
}
.KEYWORD1 {
color: #006699;
font-weight: bold;
}
.KEYWORD2 {
color: #009966;
font-weight: bold;
}
.KEYWORD3 {
color: #0099ff;
font-weight: bold;
}
.KEYWORD4 {
color: #66ccff;
font-weight: bold;
}
.LABEL {
color: #02b902;
}
.LITERAL1 {
color: #ff00cc;
}
.LITERAL2 {
color: #cc00cc;
}
.LITERAL3 {
color: #9900cc;
}
.LITERAL4 {
color: #6600cc;
}
.MARKUP {
color: #0000ff;
}
.OPERATOR {
color: #000000;
font-weight: bold;
}
body, button {
font:9pt « Lucida Grande », « Lucida Sans [...]

10 juin 2010 à 23 h 05
Samuel Tardieu dans
Cours
pre.code {
border:1px dashed #ccc;
background-color:#f5f5f5;
padding:5px;
font-size:150%;
color:#000000;
}
.NULL {
color: #000000;
}
.COMMENT1 {
color: #cc0000;
}
.COMMENT2 {
color: #ff8400;
}
.COMMENT3 {
color: #6600cc;
}
.COMMENT4 {
color: #cc6600;
}
.DIGIT {
color: #ff0000;
}
.FUNCTION {
color: #9966ff;
}
.INVALID {
background: #ffffcc;
color: #ff0066;
}
.KEYWORD1 {
color: #006699;
font-weight: bold;
}
.KEYWORD2 {
color: #009966;
font-weight: bold;
}
.KEYWORD3 {
color: #0099ff;
font-weight: bold;
}
.KEYWORD4 {
color: #66ccff;
font-weight: bold;
}
.LABEL {
color: #02b902;
}
.LITERAL1 {
color: #ff00cc;
}
.LITERAL2 {
color: #cc00cc;
}
.LITERAL3 {
color: #9900cc;
}
.LITERAL4 {
color: #6600cc;
}
.MARKUP {
color: #0000ff;
}
.OPERATOR {
color: #000000;
font-weight: bold;
}
body, button {
font:9pt « Lucida Grande », « Lucida Sans [...]

4 juin 2010 à 15 h 10
Samuel Tardieu dans
Cours
package net.rfc1149.cours2
import scala.actors.{Actor,Futures,Scheduler,TIMEOUT}
import Futures._
// Demonstration of object unbuilding using unapply.
// This will be used for pattern matching.
object TripleOf {
def apply(n: Int): Int = 3 * n
def unapply(n: Int): Option[Int] =
if (n % 3 == 0) Some(n/3) else None
}
// Simple matching returning a boolean, no possibility of variable [...]

25 mai 2010 à 21 h 31
Samuel Tardieu dans
Cours
Voici les notes de cours d’Alexandre Bertails.
// * syntaxe
// light
var capital = Map("US" -> "Washington", "France" -> "Paris")
capital += ("Japan" -> "Tokyo")
println(capital("France"))
// function
def factorial(x: BigInt): BigInt =
if (x == 0) 1 else x * factorial(x – 1)
// multiline
val s = """
ici
la
"""
// val / var
Map -> mutable and immutable
// this is Java
class Rational {
[...]

18 mai 2010 à 15 h 00
Samuel Tardieu dans
Cours
; Suite au TD, voici une manière d’implémenter une fonction récursive
; non nommée qui s’invoque elle-même sans utiliser de boucle nommée.
; Implémentation et test de "while" en utilisant cette fonction.
; Stockage d’une continuation dans la variable globale "x". On
; peut invoquer "(example)", puis "(x 42)" pour en voir l’effet.
"Hello, world!\n"; Les continuations stoquent également l’arbre [...]

10 mai 2010 à 16 h 33
Samuel Tardieu dans
Cours
Ces notes ne reprennent pas les types de base de Scheme et les prédicats d’équivalence.
; Définition simple: dans toute la suite, "three" est lié à la valeur 3.
; Définition de "plus" comme ayant la valeur de la procédure "+".
; Définition simple d’une fonction définissant un calcul.
; Définition compacte de la même fonction.
; "adder" renvoie une [...]
Commentaires récents