Skip to content

Instantly share code, notes, and snippets.

View jeapostrophe's full-sized avatar
🍕

Jay McCarthy jeapostrophe

🍕
View GitHub Profile
(define-syntax-rule (code/size s c ...)
(parameterize ([current-font-size s])
(code c ...)))
(define opt-code
(code/size
20
(define y 5)
(define (g z)
(+ z 3))
source ~/.profile
hash -d ws=$PLTHOME/collects/web-server
hash -d drdr=$PLTHOME/collects/meta/drdr
hash -d work=$PROJS
hash -d papers=$PROJS/papers
hash -d planet=$SVNROOT/github.jeapostrophe.planet
setopt autopushd pushdminus pushdsilent pushdtohome
(define (list-ref/random l)
(list-ref l (random (length l))))
(define (apply-reduction-relation/random red t)
(define tps (apply-reduction-relation red t))
(if (empty? tps)
t
(apply-reduction-relation/random red (list-ref/random tps))))
(define (apply-reduction-relation/generator red t visited?)
(generator
()
(let loop ([t t])
(unless (visited? t)
(let ([tps (apply-reduction-relation red t)])
(if (empty? tps)
(yield t)
(for-each loop tps)))))
(yield #f)))
@jeapostrophe
jeapostrophe / fac.rkt
Created March 8, 2012 20:25
Test collecting macro
#lang racket
(define (! n)
(if (zero? n)
1
(* n (! (sub1 n)))))
(module* test-manual #f
(require rackunit)
(printf "Factorial testing (manual)!\n")
@jeapostrophe
jeapostrophe / test.ll
Created October 29, 2015 23:51
Vectorizing structure reads, writes, etc examples
; External declaration of the puts function
declare i32 @exit() nounwind
; float = 1, 2, 3, 4, 5, 6, 7, 8
; i16 = 2, 4, 6, 8, 10, 12, 13, 14, 15, 16
; i8 = 4, 8, 12, 16, 20, 24, 26, 28, 29, 30, 31, 32
%athing = type { float, float, float, float, float, float, i16, i16, i8, i8, i8, i8 }
@one = external global %athing
@two = external global %athing
#lang racket/base
(require (for-syntax racket/base
racket/list)
rackunit)
(let ()
(define-syntax (123-list stx)
(define middle-x-stx (second (syntax->list stx)))
(define x-id (syntax-e middle-x-stx))
(define new-ctxt-stx (datum->syntax #f 'new-ctxt))
#lang racket/base
(require (for-syntax racket/base
syntax/parse)
racket/splicing)
(begin-for-syntax
(define special-define-set
(make-parameter (box '())))
(define (add-to-boxed-list! b v)
(set-box! b (cons v (unbox b)))))
From 6cc6aeb987cf426af1e2bfe28d7135abb40a4745 Mon Sep 17 00:00:00 2001
From: Jay McCarthy <jay.mccarthy@gmail.com>
Date: Thu, 7 Jul 2016 22:40:59 -0400
Subject: [PATCH 1/1] Updating to work with OS X 10.11.4 and XCode 7.3.1, plus
adding convenience top-level Makefile
---
GNUmakefile | 5 +++++
higan/audio/audio.cpp | 6 +++++-
higan/out/.gitignore | 5 +++--
libtool --mode=compile --tag=CC arm-linux-androideabi-gcc -I./.. -I../../../racket/src/../include -g -O2 --sysroot=/Users/jay/Library/Android/sdk/ndk-bundle/platforms/android-23/arch-arm -DUSE_SENORA_GC -DMZ_NO_ICONV -DMZ_USES_SHARED_LIB -c ../../../racket/src/gmp/gmp.c -o gmp.lo
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `-' in: --mode=compile
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_fil