Skip to content

Instantly share code, notes, and snippets.

View skelton.lisp
(ql:quickload :ps-experiment :silent t)
(in-package :cl-user)
(defpackage <% @var name %>
(:use :cl
:parenscript
:ps-experiment)
(:export main
*dependencies*
*executor*))
View dolist-with-left.lisp
(defun replace-dot-in-tree (tree)
(labels ((rec (rest)
(cond
((consp rest) (let (result)
(dolist-with-left (elem left rest)
(push (rec elem) result))
(nreverse result)))
(rest (replace-dot-sep rest)))))
(rec tree)))
View 160120_init.el
(add-to-list 'load-path (expand-file-name "~/.emacs.d/site-lisp"))
;; ----- Install packages ----- ;;
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(defun install-packages (packages)
(let ((refreshed nil))
View prepare-for-emacs-in-centos.sh
#!/bin/bash
WORK_DIR=${HOME}/temp/install
EMACS_HOME=${HOME}/.emacs.d
SITE_LISP=${EMACS_HOME}/site-lisp
HYPER_SPEC=${EMACS_HOME}/docs/HyperSpec
if [ ! -d ${WORK_DIR} ]; then
mkdir -p ${WORK_DIR} -v
fi
View improved-prime-seive.ros
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(eval-when (:execute :load-toplevel :compile-toplevel)
(ql:quickload :cl-lazy)
(ql:quickload :cl-prime-number)
(ql:quickload :anaphora))
View defstruct-for-ps-fixed.lisp
(defmacro defstruct.ps (name-and-options &rest slot-description)
"This is the tiny subset of defsturt in terms of syntax.
name-and-options::= structure-name | (structure-name (:include included-structure-name {inherit-slot-description}*))
slot-description::= slot-name | (slot-name slot-init-form)"
(bind:bind (((:values name parent-info)
(parse-defstruct-name-and-options name-and-options))
(parent (car parent-info))
(slots
(parse-defstruct-slot-description slot-description)))
(setf slots (merge-defstruct-slots parent-info slots))
View defstruct-for-ps-wrong.lisp
(defpsmacro defstruct (name-and-options &rest slot-description)
"This is the tiny subset of defsturt in terms of syntax.
name-and-options::= structure-name | (structure-name (:include included-structure-name))
slot-description::= slot-name | (slot-name slot-init-form)"
(bind:bind (((:values name parent)
(parse-defstruct-name-and-options name-and-options))
(slots
(parse-defstruct-slot-description slot-description)))
(setf slots (merge-defstruct-slots parent slots))
(register-defstruct-slots name slots)
View test-ps-eval-order-execute.ros
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(ql:quickload :test-ps-eval-order)
(defpackage :ros.script.execute.ros.3658751573
(:use :cl
:parenscript
View test-ps-eval-order.lisp
(in-package :cl-user)
(defpackage test-ps-eval-order
(:use :cl
:parenscript)
(:export :print-ps))
(in-package :test-ps-eval-order)
(eval-when (:compile-toplevel :execute :load-toplevel)
(defpsmacro test-defpsmacro ()
`(setf ok "expanded by test-defpsmacro")))