On 2013-06-02 08:01, [email protected] wrote: > > I hope you guys don't mind, but in writing my dissertation and there is > no one local with Smalltalk experience to double-check some statements > that I'm making. Over the next few weeks I'd like to bounce a few off > the list, mainly for a simple "thats not right". For the first.... > > "In languages like C++ and Java the class definition is just text in a > file that is compiled into a runtime, and the class definition _cannot_ > be defined or changed by that runtime. In Smalltalk you develop from > inside the runtime image, so the runtime manipulate the class definition > like any other object of the system." > > > So what I want to check is that is it true to say you can't do that with > C++ and Java ?
I don't know about C++ but for Java there are libraries like CGLib[1] or ASM[2] that can manipulate/generate classes/interfaces at runtime. However the operation is not even remotely like editing code! It's writing code to change or generate the bytecode. [1] http://cglib.sourceforge.net/ [2] http://asm.ow2.org/ -- Bahman Movaqar (http://BahmanM.com) ERP Evaluation, Implementation, Deployment Consultant
