Skip to content

Instantly share code, notes, and snippets.

View ympbyc's full-sized avatar
💭
Lisping in the mountains.

Minori Yamashita ympbyc

💭
Lisping in the mountains.
View GitHub Profile
@ympbyc
ympbyc / .TalkingLisps.md
Last active February 19, 2019 18:12
Talking REPL. Experimental interaction of different Lisp implementations. In this case CL, elisp and Scheme.

Talking Lisps

My lisp terminal

This is a sketch illustrating dynamic interactions between three different implementations of Lisp.
Common Lisp, Emacs Lisp, and an very old Scheme are engaged in a conversation and producing a very crude talking REPL.

It's by no means complete nor useful at this point but it's a good starting point.

@ympbyc
ympbyc / selection-restart.lisp
Last active January 10, 2019 12:52
Use restart mechanism to let user select from options.
(define-condition selection-required (simple-error)
((message :initarg :message :reader message))
(:report (lambda (c s) (format s "Selection required: ~A" (message c)))))
(defmacro selection-restarts (options message)
"Generates restart-case from given list of options. Useful for interactive selection."
(let ((x (gensym))
(rpt (gensym))
(i (gensym))
(name (gensym)))
@ympbyc
ympbyc / cepl-sdfs.lisp
Last active January 17, 2019 13:35
Easily composable signed distance functions for CEPL. Mostly untested.
(defpackage :distance-fns
(:use :cl :cepl :rtg-math :vari)
(:nicknames :df))
(in-package :df)
(defun-g rand ((co :vec2))
(fract (* (sin (dot co (v! 12.98 78.23))) 43758.54)))
@ympbyc
ympbyc / mirai-emacs-init.lisp
Created December 10, 2018 09:21
Archiving a historic piece of code. .emacs that allows emacs to interface with Mirai.
;; Original file can be found here: https://web.archive.org/web/20030317235658/http://www.snowcrest.net:80/dpriest/x.emacs
;; to start type alt-0 alt-x, then (hi-i:say-hi) at the prompt
;;(setq load-path (append load-path (list "x:/mirai-1-1/eli")))
(setq load-path (append load-path (list "d:/mirai-1-1/eli")))
(load "fi-site-init")
(setf fi::common-lisp-first-time nil)
"use strict";
document.addEventListener("DOMContentLoaded", function () {
var mainEl = document.getElementById("main");
//add page unique class to #main
mainEl.classList.add("page-" + location.href.split(/\/|\#|\?\&/)[3].replace("-copy", ""));
if (mainEl.classList.contains("page-architecture")) setTimeout(tagcloud, 100);
function qs (x) { return document.querySelector(x); }
document.addEventListener("DOMContentLoaded", ()=>{
var mainEl = document.getElementById("main");
//add page unique class to #main
var slug = location.href.split(/\/|\#|\?\&/)[3];
mainEl.classList.add("page-" + (slug || "ambientdesigns").replace("-copy", ""));
if (mainEl.classList.contains("page-architecture"))
(use srfi-1)
(define (mlf-symbol sym)
(string->symbol (string-append "$" (symbol->string sym))))
(define (compile expr)
(cond
[(number? expr) expr]
[(string? expr) (string-append "\"" expr "\"")]
[(symbol? expr) (mlf-symbol expr)]
@ympbyc
ympbyc / crazy-macro.lisp
Last active April 4, 2017 18:00
Carrot3 idea #1. Caller transforming macro rough sketch.
;;Strip down the core language to its bones and provide a really powerful macro facility.
;;Just skim over. Don't read carefully.
;;It's just an idea. I'm not happy with this yet.
;; Macros with ability to scan and transform callers of a function
(defmacro (deflazy fname . rest)
(let ((expr (last rest))
(params (butlast rest)))
`(= ,fname ,@params
@ympbyc
ympbyc / ctyp-323-cljs-memo.md
Last active January 23, 2017 23:35
Getting started with Typed Clojure's cljs checker!
@ympbyc
ympbyc / ctyp-dep-graph.svg
Last active January 18, 2017 06:18
Typed Clojure dependency graph. download raw and open in Adobe Illustrator.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.