The Cobra Programming Language Version 0.0.4 Release Notes 2006-02-23 ------------------------------------------------------------------------------ See also: Cobra\ReadMe.text Cobra\Docs\License.text http://CobraLang.com/ In this release: == Additions == * Extended "nilable" concept to reference types like string, object, Customer. def sendWelcome(cust as Customer, referral as Customer?): # will not accept nil for `cust` # will accept nil for `referral` * Added to? operator for "soft casting": if the cast fails, nil is returned. "x to type" means "cast or raise an exception" "x to type?" means "cast or return nil" * Class vars can be initialized: var _x as int = 1 * Class vars can have their type inferred: var _x = 1 * Added `in` and `not in` operators. a in b, a not in b. Valid types for b are string, IList(of) and IDictionary(of). * Added formatting in string substitution. To format, put a colon and a .NET formatting string after the expression like so: mol = 42 assert '[mol:N]'=='42.00' * Added more compile-time type checking. == Changes == * Changed string substitution to output "nil", "true" and "false" as appropriate. * Change `for` to `from` in shorthand properties: get age from _age * `Cobra` is now a namespace and `releaseNum`, `version` and `commandLineArgs` are now accessed under the new `CobraCore` class. == Fixes == * Fixed a bug in type checking. This now works: "o as Object = 5" * Fixed bug in `to` operator. * Fixed bug with string literals containing backslashes. * Fixed bug in string substitution regarding nil obj refs. * Fixed bug in truthfulness which was returning true for nil. * Fixed bug preventing the use of DateTime, TimeSpan and Directory. * Fixed bug that prevented local vars being typed as non-primitive structs. * Fixed bug where ints could not be assigned to decimals or floats. * Fixed a bug regarding single line comments (commenting could "dedentation"). == Small Details == These aren't important to the average user...unless they cause a problem. Documented here for completeness. * Separate CobraLang.cs out from the generated code ------------------------------------------------------------------------------