Lines: 27
Newsgroups: comp.lang.smalltalk,local.smalltalk
Message-ID: <4eb4jg$p27@news00.btx.dtag.de>
From: Thilo.KHK@t-online.de (Thilo Schmid)
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!news.mathworks.com!fu-berlin.de!news.dfn.de!news.rwth-aachen.de!genesis.westend.com!news2.gtn.com!gtnduss1.du.gtn.com!ius.gun.de!roka.net!news.space.net!news.ecrc.de!news00.btx.dtag.de!not-for-mail!Thilo.KHK
Subject: Re: code in-liner
Date: Fri, 26 Jan 1996 16:56:00 +0000
References: <DLFnE9.Anq@Cadence.COM>
X-Gateway: ZCONNECT XX ius.gun.de [UNIX/Connect v0.73]
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

David Mallon wrote:
> 
> Anyone know if 'code in-liners' exist for Smalltalk.
> 
> This would be useful for those special cases where, for efficiency reasons,
> it is necessary to duplicate code.
> 
> Currently the only solution is to copy the code, which carries a horrible
> maintenance penalty.
> 
> --
> -------------------------------------------------------------------------> ====  Dr. David J. Mallon,              |Email: mallon@cadence.com
> ==//  Senior Member of Technical Staff, | http://settee:80/~mallon/
>    ////   Cadence Design Systems,           |  Tel: +44 131 225 3434 x104

Depends on the Smalltalk you are using. In e.g. VisualWorks you can 
easily implement this feature. Change 
SmalltalkCompiler>compile:in:notifying:ifFail: to substitute the macros. 
Don't forget to make the method dependent of the macro, which e.g. is 
held in global or class variables. Implementing the corresponding update: 
method in CompiledMethod allows you to automatically recompile methods 
when a macro changes.

BTW: Smalltalk users usually don't care of the speed possibly gained by 
using things such as code inlining. And they often get faster 
applications in the end...
Think of it again. Use methods or code blocks instead.
