DIRECTORY ImagerSwitches, Rope; ImagerSwitchesImpl: CEDAR PROGRAM EXPORTS ImagerSwitches ~ BEGIN val: PUBLIC ARRAY CHAR['a..'z] OF REF ¬ ALL[NIL]; default: ARRAY CHAR['a..'z] OF REF ¬ ALL[NIL]; names: ARRAY CHAR['a..'z] OF ATOM ¬ ALL[NIL]; docs: ARRAY CHAR['a..'z] OF Rope.ROPE ¬ ALL[NIL]; MultipleDefinition: PUBLIC ERROR [switch: CHAR] ~ CODE; Undefined: PUBLIC ERROR [switch: CHAR] ~ CODE; Define: PUBLIC PROC [switch: CHAR['a..'z], name: ATOM, doc: Rope.ROPE, defaultValue: REF] RETURNS [CHAR['a..'z]] ~ { IF name # names[switch] AND names[switch] # NIL THEN ERROR MultipleDefinition[switch]; names[switch] ¬ name; docs[switch] ¬ doc; val[switch] ¬ default[switch] ¬ defaultValue; RETURN [switch] }; Describe: PUBLIC PROC [switch: CHAR['a..'z]] RETURNS [name: ATOM, doc: Rope.ROPE, defaultValue: REF, value: REF] ~ { RETURN [name: names[switch], doc: docs[switch], defaultValue: default[switch], value: val[switch]] }; Set: PUBLIC PROC [switch: CHAR['a..'z], name: ATOM, value: REF] ~ { IF name # names[switch] THEN ERROR Undefined[switch]; val[switch] ¬ value; }; END. ’ ImagerSwitchesImpl.mesa Copyright Σ 1988, 1991 by Xerox Corporation. All rights reserved. Michael Plass, October 14, 1988 12:18:04 pm PDT ΚM–(cedarcode) style•NewlineDelimiter ™codešœ™Kšœ Οeœ7™BK™/—K˜KšΟk œ˜K˜Ihead2šœž ˜!Kšžœ˜šœž˜K˜šœžœžœžœ žœžœžœžœ˜1K˜—š œ žœžœ žœžœžœžœ˜.K˜—š œžœžœ žœžœžœžœ˜-K˜—š œžœžœ žœžœžœžœ˜1K˜—Kš Οnœžœžœ žœžœ˜7š Ÿ œžœžœ žœžœ˜.K˜—šŸœžœžœ žœžœ žœžœžœžœ ˜tKš žœžœžœžœžœ˜VKšœ˜Kšœ˜Kšœ-˜-Kšžœ ˜Kšœ˜K˜—šŸœžœžœ žœ žœžœ žœžœ žœ˜tKšžœ\˜bKšœ˜K˜—š Ÿœžœžœ žœžœ žœ˜CKšžœžœžœ˜6Kšœ˜Kšœ˜K˜——K˜Kšžœ˜—…—@