Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

Collection Type

BINDINGS FOR CollectionType;

(* Semantic Properties for Collection Types *)


(* ADTs must be opaque records,
   no literals may be used *)

TYPE = OPAQUE;


(* Bindings permitted for CollectionType ADTs *)

PROCEDURE [NEW]; (* allow binding to NEW procedure *)

PROCEDURE [DISPOSE]; (* allow binding to DISPOSE procedure *)

PROCEDURE [.]; (* allow accessor binding to [ ] operator *)

PROCEDURE [!]; (* allow mutator binding to [ ] operator *)

PROCEDURE [COUNT]; (* allow binding to COUNT function *)

PROCEDURE [FOR]; (* allow binding to FOR .. IN iterator *)

PROCEDURE [=]; (* allow binding to equal operator *)

END CollectionType.