Wiki

Changes between Version 1 and Version 2 of RubyLanguage

Show
Ignore:
Timestamp:
08/19/09 09:01:58 (15 years ago)
Author:
Chuck
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RubyLanguage

    v1 v2  
    1313Although Ruby is not Python, Ruby users may glean some characteristics of Cobra by reading [PythonLanguage comments about Python], which are more detailed. 
    1414 
    15 See also: OtherLanguages, PythonLanguage 
     15== Code Examples == 
     16 
     17To learn the syntax further, see the HowToPrograms 
     18 
     19=== Class Declaration === 
     20Ruby: 
     21{{{ 
     22#!ruby 
     23class A < B 
     24 
     25  def foo 
     26    puts 'foo' 
     27    bar 
     28  end 
     29     
     30  def bar 
     31    print 'bar' 
     32  end 
     33 
     34end 
     35}}} 
     36Cobra: 
     37{{{ 
     38#!python 
     39class A inherits B 
     40 
     41    def foo 
     42        print 'foo' 
     43        .bar 
     44     
     45    def bar 
     46        print 'bar' stop 
     47}}} 
     48 
     49See also: OtherLanguages, HowToPrograms, PythonLanguage