Skip to content

Instantly share code, notes, and snippets.

;; Lambkin, a garbage-collected heap suitable for microcontrollers.
;; Copyright (C) 2015 Andy Wingo <[email protected]>.
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@nikodemus
nikodemus / bt.lisp
Last active July 14, 2022 05:46
Showing why conditions are a bad match for doing backtracking -- all you need is CATCH/THROW and a special variable.
;;;; In response to:
;;;;
;;;; http://www.reddit.com/r/lisp/comments/3710zq/directed_procrastination_backtracking_with_the/
;;;; http://directed-procrastination.blogspot.se/2011/05/backtracking-with-common-lisp-condition.html
;;;;
;;;; Demonstrating why one should not use conditions for this kind of stuff,
;;;; instead using the dynamic binding and unwinding facilities on which the
;;;; condition system is built. The author's backtracking system doesn't compare
;;;; badly to Screamer because his is simple: it compares badly because using
;;;; conditions is a bad match for the task.
#!/usr/bin/cl -Q -sp coleslaw --entry entry
;;;;
;; This script assumes it is executed from the repository's top level directory
;; to determine correctly the blog-dir variable.
;;;;
;; (coleslaw:preview #P"/home/puercopop/Projects/RunaRimac/hello-world.md")
(defun entry (argv)
(declare (ignorable argv))
(let
@deplinenoise
deplinenoise / Asm
Created July 30, 2014 21:36 — forked from emoon/Asm
; Pure Lisp based assembler
(def my-fun (input1 :in d1
input2 :in d2
output :out d0)
(move.l input1 output)
(add.l input2 output))
----------------------------------------------------------------------------------------
; We can also have loop constructions by doing a macro (no need for it to be 'built-in')
(defun event-p (x) t) ;; constantly t
(defun key-p (x) t) ;; constantly t
;; w/o defpattern
(match event
((and (sdl:event- (type (eq :key-down-event)))
;;^^^^^^^^^^ this specify the container type
;;^^^^ this is a slot
;; ^^^^^^^^^^^^^^^^^^ and this specifies the type of the slot.
(sdl::key- (key (eq :sdl-key-z)) state)))
@PuercoPop
PuercoPop / First draft.lisp
Last active August 29, 2015 14:01
Fuck lispbuilder's event-loop
(in-package :famiclom)
(require 'sb-sprof)
(defun check-for-input ()
(let ((event (sdl:new-event)))
(loop
;; Pops the event-queue and binds it to event, return 0 if no pending
;; events.
:for event-poll = (sdl-cffi::SDL-Poll-event event)
@michaeljforster-zz
michaeljforster-zz / react-tutorial.lisp
Created May 9, 2014 12:11
Facebook's React assimilated
(in-package #:grok-cl-parenscript-react)
(hunchentoot:define-easy-handler (handle-tutorial :uri "/tutorial")
()
(cl-who:with-html-output-to-string (stream)
(:html
(:head
(:title "React Tutorial")
(:script :type "text/javascript" :src *react-url*))
(:body
#!/usr/bin/env ruby
# coding: utf-8
abort "Usage: fuck you <name>" unless ARGV[0] == "you" && ARGV.size == 2
a = "abcdefghijklmnopqrstuvqxyz".each_char.to_a
b = "ɐqɔpǝɟƃɥıɾʞʃɯuodbɹsʇnʌʍxʎz".each_char.to_a
ws = Hash[a.zip(b)]
ws.default = ->(f){f}
@namuol
namuol / INSTALL.md
Last active December 11, 2024 12:21
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@vu3rdd
vu3rdd / papers.markdown
Last active February 13, 2019 06:01
List of Papers for Bangalore PL/CS paper reading group

Context

This tweet explains it all.

I have a huge pile of papers on my computer waiting to be read. Often I read parts of it immediately after I see the paper, but I forget about it until someone points on another article, how awesome that paper is. I then remember to read it more carefully.

One way to fix it is to work with like minded people and have serious (non-hand wavy) discussion around the paper.

The list below will grow. My hard disk has more papers than I can count. I have carefully chosen a list of very readable papers in the list below. Special thanks for the authors for publishing their great ideas.