Sha256: a2d735aec6d2f64215ce64bd27bf5f5e72006be2a5610d5c43a648cea7c66bec
Contents?: true
Size: 817 Bytes
Versions: 2
Compression:
Stored size: 817 Bytes
Contents
require 'rubylisp/types' module RubyLisp module Printer module_function def pr_str(*xs) if xs.count > 1 xs.map {|x| pr_str(x)}.join(' ') else x = xs.first case x when Array, Hamster::Vector "[#{x.map {|item| pr_str(item)}.join(' ')}]" when Hash "{#{x.map {|k, v| "#{pr_str(k)} #{pr_str(v)}"}.join ", "}}" when Hamster::Hash pr_str x.to_hash when Hamster::List "(#{x.map {|item| pr_str(item)}.join(' ')})" when Function "#<#{x.is_macro ? 'Macro' : 'Function'}: #{x.name}>" when Symbol x.value when Value x.value.inspect when Object::Symbol ":#{x.name}" else x.inspect end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rbl-0.0.7 | lib/rubylisp/printer.rb |
rbl-0.0.6 | lib/rubylisp/printer.rb |