This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package multiserver; | |
import java.net.*; | |
import java.io.*; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class MultiServer { | |
protected ServerSocket serverSocket = null; | |
protected boolean listening = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
signature FOO = | |
sig | |
type 'a foo | |
val f : 'a -> 'a foo | |
end | |
signature BAR = | |
sig | |
structure Foo : FOO | |
val p : 'a -> bool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Først defineres en signatur for lister. Den indeholder nogle | |
* af de mest elementære operationer, man kan lave på lister. *) | |
signature LISTE = | |
sig | |
type 'a liste | |
val null : 'a liste -> bool | |
val empty : 'a liste | |
val cons : 'a * 'a liste -> 'a liste | |
val hd : 'a liste -> 'a | |
val tl : 'a liste -> 'a liste |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
infixr 0 $ | |
fun f $ x = f x | |
val concat = List.concat | |
fun good_cartesian_product (xs, ys) = | |
concat (map (fn y => map (fn x => (x,y)) xs) ys) | |
fun evil_cartesian_product (xs', ys') = | |
let | |
val result = ref [] |
NewerOlder