Changes between Version 1 and Version 2 of RubyLanguage
- Timestamp:
- 08/19/09 09:01:58 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RubyLanguage
v1 v2 13 13 Although Ruby is not Python, Ruby users may glean some characteristics of Cobra by reading [PythonLanguage comments about Python], which are more detailed. 14 14 15 See also: OtherLanguages, PythonLanguage 15 == Code Examples == 16 17 To learn the syntax further, see the HowToPrograms 18 19 === Class Declaration === 20 Ruby: 21 {{{ 22 #!ruby 23 class A < B 24 25 def foo 26 puts 'foo' 27 bar 28 end 29 30 def bar 31 print 'bar' 32 end 33 34 end 35 }}} 36 Cobra: 37 {{{ 38 #!python 39 class A inherits B 40 41 def foo 42 print 'foo' 43 .bar 44 45 def bar 46 print 'bar' stop 47 }}} 48 49 See also: OtherLanguages, HowToPrograms, PythonLanguage