J. Scott Kasten
unread,Aug 16, 2014, 9:57:21 AM8/16/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mi...@googlegroups.com
Hi guys,
I've been working with Mirah in an android project for some weeks now.
I've run across two minor issues that I have not seen referenced online.
[1] I have noticed that the Ruby syntax for class constants does not work.
class Foo
LEFT=1
RIGHT=2
def bar
...
end
end
Basically, the compile chokes on LEFT and RIGHT. As a work around, I've
used these two forms for now:
def LEFT:fixnum ; return 1 ; end
or
def self.RIGHT:fixnum ; return 2 ; end
The choice of course depending on the desired scope. This works, but what
is the "correct" mirah form for such constants???
[2] I get a parser warning about a miss-matched kEnd on iterators. The
code compiles, and appears to execute correctly despite the warning.
dates = ArrayList.new [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ]
dates.each do |day|
... something ...
end
Code like the above produces these warnings during type inference:
-compile:
compiling Mirah source in /Project/..../src/. to ./Project/..../bin/classes
Parsing...
./Project/..../MainActivity.mirah
Inferring types...
WARNING: Misaligned end at mirah.lang.ast.StringCodeSource@a7775a:5:1
NOTE: closes block at mirah.lang.ast.StringCodeSource@a7775a:1:1
Compiling...
./Project/..../MainActivity.mirah
Done!
-post-compile:
This seems to be a spurious warning. Has anyone else seen this? Should I
be concerned? Have I implemented the source syntax as intended?
Thanks for any opinions. The versions of tools are:
mirah 0.1.2
pindah 0.1.3
jruby 1.7.11 (1.9.3 p392)
jvm 1.7.0_p51-b13 for i386 (Oracle JDK)
ant 1.9.3
Regards,
J. Scott Kasten