Skip to content

Commit

Permalink
running specs right here results in poor lin numbers somehow...intere…
Browse files Browse the repository at this point in the history
…sting
  • Loading branch information
rdp committed May 30, 2011
1 parent 0a23310 commit f57e5ad
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 12 deletions.
1 change: 1 addition & 0 deletions lib/go.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# sigh ...

for command in ['mirahc -j specs_stevia', 'javac SpecsStevia.java', 'java SpecsStevia']
print 'running ', command
raise command unless system command
end

2 changes: 1 addition & 1 deletion lib/mir_debug.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@rem j --debug -S rdebug c:\\dev\\ruby\\downloads\\jruby\\bin\\mirah -- go2.mir
j --debug -S rdebug c:\\dev\\ruby\\downloads\\jruby\\bin\\mirah -- times_messed_up.rb
@rem broken ? j --debug -S rdebug c:\\dev\\ruby\\downloads\\jruby\\bin\\mirah -- repro
18 changes: 10 additions & 8 deletions lib/specs_stevia
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# same dir means same package ja?
# require 'go2.mir'
# same dir means same package ja? # require 'go2.mir'

# specs :P

#RubyInt.new(1) - RubyInt.new(2) # java compile bug
#RubyInt.new(1) + RubyInt.new(2)
#RubyInt.new(1) - RubyInt.new(2) # shows a mirahc -j compile bug
#RubyInt.new(1) + RubyInt.new(2) # same here

b = 1
RubyInt.new(2).times do |n|
Expand All @@ -28,6 +25,11 @@ end

raise 'equals failed!' unless RubyInt.new(1486).equals(RubyInt.new(1486))

raise 'bad' unless c.== RubyInt.new(1486)
raise 'bad1' if c.equals RubyInt.new(14)
raise 'bad2' unless c.equals RubyInt.new(1486)

# we could leave == as .equals, hmmm...that sounds like more work though :P

e = (c.equals RubyInt.new(1486)) # native boolean type...scawah!

puts 'specs done'
puts 'specs passed'
8 changes: 7 additions & 1 deletion lib/std_lib_stevia
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ import java.util.ArrayList

# eventually we'll probably need this class for doing the "system" or whatever the Kernel shtuff is...

# Note that I've munged -, +, and <<, and should munge == and []= though the latter might be ok...

class RubyObj

def this
self
end

$Override
def equals(o:Object):boolean
raise 'not implemented' # the inner classes need to implement this or they are hosed
raise 'not implemented' + self.toString # the inner classes need to implement this or they are hosed
end

end
Expand Down
31 changes: 29 additions & 2 deletions notes
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
unable to infer type: https://github.com/rdp/stevia/commit/0a233105bf7ebc51ede991efdc270dd17811a59f argh! matey! needs a better error message! arrr!


class Yo
def equals(o:Object)
print 'in equals'
false
end
end

interface Implements__equals do
def equals(o:Yo):boolean # I guess this will force them to output a boolean last statement, which is ok
# what about them wanting to be able to output void (or "a boolean here" or what not...)

end
end


# should I make this class static? cache it [in a hash]?
class RubyInt < Yo
implements Implements__equals

$Override
def equals(o)
33
end

end


I can just allow mirah to infer the return type as boolean or RubyObj I think that'll work..I believe so.
Expand All @@ -10,10 +38,9 @@ there are three classes of methods.

nice would be an option to have java line numbers [?] I guess it already does through the java compiler...yeah.

Note that I've munged -, +, and <<, and should munge == and []= though the latter might be ok...


java straight, with Integers:
java straight, with Integer objects:
3.70

jdk6 jruby server: 25.14 25.23
Expand Down

0 comments on commit f57e5ad

Please sign in to comment.