Skip to content

Instantly share code, notes, and snippets.

View sunkencity's full-sized avatar

Joel Westerberg sunkencity

  • Stockholm, Sweden
View GitHub Profile
@perimosocordiae
perimosocordiae / forth.rb
Created February 10, 2010 18:58
A pure Ruby interpreter for Forth
#!/usr/bin/env ruby
# the stack
$stack = []
def pop() $stack.pop || ufe end
def push(f) $stack<<f end
# poor man's Exception class
def ufe() raise("Stack underflow") end
# lambda constructor helpers