Differences From Artifact [6fa9c2c94c01b274]:
- File
polemy/value.d
- 2010-11-24 17:44:58 - part of checkin [b993a8ad16] on branch trunk - auto memo and re-run feature of non @value/@macro layers re-re-re-implemented. (user: kinaba) [annotate]
To Artifact [3d0cc7f551924493]:
- File
polemy/value.d
- 2010-11-26 05:03:10 - part of checkin [207cea338a] on branch trunk - changed hiding mechanizem of x in let x = ... for @macro layer. Old: set(x,ValueLayer,undefined) Nee: set(x,NoopLayer,null) (user: kinaba) [annotate]
101 return prototype.has(i, lay); 101 return prototype.has(i, lay);
102 } 102 }
103 103
104 /// Return the value of index i at layer lay. Throws if it is not set 104 /// Return the value of index i at layer lay. Throws if it is not set
105 Value get(string i, Layer lay, LexPosition pos=null) 105 Value get(string i, Layer lay, LexPosition pos=null)
106 { 106 {
107 if( i in data ) { 107 if( i in data ) {
108 // [TODO] consider forwarding to proto also in this case <
109 if( lay !in data[i] ) 108 if( lay !in data[i] )
110 throw genex!RuntimeException(pos, sprintf!"'%s' 109 throw genex!RuntimeException(pos, sprintf!"'%s'
111 return data[i][lay]; 110 return data[i][lay];
112 } 111 }
113 if( prototype is null ) 112 if( prototype is null )
114 throw genex!RuntimeException(pos, sprintf!"'%s' not foun 113 throw genex!RuntimeException(pos, sprintf!"'%s' not foun
115 return prototype.get(i, lay, pos); 114 return prototype.get(i, lay, pos);