From 3a56f91a12ccad642227178c76f8d76cc42f81ee Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Sun, 13 Apr 2014 14:37:56 -0500 Subject: Ruby: add stepA_more and rest of core functions. --- ruby/printer.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ruby/printer.rb') diff --git a/ruby/printer.rb b/ruby/printer.rb index 424ca23..cfcd064 100644 --- a/ruby/printer.rb +++ b/ruby/printer.rb @@ -7,12 +7,18 @@ def _pr_str(obj, print_readably=true) "(" + obj.map{|x| _pr_str(x, _r)}.join(" ") + ")" when Vector "[" + obj.map{|x| _pr_str(x, _r)}.join(" ") + "]" + when Hash + ret = [] + obj.each{|k,v| ret.push(_pr_str(k,_r), _pr_str(v,_r))} + "{" + ret.join(" ") + "}" when String if _r obj.inspect # escape special characters else obj end + when Atom + "(atom " + _pr_str(obj.val, true) + ")" when nil "nil" else -- cgit v1.2.3