Path: utzoo!attcan!uunet!mcvax!unido!laura!atoenne From: atoenne@laura.UUCP (Andreas Toenne) Newsgroups: comp.lang.smalltalk Subject: Re: Quest. on Smalltalk Keywords: construction of messages at run time, reevaluation of system classes Message-ID: <796@laura.UUCP> Date: 15 Dec 88 22:11:37 GMT References: Reply-To: atoenne@laura.UUCP (Andreas Toenne) Organization: University of Dortmund, W-Germany Lines: 25 In article byerly@cars.rutgers.edu (Boyce Byerly ) writes: >1. Is it possible to create a message at run time and then send it? >For those of you who know LISP, I am asking if Smalltalk has a >facility analogous to the EVAL statement. Yes! The message perform: is understood by every object in the system. It takes a symbol (called selector here) as an argument and evaluates the method associated to the selector. Together with perform: come perform:with: and perform:with:with which evaluate the methods with arguments. As one may construct symbols at runtime this feature matches your requirements. >2. Can you redefine the system-defined classes (such as integer, >graphic objects, and so forth) to contain a modified set of messages? Yes! In Smalltalk-80 you are allowed to change everything in the system. The whole system comes with it's source and a powerfull decompiler. However, this is both convenient for the experienced programmer and dangerous to the novice. I remember a real freshmen who decided to add a new instance variable to class Object. After some time (> 1hr) he decided to reboot. :-) Andreas Toenne