http://www.fontpalace.com/font-details/Consolas/
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
BEGIN{ | |
HE="36DA5B7FEC924801" | |
BI="0011010111100100001" | |
H2B["0"]="0000" | |
H2B["1"]="0001" | |
H2B["2"]="0010" | |
H2B["3"]="0011" | |
H2B["4"]="0100" | |
H2B["5"]="0101" |
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
総称関数を高速化してみよう(総称関数でない) | |
元ネタ | |
- http://www.doc.gold.ac.uk/~mas01cr/talks/ | |
- http://www.doc.gold.ac.uk/~mas01cr/talks/2009-05-28%20Milan/string=-specializers.lisp | |
MOPでコード生成して高速化を図るらしい。 | |
面白そうなので真似してみよう。 |
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
レンズは余状態余モナドの余代数だった | |
=================================== | |
余余余〜!別名`関数的参照`とも呼ばれる[レンズ](https://hackage.haskell.org/package/lens)はJavaのGetter, Setterと同等と[言われる](https://twitter.com/plt_borat/status/228009057670291456)関数型プログラミングのデザインパターンの一つです。 | |
レンズは余状態余モナドの余代数だと[聞いて](https://twitter.com/hiratara/status/317602743219003392)そうなのかーと思ってたのですが、ふと自分で実装してみたくなったので **余状態余モナドの余代数** として実装してみることにしました。 | |
ちなみにこの文章は`literate Haskell`という形式で書かれているのでダウンロードしてghciでロードすればすぐにでも自分で試すことができます。 | |
まず最初におまじない | |
> {-# LANGUAGE RankNTypes #-} |
Language | ||||||||
---|---|---|---|---|---|---|---|---|
Common Lisp | mapc | mapcar | find-if | remove-if-not | reduce | reduce :from-end t | some | every |
Scheme | for-each | map | find | filter | fold, fold-left | fold-right | any, exists | every, for-all |
Haskell | mapM_ | map | find | filter | foldl | foldr | any | all |
Caml Light | do_list | map | - | - | it_list | list_it | exists | for_all |
OCaml | iter | map | find | filter, find_all | fold_left | fold_right | exists | for_all |
F# | iter | map | find | filter | fold | foldBack | exists | forall |
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
(format t "~&~@{~{~A~^ ~}~^~%~}" | |
`("Lisp:" ,(lisp-implementation-type) ,(lisp-implementation-version)) | |
#+quicklisp `("Quicklisp:" "Version",(quicklisp-client::local-version) ,(ql-dist:all-dists)) | |
#-quicklisp `("Quicklisp:" "Not installed")) |
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
#!r6rs | |
(import (only (rename (rnrs) (cons %cons) (+ %+)) | |
define lambda let display newline integer->char length | |
quote %cons)) | |
(define cons (lambda (x y) (lambda (z) (z x y)))) | |
(define car (lambda (z) (z (lambda (x y) x)))) | |
(define cdr (lambda (z) (z (lambda (x y) y)))) | |
(define true (lambda (x y) (x))) |
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
;; Macros in this file provides a "autoload" facility like Emacs Lisp has. | |
;; These are supposed to be used in a Lisp init file. | |
;; | |
;; Without those, you have to load all libraries you not sure whether they will be used or not. | |
;; | |
;; (ql:quickload :repl-utilities) | |
;; (use-package :repl-utilities) | |
;; | |
;; "Autoload" facility delays loading libraries until they are needed. | |
;; See the following 3 macros and their documentations. |
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
(ql:quickload '(chipz archive)) | |
(defun extract-tarball (pathname) | |
"Extract a tarball (.tar.gz) file to a directory (*default-pathname-defaults*)." | |
(with-open-file (tarball-stream pathname | |
:direction :input | |
:element-type '(unsigned-byte 8)) | |
(archive::extract-files-from-archive | |
(archive:open-archive 'archive:tar-archive | |
(chipz:make-decompressing-stream 'chipz:gzip tarball-stream) |
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
(cl:defpackage :rss-reader.datetime | |
(:use :cl) | |
(:import-from :cl-ppcre :create-scanner :scan) | |
(:export :parse-rfc-2822-timestring)) | |
(cl:in-package :rss-reader.datetime) | |
(defvar *day-of-week* | |
'("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun")) |
NewerOlder