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

  • AginoEvolutionHD

    AginoEvoluti

    27 AĞUSTOS 2011
  • Helder Barreto

    Helder Barre

    22 Mayıs 2006
  • PomplamooseMusic

    PomplamooseM

    28 HAZİRAN 2008