Skip to content

Instantly share code, notes, and snippets.

View deadprogram's full-sized avatar
💭
Upcoming availability for work.

Ron Evans deadprogram

💭
Upcoming availability for work.
View GitHub Profile

Insert cool title here...

Problems with current KR:

Backend stuff

@deadprogram
deadprogram / forth.rb
Created January 15, 2012 20:02 — forked from krainboltgreene/forth.rb
Forth interpreter in 64 lines of Ruby
#!/usr/bin/env ruby
def pop; $stack.pop || raise(StackUnderflow); end
def push(expression); $stack << expression; end
def unary; -> { push(yield pop) }; end
def binary; -> { push(yield pop, pop) }; end
def unary_boolean; -> { push(if yield pop then 1 else 0 end) }; end
def binary_boolean; -> { push(if yield pop, pop then 1 else 0 end) }; end
def swap; $stack[-2,2] = $stack[-2,2].reverse; end
$stack = []
<list-entries type="array">
<list-entry>
<created-at type="datetime">
2008-11-07T19:39:42+00:00
</created-at>
<created-by-id type="integer">
9
</created-by-id>
<domain>
cnn.com
pool :poolpartyrb do
plugin_directory "plugins"
cloud :app do
# Configuration
configure { :maximum_instances => 1, :keypair => "name" }
minimum_instances 1