Skip to content

Instantly share code, notes, and snippets.

💭
Lisping in the mountains.

Minori Yamashita ympbyc

💭
Lisping in the mountains.
Block or report user

Report or block ympbyc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ympbyc
ympbyc / universal-lisp-transpiler.lisp
Last active Sep 14, 2019
[sketch] tools to write transpilers from sexpr to Blub languages. For when you are in the direst situation.
View universal-lisp-transpiler.lisp
;;[sketch] tools to write transpilers from sexpr to Blub languages.
;;For when you are in the direst situation.
;; copyleft Minori Yamashita
(defpackage :ult
(:use :cl))
(in-package :ult)
(defpackage :ult-symspace)
@ympbyc
ympbyc / pieces-biwa.scm
Last active Aug 20, 2019
BiwaScheme glue functions
View pieces-biwa.scm
;;;;;;;;;;;;;;;;;;;;;
;;; generic utils ;;;
;;;;;;;;;;;;;;;;;;;;;
(print "loading generic utils")
;;convenient shorthand for lambda (^ (x) x)
(define-macro (^ params expr)
`(lambda ,params ,expr))
;;normalize parameter list e.g. (x), xs, (x . xs) into (x), (xs), (x xs)
@ympbyc
ympbyc / tech-memo.txt
Last active Aug 12, 2019
Memo on making a minimally viable workstation
View tech-memo.txt
Tech Memo on Minimaly viable work environment
=============================================
Essentials
----------
+ w3m
+ fb-messenger-cli (use with M-x term then M-x mozc-mode)
+ emacs-mozc-bin -- japanese input
@ympbyc
ympbyc / slime-external-timeout.el
Last active Mar 13, 2019
Every n seconds check if slime repl is actively updated. if not, interrupt and call a restart that gives up on current operation that's causing the hangup e.g. sockets
View slime-external-timeout.el
;; every 60 seconds check if slime repl buffer has been updated
;; if not intterupt and call restart-1
;; which should abort whatever is causing the hungup and continues
(defvar *slime-repl-last-output* "")
(defvar *slime-repl-watchdog-timer* nil)
(defun handle-sldb-restart ()
(sldb-invoke-restart-1) ;; change here
(message "Invoked restart-1 upon detecting a hungup."))
@ympbyc
ympbyc / .TalkingLisps.md
Last active Feb 19, 2019
Talking REPL. Experimental interaction of different Lisp implementations. In this case CL, elisp and Scheme.
View .TalkingLisps.md

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 Jan 10, 2019
Use restart mechanism to let user select from options.
View selection-restart.lisp
(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 Jan 17, 2019
Easily composable signed distance functions for CEPL. Mostly untested.
View cepl-sdfs.lisp
(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 Dec 10, 2018
Archiving a historic piece of code. .emacs that allows emacs to interface with Mirai.
View mirai-emacs-init.lisp
;; 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)
View yuri-bbl.js
"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);
View yuri-ambientdesign.js
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"))
You can’t perform that action at this time.