This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |