Changes between Version 34 and Version 35 of Records/NameSpacing
- Timestamp:
- 01/17/12 19:55:04 (16 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Records/NameSpacing
v34 v35 149 149 150 150 In the Frege system, the record's namespace is closed where it is defined. 151 However, making a record an instance of a class puts the class functions inthe record name-space.152 153 {{{ 154 module R Extension where151 However, making a record an instance of a type class lifts the class functions into the record name-space. 152 153 {{{ 154 module RecordExtension where 155 155 156 156 import original.M(R) -- access the R record defined in module original.M … … 162 162 instance Rextension1 R where 163 163 -- implementation for new functions 164 165 And now, in another module one could166 167 import RExtension() -- equivalent to qualified import in Haskell168 164 }}} 169 165 170 166 the new functions `f` and `g` are accessible (only) through R. 171 167 So we have a technique for lifting new functions into the Record namespace. 172 For the initial records implementaion we definitelywant to maintain `f` and `g` at the top-level, but should consider also adding through the record name-space. See related discussion below on future directions.168 For the initial records implementaion we would want to maintain `f` and `g` at the top-level, but should consider also adding through the record name-space. See related discussion below on future directions. 173 169 174 170 == Compatibility with existing records ==
