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
(defun deep-rev (list) | |
(if (or (null list) (not (listp list))) list | |
(reverse (mapcar 'deep-rev list)))) |
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
(require 'org-publish) | |
(setq org-publish-project-alist | |
'(("org-notes" | |
:base-directory "~/scratch/org/" | |
:base-extension "org" | |
:publishing-directory "~/scratch/public_html/" | |
:recursive t | |
:publishing-function org-publish-org-to-html | |
:headline-levels 4 ; Just the default for this project. | |
:auto-preamble t |
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
- printTree t; | |
a | |
/ \ | |
b c | |
/ \ / \ | |
d e x y | |
/ \ | |
q w | |
val it = () : unit |
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
- val tree = Node("a",Node("b",Leaf,Leaf),Node("c",Leaf,Leaf)); | |
val tree = Node ("a",Node ("b",Leaf,Leaf),Node ("c",Leaf,Leaf)) : string tree | |
- printTree tree; | |
a | |
/ \ | |
b c | |
val it = () : unit | |
- val tree' = Node("x",Node("y",Leaf,Leaf),Node("z",Node("q",Leaf,Leaf),Node("w",Leaf,Leaf))); |
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
(* | |
CM.make "$/regexp-lib.cm"; | |
*) | |
val getc: string -> (char, int) StringCvt.reader = | |
fn s => fn i => | |
if (i < String.size s) | |
then SOME(String.sub(s, i), i+1) | |
else NONE |
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
(add-hook 'sml-mode-hook (lambda () (defun sml-smie-rules (kind token) 7)))))) |
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
datatype Sexp = Satom of string | Scons of Sexp * Sexp | Snil | |
(* returns a string representation of an Sexp *) | |
fun showSexp s = | |
let | |
(* if fresh, Sexp is the head of a new list, not an inner cons cell *) | |
fun showSexp' Snil _ = "nil" | |
| showSexp' (Satom a) fresh = | |
if not fresh | |
then ". " ^ a (* dotted tail notation *) |
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
structure Set : ORD_SET = IntListSet | |
structure Map : ORD_MAP = ListMapFn( | |
struct | |
type ord_key = Set.set | |
val compare = Set.compare | |
end) | |
val m = Map.insert(Map.empty, Set.singleton 1, 2) |
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.el stuff | |
(require 'package) | |
(add-to-list 'package-archives | |
'("marmalade" . "http://marmalade-repo.org/packages/") t) | |
(package-initialize) | |
(when (not package-archive-contents) | |
(package-refresh-contents)) | |
(defvar my-packages '(color-theme-solarized magit smex sml-mode)) | |
(dolist (p my-packages) | |
(when (not (package-installed-p p)) |
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
public class Chain | |
{ | |
@ThreadSafe | |
public void threadSafeMethod() | |
{ | |
middleman(); | |
} | |
public void middleman() | |
{ | |
notThreadSafeMethod(); |