(Scheme) call/cc ; Simulating break (call/cc (lambda (break) (for ([x (in-range 0 10)]) (cond [(= x 5) => (break)]) (displayln x)))) => 0 1 2 3 4 http://vijaymathew.wordpress.com/2009/07/22/yaaec-yet-another-attempt-to-explain-continuations/ Programming 2012.09.11
(Haskell) Hello World http://www.haskell.org/haskellwiki/Haskell_in_5_steps main = putStrLn "Hello, World!" Save this to hello.hs To run, run runhaskell hello.hs To compile, run ghc hello.hs Programming 2012.09.10
(Racket) file->string http://docs.racket-lang.org/reference/Filesystem.html#(def._((lib._racket/file..rkt)._file-~3estring)) (file->string path [#:mode mode-flag]) → string? path : path-string? mode-flag : (or/c 'binary 'text) = 'binary Reads all characters from path and returns them as a string. The mode-flag argument is the same as for open-input-file. Programming 2012.09.09
Racket define-syntax-rule > (define-syntax-rule (% a b) (modulo a b)) > (% 10 3) 1 Programming 2012.09.08
Lisp: Common Lisp, Scheme, Clojure, Emacs Lisp: a side-by-side reference sheet http://hyperpolyglot.org/lisp Programming 2012.09.08
Clojure의 장단점 장점: 1. JVM 사용 단점: 1. "tail call optimization" (TCO)를 하지 않는다. 재귀를 위해 loop이나 recur라는 special form을 사용해야 함 http://java.ociweb.com/mark/clojure/article.html#Recursion (loop [x 10] (when (> x 1) (println x) (recur (- x 2)))) 2. call/cc 가 없다. http://stackoverflow.com/questions/1173133/continuations-in-clojure Programming 2012.09.07
Best In Class: Python vs Clojure - Evolving http://www.bestinclass.dk/index.clj/2009/10/python-vs-clojure-evolving.html This is an interesting time to review programming languages! On the one hand I see a general tendency that companies and individuals are leaving the old (un)safe paths and are embracing 'newer' technologies and on the other we see some of these new-comers now moving into maturity. Python has been with us since the late 1.. Programming 2012.09.06
Performance in DrRacket http://docs.racket-lang.org/guide/performance.html 18.1 Performance in DrRacket By default, DrRacket instruments programs for debugging, and debugging instrumentation can significantly degrade performance for some programs. Even when debugging is disabled through the Choose Language... dialog’s Show Details panel, the Preserve stacktrace checkbox is clicked by default, which also affects perform.. Programming 2012.09.05
Inferior Emacs Lisp Mode (ielm) http://emacswiki.org/emacs/InferiorEmacsLispMode IELM: Inferior Emacs Lisp Mode A nice little mode that acts like an interactive Lisp interpreter. It doesn’t do all the fancy shell stuff such as redirection – use the EmacsShell if you need that. IELM is an alternative to Lisp Interactive mode, which is the mode of buffer ‘*scratch*’. Start it using ‘M-x ielm’. It’s real little read-eval-print lo.. Programming 2012.09.05