Skip to content

Instantly share code, notes, and snippets.

#include "stdio.h"
#include "stdlib.h"
typedef struct {
void* apply_func; // pointer to function apply this closure w/ correct number of args and free-vars
void* func; // pointer to lifted function that implements this closure
int num_freevars; // number of bound variables (for GC use)
char* str; // string representation of this function
void* forwarded; // forward pointer (for GC use)
void* args[]; // bound variables
# A small DSL for helping parsing documents using Nokogiri::XML::Reader. The
# XML Reader is a good way to move a cursor through a (large) XML document fast,
# but is not as cumbersome as writing a full SAX document handler. Read about
# it here: http://nokogiri.org/Nokogiri/XML/Reader.html
#
# Just pass the reader in this parser and specificy the nodes that you are interested
# in in a block. You can just parse every node or only look inside certain nodes.
#
# A small example:
#