Forums

Cobra November 2008 Update

Announcements of new releases, presentations, new documentation, events, etc. These announcements are also made on the Discussion forum. You would subscribe to this one if you are interested in news, but not in general discussion.

Cobra November 2008 Update

Postby Charles » Sun Nov 30, 2008 6:40 pm

(This can be responded to on the Discussion Forum.)

This is a new update for November, covering improvements since the last update in October.

There is a new HowToInstallFromSource wiki page covering the ease and benefits of using Cobra from the source repository, and how to do it.

The following improvements are due to patches and feedback from the community as well as my own efforts. Thanks to all contributors!

Language

-- Added anonymous methods, also known as closures. Discussed here.

-- Added streams to the language. Discussed here.

-- Added generic constraints on generic methods. See Tests/240-generics/400-generic-methods/130-generic-method-constraints.cobra

-- Added a shortcut syntax for declaring a property and its backing variable in one line.
class X

get x from var as int
# is a short cut for these two lines:
var _x as int
get x from var

# the general form of the shortcut above is:
get <name> from var as <type>

# the fully general form is:
(get|pro|set) <name> from (var|<var-name>) as <type>

-- Added storage type specification for enums. "enum State of uint8"

-- Add support for multitarget assignment in for statements:
for key, value in aDictionary
trace key, value
for a, b in [[1, 2], [3, 4]]
print a + b

-- Added support for one-line doc strings.
class X

def foo
""" Foo is as foo does. """
pass

Command Line

-- Added command line option -correct-case (or -cc) to change the case of types to the correct cases in situations that are not ambiguous. For example, "list<of int>" will be rewritten as "List<of int>" rather than producing an error. If you can configure your editor to automatically reload modified files then this feature can be quite nice.

-- Added "-out:" command line option to control the name of the resulting executable or library.

-- Support file paths with both backslash (foo\bar.cobra) and forward slash (foo/bar.cobra) regardless of platform.

-- Make the -files: option "relative" meaning that the paths inside that file are relative to that file (instead of say, the current working directory).

-- Updated -about with more URLs for license, support, etc.

-- The default behavior for invoking the Cobra command line with no args is now -about rather than -help.

-- Better error messages regarding invalid option choices.

Misc

-- Made various improvements to "install-from-workspace" based on user feedback and patches.

-- Added new Point sample.

-- Added new "line endings" program which is useful if you work on Mac, Windows and Windows+cygwin. Look under cobra-workspace/Supplements/le.cobra.

-- Updated and added various wiki pages.

-- Fixed 15 bugs.

-- Improved 5 error messages.



The next update will be next month, towards the end of December, but you can always keep up to date by browsing through the discussion forums.

I hope you'll try out the very latest Cobra!


Best regards,


Chuck
Charles
 
Posts: 2515
Location: Los Angeles, CA

Return to News Announcements

Who is online

Users browsing this forum: No registered users and 8 guests