Skip to content

Instantly share code, notes, and snippets.

View chrisosaurus's full-sized avatar

Chris Hall chrisosaurus

View GitHub Profile
package main
import "fmt"
import "math"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
// FIXME
@chrisosaurus
chrisosaurus / diamond-op.scm
Created October 29, 2015 02:03 — forked from mikeyhc/diamond-op.scm
adding the perl diamond operator to scheme
(define-syntax <>
(syntax-rules ()
((_ v e ...)
(if (null? (command-line-arguments))
(let loop ((v (read-line)))
(unless (eof-object? v)
e ...
(loop (read-line))))
(let file-loop ((port (open-input-file (car (command-line-arguments))))
(rest (cdr (command-line-arguments))))
@chrisosaurus
chrisosaurus / avl.c
Last active August 29, 2015 14:17 — forked from tonious/avl.c
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
#include <assert.h>
struct avl_node_s {