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 / 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 /
Last active Feb 19, 2019
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 / 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 / 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 / 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:
;; 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"))
View carrot3->malfunction.scm
(use srfi-1)
(define (mlf-symbol sym)
(string->symbol (string-append "$" (symbol->string sym))))
(define (compile expr)
[(number? expr) expr]
[(string? expr) (string-append "\"" expr "\"")]
[(symbol? expr) (mlf-symbol expr)]
ympbyc / crazy-macro.lisp
Last active Apr 4, 2017
Carrot3 idea #1. Caller transforming macro rough sketch.
View crazy-macro.lisp
;;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 /
Last active Jan 23, 2017
Getting started with Typed Clojure's cljs checker!
You can’t perform that action at this time.