Skip to content

Instantly share code, notes, and snippets.

View pilisera's full-sized avatar

Andrew Piliser pilisera

View GitHub Profile
@pilisera
pilisera / gist:071305e20aa831a79d71
Created April 23, 2015 20:05
Hypothetical C# Metaprogramming
int MAX_ARGS = 10;
var arg_list = new string[MAX_ARGS]();
for (int i=0; i < MAX_ARGS; i++)
{
arg_list[i] = "arg_" + i.ToString
define_method(@"
static Func<A, R> Memoize<A, R>(this Func<A, R> function)
{
var cache = new Dictionary<A, R>();
require 'yaml'
require 'syck'
require 'fileutils'
if ARGV.empty?
$stderr.puts "! Must pass one or more filenames to convert from Syck output to Psych output."
exit 1
end
bad_files = ARGV.select{ |f| ! File.exists?(f) }