[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: block comment problem

Yukihiro Matsumoto

12/19/2008 4:17:00 AM

Hi,

In message "Re: block comment problem"
on Fri, 19 Dec 2008 13:08:43 +0900, Mrmaster Mrmaster <mrsolarlife@gmail.com> writes:

|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
| ^

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

matz.

3 Answers

Mrmaster Mrmaster

12/19/2008 4:21:00 AM

0

Thanks, that fixed the problem :)
--
Posted via http://www.ruby-....

Dave Bass

12/20/2008 10:36:00 AM

0

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-....

Joel VanderWerf

12/20/2008 7:56:00 PM

0

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