SORU
7 HAZİRAN 2010, PAZARTESİ


Çoklu Satır Yorumları Ruby?

Nasıl Ruby birden fazla satır yorum alabilir miyim?

CEVAP
7 HAZİRAN 2010, PAZARTESİ


#!/usr/bin/env ruby

=begin
Every body mentioned this way
to have multiline comments.

It has to be at the beginning of a line or
it will be a syntax error.
=end

puts "Hello world!"

<<-DOC
Also, you could create a docstring.
which...
DOC

puts "Hello world!"

"..is kinda ugly and creates
a String instance, but I know one guy
with a Smalltalk background, who
does this."

puts "Hello world!"

##
# most
# people
# do
# this


__END__

But all forgot there is another option.
Only at the end of a file, of course.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Cole Rolland

    Cole Rolland

    23 Kasım 2008
  • MADFINGER Games a.s.

    MADFINGER Ga

    21 NİSAN 2009
  • MyCyberAcademy

    MyCyberAcade

    2 EKİM 2011