Here is an implementation of message-passing OO in Factor:

: create-message ( name -- word )
     "->" swap append "messages" create ;

: MSG:
     scan-word scan create-message
     [ define-typecheck ] f ; parsing

Now you can write:

MSG: car move ... ;

MSG: window move ... ;

Which creates a generic word named ->move in the messages vocabulary.

I don't recommend using this, though.

Slava

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to