Skip to content

Instantly share code, notes, and snippets.

View auroranockert's full-sized avatar

Aurora Nockert auroranockert

View GitHub Profile
@fogus
fogus / lithp.rb
Created January 29, 2012 00:37 — forked from p8/lithp.rb
class Lisp
Fs = {
:label => lambda {|name,value| Fs[name] = lambda { value } },
:car => lambda {|sexp| sexp.first },
:cdr => lambda {|sexp| sexp.slice(1, sexp.size) },
:cons => lambda {|head,tail| [head] + tail },
:atom => lambda {|sexp| !sexp.is_a?(Array) },
:eq => lambda {|a,b| a == b },
:if => lambda {|cnd,thn,els| cnd ? thn : els }
}
@apeiros
apeiros / fork.rb
Created March 25, 2010 19:34
An object representing a fork, containing data about it like pid, name, # exit_status, exception etc.
# An object representing a fork, containing data about it like pid, name,
# exit_status, exception etc.
# It also provides facilities for parent and child process to communicate
# with each other.
class Fork
# Exceptions that have to be ignored in the child's handling of exceptions
IgnoreExceptions = [::SystemExit]
# Raised when a fork raises an exception that can't be dumped
# This is the case if the exception is either an anonymous class or