DIRECTORY Atom USING [DottedPairNode, PropList], ImmutablePropList USING []; ImmutablePropListImpl: CEDAR PROGRAM EXPORTS ImmutablePropList ~ BEGIN PropList: TYPE ~ Atom.PropList; Put: PUBLIC PROC[propList: PropList, key: REF, val: REF] RETURNS[PropList] ~ { RETURN[CONS[NEW[Atom.DottedPairNode _ [key: key, val: val]], propList]]; }; Get: PUBLIC PROC[propList: PropList, key: REF] RETURNS[val: REF] ~ { FOR list: PropList _ propList, list.rest UNTIL list=NIL DO IF list.first.key=key THEN RETURN[list.first.val]; ENDLOOP; RETURN[NIL]; }; Rem: PUBLIC PROC[propList: PropList, key: REF] RETURNS[PropList] ~ { RETURN[Put[propList, key, NIL]]; }; END. ^ImmutablePropListImpl.mesa Copyright c 1984, 1985 by Xerox Corporation. All rights reserved. Doug Wyatt, March 26, 1985 5:32:52 pm PST This property list mechanism regards a PropList as an immutable value. We don't use the procedures from Atom since 1) they might smash an existing PropList, and 2) they hold a global monitor in AtomImpl. Κe˜codešœ™Kšœ Οmœ7™BK™)—K™šΟk ˜ Kšœžœ˜&Kšœžœ˜—K˜KšΠblœžœž˜$Kšžœ˜Kšœž˜K˜KšœΜ™ΜK™Kšœ žœ˜K™š Οnœžœžœžœžœžœ˜NKšžœžœžœ9˜HK˜K˜—š  œžœžœžœžœžœ˜Dšžœ&žœžœž˜:Kšžœžœžœ˜2Kšžœ˜—Kšžœžœ˜ K˜K˜—š  œžœžœžœžœ˜DKšžœžœ˜ K˜K˜—Kšžœ˜—…—S