Next Previous Up Top Contents Index

2.6 The COMMON-EXTENSIONS module

define table

Definition macro

Summary

Defines a constant binding in the current module and initializes it to a new table object.

Macro call

define table name [ :: type ] = { [ key => element ]* } 

Arguments

name
A Dylan namebnf.

type
A Dylan operandbnf. Default value: <table>.

key
A Dylan expressionbnf.

element
A Dylan expressionbnf.

Library

common-extensions

Module

common-extensions

Description

Defines a constant binding name in the current module, and initializes it to a new table object, filled in with the keys and elements specified.

If the argument type is supplied, the new table created is an instance of that type. Therefore type must be <table> or a subclass thereof. If type is not supplied, the new table created is an instance of a concrete subclass of <table>.

Example

define table $colors :: <object-table>
  = { #"red"    => $red,
      #"green"  => $green,
      #"blue"   => $blue };

Common Dylan and Functional Extensions - 31 Mar 00

Next Previous Up Top Contents Index