File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 146
146
if (IS_WORD (sel = pvs -> select )) {
147
147
if (VAL_WORD_CANON (sel ) == SYM_X ) n = 1 ;
148
148
else if (VAL_WORD_CANON (sel ) == SYM_Y ) n = 2 ;
149
+ else if (VAL_WORD_CANON (sel ) == SYM_AREA ) {
150
+ if (pvs -> setval ) return PE_BAD_SET ;
151
+ SET_DECIMAL (pvs -> store , llabs (VAL_PAIR_X (pvs -> value ) * VAL_PAIR_Y (pvs -> value )));
152
+ return PE_USE ;
153
+ }
149
154
else return PE_BAD_SELECT ;
150
155
}
151
156
else if (IS_INTEGER (sel ) || IS_DECIMAL (sel )) {
Original file line number Diff line number Diff line change @@ -278,4 +278,11 @@ Rebol [
278
278
279
279
===end-group===
280
280
281
+ ===start-group=== "pair area accessor"
282
+ --test-- "pair/area"
283
+ p: 10x20 --assert 200.0 = try [p/area ]
284
+ p: -10x20 --assert 200.0 = try [p/area ]
285
+ --assert all [error? e: try [p/area: 100 ] e/id = 'bad-path-set]
286
+ ===end-group===
287
+
281
288
~~~end-file~~~
You can’t perform that action at this time.
0 commit comments