mirah/mirah — Issue #167: string-each-char example simply doesn't work
Author: RobertFischer
Created: 2012-01-31 14:59:15+00:00
State: open

https://github.com/mirah/mirah/blob/master/examples/macros/string-each-char.mirah

When I execute this code on Mirah v0.0.10:

```mirah
macro def eachChar(value, &block)

quote {
`value`.toCharArray.each do | my_char |
`block.body`
end
}
end

eachChar('laat de leeeuw niet in zijn hempie staan') do | my_char |
puts my_char
end
```

I get this error:

```
wl-10-180-107-72:tmp robert$ mirah foo.mirah
file:/Users/robert/bin/mirah/lib/mirah-complete.jar!/builtin/javasupport/core_ext/object.rb:99 warning: already initialized constant Exception
Warning: No ClassDefinition for Foo. Macros can't be loaded from disk.
Inference Error:
Cannot find static method my_char() on Foo
foo.mirah:12: Cannot find static method my_char() on Foo
puts my_char
^^^^^^^^
Exception in thread "main" org.jruby.exceptions.RaiseException: (SystemExit) exit
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:867)
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:836)
at Mirah::Commands::Base.execute_base(file:/Users/robert/bin/mirah/lib/mirah-complete.jar!/mirah/commands/base.rb:53)
at Mirah::Commands::Run.execute(file:/Users/robert/bin/mirah/lib/mirah-complete.jar!/mirah/commands/run.rb:23)
at #.run(file:/Users/robert/bin/mirah/lib/mirah-complete.jar!/mirah.rb:36)
at #.run(src/org/mirah/mirah_command.rb:55)
at #.main(src/org/mirah/mirah_command.rb:40)
```

What's the syntax for developing macros like this?