Slava,

I think this sort of thing might be possible in Factor:

M: size ( <window> -- <array> ) ... call to xlib ;

M: width ( <window> -- <int> ) size first ;

M: set-height ( <int> <window> -- ) tuck width swap 2array swap resize ;

(these are based on methods in libs/x.factor)

The <foo> in the stack effect indicates a class. This allows for a shorter M: 
syntax. Instead of

M: window size ( window -- size ) ...

it's just

M: size ( <window> -- <array> )

Classes can also be indicated in the stack effect results.

When the compiler compiles width, it can pick the right size method. Likewise, 
when compiling set-height, it can pick the right width method.

Ed

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to