Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Lisping in the mountains.

Minori Yamashita ympbyc

💭
Lisping in the mountains.
View GitHub Profile
View R1-on-S2-in-R3.txt
The steel needle cuts through the hills sawing together the cool night.
The needle propells along the curve around the hill.
Sudden light the color of cream shines hard on the silver steel.
Rising moon with bright smokey ring hang low above montains.
The steel maintains momentum and sings in visible frequency.
The sky cassies the disk away in exchange for the light-emitting vertices.
2-sphere has a 3-sky. Does the 3-space have a 4-sky?
@ympbyc
ympbyc / replacer.lisp
Last active May 5, 2020
html/xml batch structural replacer
View replacer.lisp
(defpackage :replacer
(:use :cl :plump :clss))
(in-package :replacer)
(defun slurp (path)
(with-open-file (stream path)
(let ((data (make-string (file-length stream))))
(read-sequence data stream)
data)))
@ympbyc
ympbyc / emacs-biwa.el
Last active May 18, 2020 — forked from BilalQadri/emacs-biwa.el
Biwascheme from Emacs (with repl)
View emacs-biwa.el
;; Initialize Biwascheme interpreter on frontend(browser) then send and receive expressions with websocket client
;; INSTALL websocket.el, LOAD this file and RUN interactive function `load-ws` from Emacs
;; ws-close to close server
;; send expression (e.g functions) to browser with `C-c C-s` ... Tip# cursor should be on function name
(require 'websocket)
(require 'scheme)
(defun biwa-start ()
(interactive)
;(load-file "~/.emacs.d/websocket.el")
@ympbyc
ympbyc / forth.ny
Last active Nov 29, 2019
linear programming language
View forth.ny
;;;;;;;;; Forth a la Let over Lambda ;;;;;;;;
(defvar forth-registers
'(pstack rstack pc dict compiling dtable))
(defun sym (&rest strs)
(intern (string-upcase (apply #'strcat (mapcar #'string strs)))))
(defmacro defstruct (name &rest slots)
(let ((n -1))
@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 Jun 5, 2020
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)))