This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SIMPL | |
// A Serial Interpreted Minimal Programming Language | |
// Inspired by Txtzyme - by Ward Cunningham | |
// Ken Boak 2013 - 2016 | |
// Filename simpl_2015_32bit_list8 | |
// Requires UART routines - compiles on Arduino 1.04 | |
// This is the slim version of simpl that removes all of the Arduino specific routines |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Tiny FORTH | |
; T. NAKAGAWA | |
; 2004/08/02-05 | |
; Additional comments by Ken Boak Jan 2016 | |
; Register | |
; r0: temporary | |
; r1-15: input buffer (terminated by 0x00, separated by 0x20) | |
; r16: temporary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Very Tiny Language T. Nakagawa 2004/05/23 2004/06/26 | |
#include <uart.h> | |
#include <avr/io.h> | |
#define F_CPU 16000000UL // define the clock frequency as 16MHz | |
#define BAUD 115200*2 | |
#include <util/setbaud.h> // Set up the Uart baud rate generator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn update-keys-naive | |
"m f => {(f k) v ...} | |
Given a map m and a function f of 1-argument, returns a new map whose | |
keys are the result of applying f to the keys of m, mapped to the | |
corresponding values of m. | |
f must return a unique key for each key of m." | |
{:added "1.11"} | |
[m f] | |
(let [ret (with-meta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ded | |
"Structural Data EDitor for Clojure with zippers. Inspired by Interlisp: http://larry.masinter.net/interlisp-ieee.pdf" | |
(:require [clojure.zip :as z]) | |
(:use [clojure.pprint :only (with-pprint-dispatch code-dispatch pprint)] | |
[clojure.repl :only (source-fn)])) | |
(defn print-hr | |
"Prints 30 dashes and a newline." | |
[c] | |
(println (apply str (repeat 30 c)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deflinked abclink [a b c]) | |
;; expands to | |
(defn abclink [params] | |
(let [[to] (when-let [t (:to params)] (clojure.tools.build.api/qualify-fn-symbols [t]))] | |
(loop [parms params | |
remaining-tasks [build/a build/b build/c]] | |
(let [task (first remaining-tasks)] | |
(if task |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas id="c" width="1024" height="1024"> | |
<script> | |
// https://js.do | |
const context = c.getContext('2d'); | |
for (let x = 0; x < 256; x++) { | |
for (let y = 0; y < 256; y++) { | |
if ((x ^ y) % 9) { | |
context.fillRect(x*4, y*4, 4, 4); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns com.manigfeald.http2.cont) | |
(defn bind% [m f] | |
(fn [kont bundle] | |
(m (fn [value] ((f value) kont bundle)) bundle))) | |
(defmacro return% [value] | |
`(fn [kont# bundle#] | |
((try | |
(let [v# ~value] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(comment | |
;; original emit on RHS of map destructure form | |
(if (seq? kvs) | |
(clojure.lang.PersistentHashMap/create (seq kvs)) | |
kvs) | |
) | |
(defn create-bl [& kvs] | |
;; replacement code for RHS of map destructure form |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn add [& {:keys [:a :b]}] | |
(+ a b)) | |
(add :a 1 :b 2) | |
;;=> 3 | |
(add :a) | |
;;= No value supplied for key: :a | |
(add {:a 1 :b 2}) |