'From Squeak3.1alpha of 5 February 2001 [latest update: #3641] on 18 February 2001 at 9:18:18 pm'! "Change Set: compileInobtrusively-sw Date: 18 February 2001 Author: Scott Wallace Adds a way that certain automatically-generated and automatically-maintained code can be compiled totally inobtrusively, i.e., bypassing system logging, change-set logging, and recent-submissions logging."! !ClassDescription methodsFor: 'compiling' stamp: 'sw 2/18/2001 21:14'! compileInobtrusively: code classified: category "Compile the code and classify the resulting method in the given category, leaving no trail in the system log, nor in any change set, nor in the 'recent submissions' list. This should only be used when you know for sure that the compilation will succeed." | methodNode newMethod | methodNode _ self compilerClass new compile: code in: self notifying: nil ifFail: [^ nil]. self addSelector: methodNode selector withMethod: (newMethod _ methodNode generate: #(0 0 0 0)). self organization classify: methodNode selector under: category. ^ newMethod! ! !ClassDescription methodsFor: 'compiling' stamp: 'sw 2/18/2001 16:59'! compileProgrammatically: code classified: cat "compile the given code programmatically. In the current theory, we always do this unlogged as well, and do not accumulate the change in the current change set" ^ self compileInobtrusively: code classified: cat " | oldInitials | oldInitials _ Utilities authorInitialsPerSe. Utilities setAuthorInitials: 'programmatic'. self compile: code classified: cat. Utilities setAuthorInitials: oldInitials. "! ! !Player class methodsFor: 'slots' stamp: 'sw 2/18/2001 17:01'! compileInstVarAccessorsFor: varName "Compile getters and setteres for the given instance variable name" | nameString | nameString _ varName asString capitalized. self compileInobtrusively: ('get', nameString, ' ^ ', varName) classified: 'access'. self compileInobtrusively: ('set', nameString, ': val ', varName, ' _ val') classified: 'access'! ! !Player class methodsFor: 'namespace' stamp: 'sw 2/18/2001 17:01'! compileReferenceAccessorFor: varName "Compile reference accessors for the given variable. If the #capitalizedReferences preference is true, then nothing is done here" Preferences capitalizedReferences ifTrue: [^ self]. self class compileInobtrusively: ((self referenceAccessorSelectorFor: varName), ' ^ ', varName) classified: 'reference'! ! !CardPlayer class methodsFor: 'user-defined inst vars' stamp: 'sw 2/18/2001 17:02'! compileAccessorsFor: varName "Compile instance-variable accessor methods for the given variable name" | nameString | nameString _ varName asString capitalized. self compileInobtrusively: ('get', nameString, ' ^ ', varName) classified: 'access'. self compileInobtrusively: ('set', nameString, ': val ', varName, ' _ val') classified: 'access'! !