Nadamas

Páginas: 2 (345 palabras) Publicado: 15 de enero de 2013
Ruby is "an interpreted scripting language for quick and easy object-oriented programming" -- what does this mean?
interpreted scripting language:
• ability to make operating system calls directly• powerful string operations and regular expressions
• immediate feedback during development
quick and easy:
• variable declarations are unnecessary
• variables are not typed
• syntax is simpleand consistent
• memory management is automatic
object oriented programming:
• everything is an object
• classes, methods, inheritance, etc.
• singleton methods
• "mixin" functionality by module• iterators and closures
also:
• multiple precision integers
• convenient exception processing
• dynamic loading
• threading support
If you are unfamiliar with some of the concepts above, readon, and don't worry. The mantra of the ruby language is quick and easy.
GETTING STARTED
First, you'll want to check whether ruby is installed. From the shell prompt (denoted here by "%", so don'ttype the %), type
% ruby -v
(-v tells the interpreter to print the version of ruby), then press the Enter key. If ruby is installed, you will see a message something like the following:
% ruby -vruby 1.8.3 (2005-09-21) [i586-linux]
If ruby is not installed, you can ask your administrator to install it, or you can do it yourself, since ruby is free software with no restrictions on itsinstallation or use.
Now, let's play with ruby. You can place a ruby program directly on the command line using the -e option:
% ruby -e 'puts "hello world"'
hello world
More conventionally, a rubyprogram can be stored in a file.
% echo "puts 'hello world'" > hello.rb
% ruby hello.rb
hello world
When writing more substantial code than this, you will want to use a real text editor!
Somesurprisingly complex and useful things can be done with miniature programs that fit in a command line. For example, this one replaces foo with bar in all C source and header files in the current working...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • nadamas
  • Nadamas
  • Nadamas
  • nadamas
  • Nadamas
  • Yo y nadamas yo
  • Nadamas
  • nadamas

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS