Wiki
Version 1 (modified by Chuck, 15 years ago)

--

Ruby

Cobra, like Ruby, has a high level syntax and garbage collection to enable rapid coding. One of the first things Ruby users want to know, is if Cobra supports blocks. Yes, it does. They are sometimes referred to as "anonymous methods" and "closures" so keep your eyes open for those terms on the discussion forums.

Blocks are indicated by the keyword "do". If there are any arguments to pass they are declared in the same way as methods and signatures: with a parenthesized list of arguments. The body of the block then follows on the next line, indented one level.

See the test cases for examples.

Also of interest to Ruby users, Cobra has mix-ins and type extensions.

Cobra has some interesting characteristics for Ruby developers including a huge increase in performance, native threads, built-in contracts, built-in unit tests and more.

Although Ruby is not Python, Ruby users may glean some characteristics of Cobra by reading comments about Python, which are more detailed.

See also: OtherLanguages, PythonLanguage