Ticket #22 (closed enhancement: fixed)

Opened 11 months ago

Last modified 11 months ago

Default to global scope for module-level declarations

Reported by: JarrettBillingsley Assigned to: JarrettBillingsley
Priority: major Milestone: MiniD 2
Component: Language Keywords:
Cc:

Description

In MiniD 1, class, namespace, and function declarations default to local scope unless explicitly specified global. Some people have expressed dislike for this, and I've also found many other languages which (effectively) default to global scope for top-level decls, meaning that it's probably unintuitive at best for top-level decls to be local by default. Furthermore you'll tend to have a lot more globals at top-level than locals, so it seems to make more sense to make top-level decls global by default.

Declarations inside functions will still be local-by-default.

This also has the nice side effect that you don't have to put "global" in front of everything in MDCL. :)

Change History

01/15/08 08:37:25 changed by JarrettBillingsley

  • status changed from new to closed.
  • resolution set to fixed.

01/15/08 21:20:47 changed by JarrettBillingsley

  • component changed from component1 to Language.