Wiki

Ticket #102 (closed enhancement: fixed)

Opened 16 years ago

Last modified 16 years ago

Augment properties decl syntax to support setting an initial value

Reported by: hopscc Owned by: Chuck
Priority: medium Milestone:
Component: Cobra Compiler Version: 0.8.0
Keywords: Cc:

Description

Properties declaration recently augmented to implicitly declare ( or not require an already declared) backing variable.
Extend this slightly to also support setting an initial value to this implicit backing variable
i.e.

pro val from var as int = 99
#equivalent to 

var _val as int = 99
pro val from var

see also discussion in
 Declaring backing vars for properties on the same line

Attachments

properties-init.patch Download (8.8 KB) - added by hopscc 16 years ago.

Change History

Changed 16 years ago by Chuck

So it's:

pro val from var = 99

# general form:
pro|get|set <name> from var = <expr>

Changed 16 years ago by hopscc

  • owner set to hopscc
  • status changed from new to assigned

Changed 16 years ago by hopscc

Changed 16 years ago by hopscc

  • owner changed from hopscc to Chuck

patch + some refactoring and cleanup
tests and relnote

Changed 16 years ago by Chuck

I am working on this. Have a conflict to resolve from some work I did on type declaration clauses.

Changed 16 years ago by Chuck

  • status changed from assigned to closed
  • resolution set to fixed

Patch applied.

I found an oddity in the test cases that a "pro x from var as FOO" could redeclare the type of a previous "var _x" to something different. That's a bug, not a feature.

Note: See TracTickets for help on using tickets.