Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > block comment problem

Reply
Thread Tools

block comment problem

 
 
Mrmaster Mrmaster
Guest
Posts: n/a
 
      12-19-2008
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
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Mrmaster Mrmaster
Guest
Posts: n/a
 
      12-19-2008
Thanks, that fixed the problem
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Dave Bass
Guest
Posts: n/a
 
      12-20-2008
Matz wrote:
> "=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.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Joel VanderWerf
Guest
Posts: n/a
 
      12-20-2008
Dave Bass wrote:
> Matz wrote:
>> "=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.


It might be because of this conflict:

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

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can ruby comment out a block of code??? Roseanne Zhang Ruby 5 10-15-2006 04:11 PM
Fo:Block can you check to see if a block contains any text by using the block id? morrell XML 1 10-10-2006 07:18 PM
? ELSE Conditional Comment / Using Conditional Comments Inside Other Tags To Comment Out Attributes Alec S. HTML 10 04-16-2005 02:21 AM
how to comment out a block of code Xah Lee Python 3 01-27-2005 06:59 PM



Advertisments