とにかく始めるClojure

2,308 views
2,269 views

Published on

clojure

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,308
On SlideShare
0
From Embeds
0
Number of Embeds
134
Actions
Shares
0
Downloads
8
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

とにかく始めるClojure

  1. 1. http://tinyurl.com/2fhzp5p
  2. 2.   (let ((buffer (url-retrieve-synchronously "http://tromey.com/elpa/package-install.el")))  (save-excursion    (set-buffer buffer)    (goto-char (point-min))    (re-search-forward "^$" nil move)    (eval-region (point) (point-max))    (kill-buffer (current-buffer))))
  3. 3. ;;; This was installed by package-install.el.;;; This provides support for the package system and;;; interfacing with ELPA, the package archive.;;; Move this code earlier if you want to reference;;; packages in your .emacs.(when    (load     (expand-file-name "~/.emacs.d/elpa/package.el"))  (package-initialize))
  4. 4. M-x package-install <ret> slime (require slime)
  5. 5. M-x package-install <ret> slime-repl (require slime-repl) (setq slime-net-coding-system utf-8-unix       slime-protocol-version ignore) (slime-setup (slime-repl))
  6. 6. M-x package-install <ret> clojure-mode (require clojure-mode) (add-to-list auto-mode-alist (".clj$" . clojure-mode))
  7. 7. (defproject sample-program "1.0.0-SNAPSHOT"  :description "FIXME: write"  :dependencies [[org.clojure/clojure "1.2.0"]                 [org.clojure/clojure-contrib "1.2.0"]])(defproject sample-program "1.0.0-SNAPSHOT"  :description "FIXME: write"  :dependencies [[org.clojure/clojure "1.2.0"]                 [org.clojure/clojure-contrib "1.2.0"]]  :dev-dependencies [[swank-clojure "1.2.1"]])
  8. 8. $ lein deps$ lein swank
  9. 9. (ns sample-program.core)(def fib-seq     (lazy-cat [0 1] (map + (rest fib-seq) fib-seq)))(defn fib [n]  (nth fib-seq n))

×