block comment problem

M

Mrmaster Mrmaster

Hello,

For some reason I'm unable to do block comments. I keep receiving this
error in my terminal:


timesheet.rb:20: syntax error, unexpected '=', expecting kEND
=begin
^
timesheet.rb:36: syntax error, unexpected '=', expecting kEND
=end
^
line 20 =begin
puts "Some print statements"
.......
line 36 =end

I have ubuntu 8.10 and rails 2.2.2

Thanks
 
D

Dave Bass

Matz said:
"=begin" should start at the beginning of a line. You cannot indent
them.

Any good reason for this?

I suppose it must be slower for Ruby to strip leading whitespace, but
only very slightly.

Why would I want to indent block comments? So they're at the same
indentation as the code I'm commenting. Keeps things neat and tidy. :)
 
J

Joel VanderWerf

Dave said:
Any good reason for this?

I suppose it must be slower for Ruby to strip leading whitespace, but
only very slightly.

Why would I want to indent block comments? So they're at the same
indentation as the code I'm commenting. Keeps things neat and tidy. :)

It might be because of this conflict:

x \
=begin
3/0
rescue
"div by 0"
end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top