-USING: math eval tools.test effects ;
+USING: math eval lexer tools.test effects sequences ;
IN: words.alias.tests
ALIAS: foo +
[ ] [ "IN: words.alias.tests CONSTANT: foo 5" eval( -- ) ] unit-test
[ ( -- value ) ] [ \ foo stack-effect ] unit-test
+
+ALIAS: MY-H{ H{
+{ H{ { 1 2 } } } [
+ "IN: words.alias.tests MY-H{ { 1 2 } }" eval( -- x )
+] unit-test
: define-alias ( new old -- )
[ [ 1quotation ] [ stack-effect ] bi define-inline ]
- [ drop t "alias" set-word-prop ] 2bi ;
+ [ drop t "alias" set-word-prop ]
+ [ parsing-word? [ t "parsing" set-word-prop ] [ drop ] if ] 2tri ;
M: alias reset-word
[ call-next-method ] [ f "alias" set-word-prop ] bi ;