public
Description: a Scheme written in Ruby, but implemented on the bus!
Homepage: http://bus-scheme.rubyforge.org
Clone URL: git://github.com/technomancy/bus-scheme.git
rubinius-friendly boolean inspecting
technomancy (author)
Mon Jun 02 10:47:22 -0700 2008
commit  d009ab438c8f8128bc0da344c807fa5dbed6e28e
tree    164505a6cb978bea02143b09d8307ab95056e0d2
parent  ee954a3f167510190e9c67c7ce4a21beb80a5203
...
42
43
44
 
45
46
47
...
42
43
44
45
46
47
48
0
@@ -42,6 +42,7 @@ module BusScheme
0
                input += "\n" + Readline.readline(INCOMPLETE_PROMPT)
0
                retry
0
              end
0
+ # TODO: persist readline history through sessions
0
              Readline::HISTORY.push(input)
0
              result
0
            rescue Interrupt
...
103
104
105
 
106
107
108
109
110
111
112
113
...
103
104
105
106
107
 
 
 
 
108
109
110
0
@@ -103,11 +103,8 @@ module BusScheme
0
     def method_missing(sym)
0
       sym = sym.to_s
0
       raise NoMethodError unless sym =~ /^c([ad]+)r/
0
+ return send(sym) if sym.length == 3
0
       case sym
0
- when 'car'
0
- car
0
- when 'cdr'
0
- cdr
0
       when /^ca/
0
         send(sym.sub('a', '')).car
0
       when /^cd/
...
18
19
20
21
22
23
24
 
 
25
26
27
...
18
19
20
 
 
 
 
21
22
23
24
25
0
@@ -18,10 +18,8 @@ class Object
0
 end
0
 
0
 # O HAI Booleans.
0
-unless defined? Rubinius # TODO: get rid of this conditional. =\
0
- def true.inspect; '#t' end
0
- def false.inspect; '#f' end
0
-end
0
+class TrueClass; def inspect; '#t' end end
0
+class FalseClass; def inspect; '#f' end end
0
 
0
 module Callable
0
   # allows for (mylist 4) => mylist[4]

Comments

    No one has commented yet.