Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!nntp.sei.cmu.edu!news.cis.ohio-state.edu!rutgers!engr.orst.edu!reuter.cse.ogi.edu!psgrain!usenet.eel.ufl.edu!news-res.gsl.net!news.gsl.net!uwm.edu!spool.mu.edu!howland.reston.ans.net!blackbush.xlink.net!ins.net!heeg.de!gustav!hmm
From: hmm@gustav (Hans-Martin Mosner)
Subject: [VW] Implementation for +=, -=, *=, ...
Message-ID: <DvpKxp.4Br@heeg.de>
Sender: uucp@heeg.de
Organization: Georg Heeg Objektorientierte Systeme, Dortmund, FRG
X-Newsreader: TIN [version 1.2 PL2]
Date: Tue, 6 Aug 1996 08:58:37 GMT
Lines: 32

The long-winding thread on language performance and feature comparison
inspired me to implement the +=, -= etc. operators in VisualWorks.
Its' amazingly simple. If you like to play around with the Compiler,
you will like this.

Hans-Martin

!MessageNode methodsFor: 'transforming'!

transformOperatorEquals
	receiver class == VariableNode ifFalse: [^nil].
	^AssignmentNode new variable: receiver value: (MessageNode new
			receiver: receiver
			selector: selector first asSymbol
			arguments: arguments)! !
			
!MessageNode class methodsFor: 'class initialization'!

initializeAssignments
	"MessageNode initializeAssignments"

	'+-*/\&|' do: [:op | MacroSelectors at: (String with: op with: $=) asSymbol
			put: #transformOperatorEquals]! !

MessageNode initializeAssignments!


--
+--- Hans-Martin Mosner -------- Senior Smalltalk Guru ---+
| These opinions are entirely ficticious.  Any similarity |
| to real opinions is purely coincidental and unintended. |
+--- <hmm@heeg.de> ------ URL:http://www.heeg.de/~hmm/ ---+
