Skip to content

Instantly share code, notes, and snippets.

@Narnach
Created November 30, 2008 18:09
Show Gist options
  • Save Narnach/30494 to your computer and use it in GitHub Desktop.
Save Narnach/30494 to your computer and use it in GitHub Desktop.
Am I doing something wrong or is this a bug?
# Run with reia bad.re
# It will output:
# exception: {exception,
# {throw,
# {tuple,
# {error,
# {tuple,
# {17,
# {list,{[],"syntax error before: '|'"}}}}}}}}
# stacktrace: [{'Eval',string,1},
# {'Loader',eval_input,1},
# {init,start_it,1},
# {init,start_em,1}]
[1,2,3].each do |n|
puts(n.to_s())
[1,2,3].each {|a| puts(a.to_s())}
Reia Interactive Shell (prerelease)
Running on Erlang (BEAM) emulator version 5.6.5 [source] [smp:2] [async-threads:0] [hipe] [kernel-poll:true]
>> [1,2,3].each do |n|
.. puts(n.to_s())
..
1
2
3
=> [1,2,3]
# Run with reia good.re
# It will output:
# 1
# 2
# 3
# 1
# 2
# 3
[1,2,3].each {|a| puts(a.to_s())}
[1,2,3].each do |n|
puts(n.to_s())
# Define the do-block in a class
# This executes as expected
class InClass
def dothis
[1,2,3].each do |n|
Local.puts(n.to_s())
InClass.start().dothis()
puts("lala")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment