ChangeLog を書く際によく使われる英語をまとめました。
ほとんど引用です。
基本的な文法です。あとは単語を知っていれば大体なんとかなるそうです。
-- 「最もシンプルなソート」をHaskellでnaiveに実装した、ようなもの | |
-- 「naiveな」という断りは、本来のアルゴリズムではin-placeな置換を行う箇所を | |
-- 全てappendで実現していることによる。 | |
-- (即ち、元アルゴリズムとは空間計算量が異なるため、これは「異なるアルゴリズム」 | |
-- もしくは「アルゴリズムの実装誤り」という扱いになる。 | |
-- が、本実装は、in-place置換を含めた完全な実装をそもそも志向しておらず、 | |
-- 単に「"simpleSortIn indexList xs" で二重ループを添え字のtupleのリストで置き換える」 | |
-- というアイデアを実現することのみに注力するものである。 | |
-- したがって、元アルゴリズムとのin-place置換周りの差異がどうしても気になるのであれば | |
-- 各自 swapper 周りの定義を適宜修正されたし) |
(defvar true t) | |
(defvar false nil) | |
(defun -> (p q) (or (not p) q)) | |
(defun booleanp (formula) | |
(or (eq formula 'true) (eq formula 'false) | |
(eq formula t) (eq formula nil) )) | |
(defun atomic-fomula-p (formula) |
;;; prime factorization | |
;;; Copyright (C) 2015 SUZUKI Shingo ([email protected]) | |
;;; Lisence: MIT | |
(defun prime-factorization (num) | |
(cond ((= num 0) (list 0)) | |
((= num 1) (list 1)) | |
((= num -1) (list -1)) | |
((< num 0) (cons -1 (prime-factorization (- num)))) | |
(t (reform-factor-list |
;;;; hello-world.lisp - Common Lisp | |
(defun get-universal-character () | |
(elt (string-upcase (and)) (length (or))) ) | |
(defun prev-code (code) | |
(- code (length (list code))) ) | |
(defun succ-code (code) | |
(+ code (length (list code))) ) |
(defun delete-method (gf-symbol qualifier-list param-list) | |
(declare (type symbol gf-symbol) | |
(type list qualifier-list param-list) ) | |
(let* ((gf (ensure-generic-function gf-symbol)) | |
(method (find-method | |
gf qualifier-list | |
(mapcar #'(lambda (elm) | |
(if (listp elm) | |
elm ; for (eql symbol) style | |
(find-class elm)) ) |
(ql:quickload :cl-case-control) | |
(defmacro build-make-n-tuple-of (args) | |
(let ((expanded (eval args))) | |
`(progn | |
,@(loop for elm in `(,@expanded) | |
collect (list 'build-make-n-tuple elm)) | |
nil ))) | |
(defmacro build-make-n-tuple (n) |
(defun z (f) | |
((lambda (x) | |
(funcall f (lambda (&rest args) | |
(apply (funcall x x) args) ))) | |
(lambda (x) | |
(funcall f (lambda (&rest args) | |
(apply (funcall x x) args) ))))) | |
(defvar fact | |
(lambda (f) |
(defun map-update (fun src &rest lists) | |
(funcall | |
(reduce (lambda (cont list-elms) | |
(lambda () | |
(apply fun (funcall cont) list-elms) )) | |
(apply #'mapcar #'list lists) | |
:initial-value (constantly src) ))) | |
(defun subst-all (to-list from-list src) | |
(map-update |