dup array? [ dup array? [ ... ] [ ... ] if ] [ ... ] if
That is, a value being tested against a type twice. Implementing a compiler optimization to deal with this was easy:
: known-type? ( node -- ? )
0 node-class# types length 1 number= ;
: fold-known-type ( node -- node )
dup 0 node-class# types first 1array inline-literals ;
\ type [
{ [ dup known-type? ] [ fold-known-type ] }
] define-optimizers
No comments:
Post a Comment