.
authorclaus
Mon, 28 Aug 1995 01:21:07 +0200
changeset 414 be4ea3cf7748
parent 413 e5a7deafe8bd
child 415 e6ef421822d4
.
Class.st
Method.st
Project.st
--- a/Class.st	Sun Aug 27 16:27:20 1995 +0200
+++ b/Class.st	Mon Aug 28 01:21:07 1995 +0200
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Class.st,v 1.56 1995-08-27 01:35:14 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Class.st,v 1.57 1995-08-27 23:20:08 claus Exp $
 '!
 
 !Class class methodsFor:'documentation'!
@@ -43,7 +43,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Class.st,v 1.56 1995-08-27 01:35:14 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Class.st,v 1.57 1995-08-27 23:20:08 claus Exp $
 "
 !
 
@@ -1106,6 +1106,23 @@
     ]
 !
 
+addChangeRecordForMethodPrivacy:aMethod to:aStream
+    "append a method-privacy-change-record to aStream"
+
+    |selector|
+
+    selector := aMethod selector.
+    selector notNil ifTrue:[
+	aStream nextPutAll:'('.
+	self printClassNameOn:aStream.
+	aStream nextPutAll:(' compiledMethodAt:' , selector storeString).
+	aStream nextPutAll:(') privacy:' , aMethod privacy storeString).
+	aStream nextPut:(aStream class chunkSeparator).
+    ]
+
+    "Modified: 27.8.1995 / 22:59:56 / claus"
+!
+
 addChangeRecordForClass:aClass to:aStream
     "append a class-definition-record to aStream"
 
@@ -1237,6 +1254,20 @@
     ]
 !
 
+addChangeRecordForMethodPrivacy:aMethod
+    "add a method-privacy-change-record to the changes file"
+
+    UpdatingChanges ifTrue:[
+	self writingChangePerform:#addChangeRecordForMethodPrivacy:to: with:aMethod.
+	"this test allows a smalltalk without Projects/ChangeSets"
+	Project notNil ifTrue:[
+	    Project addMethodPrivacyChange:aMethod in:self
+	]
+    ]
+
+    "Modified: 27.8.1995 / 22:47:32 / claus"
+!
+
 addChangeRecordForClass:aClass
     "add a class-definition-record to the changes file"
 
--- a/Method.st	Sun Aug 27 16:27:20 1995 +0200
+++ b/Method.st	Mon Aug 28 01:21:07 1995 +0200
@@ -23,7 +23,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Method.st,v 1.44 1995-08-17 16:05:23 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Method.st,v 1.45 1995-08-27 23:20:46 claus Exp $
 '!
 
 !Method class methodsFor:'documentation'!
@@ -44,7 +44,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Method.st,v 1.44 1995-08-17 16:05:23 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Method.st,v 1.45 1995-08-27 23:20:46 claus Exp $
 "
 !
 
@@ -316,6 +316,36 @@
     ]
 !
 
+privacy
+    "return a symbol describing the methods access rights (privacy);
+     Currently, this is one of #private, #protected and #public.
+     Notice: method privacy is a nonstandard feature, not supported
+     by other smalltalk implementations and not specified in the ANSI spec.
+     This is EXPERIMENTAL - and being evaluated for usability.
+     It may change or even vanish (if it shows to be not useful)."
+
+    self isPrivate ifTrue:[^ #private].
+    self isProtected ifTrue:[^ #protected].
+    ^ #public
+
+    "Modified: 27.8.1995 / 22:53:31 / claus"
+!
+
+privacy:aSymbol
+    "set the methods access rights (privacy) from a symbol;
+     Currently, this must be one of #private, #protected and #public.
+     Notice: method privacy is a nonstandard feature, not supported
+     by other smalltalk implementations and not specified in the ANSI spec.
+     This is EXPERIMENTAL - and being evaluated for usability.
+     It may change or even vanish (if it shows to be not useful)."
+
+    aSymbol == #private ifTrue:[^ self setToPrivate].
+    aSymbol == #protected ifTrue:[^ self setToProtected].
+    self setToPublic
+
+    "Modified: 27.8.1995 / 22:58:08 / claus"
+!
+
 setToPrivate
     "set the flag bit stating that this method is private. 
      Execution of the receiver will only be allowed for self/super-sends from 
--- a/Project.st	Sun Aug 27 16:27:20 1995 +0200
+++ b/Project.st	Mon Aug 28 01:21:07 1995 +0200
@@ -23,7 +23,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Project.st,v 1.26 1995-08-11 03:03:08 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Project.st,v 1.27 1995-08-27 23:21:07 claus Exp $
 '!
 
 !Project class methodsFor:'documentation'!
@@ -44,7 +44,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Project.st,v 1.26 1995-08-11 03:03:08 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Project.st,v 1.27 1995-08-27 23:21:07 claus Exp $
 "
 !
 
@@ -171,6 +171,18 @@
     and:[(c := p changeSet) notNil]) ifTrue:[
 	c addMethodCategoryChange:aMethod category:newCategory in:aClass 
     ]
+!
+
+addMethodPrivacyChange:aMethod in:aClass
+    |p c|
+
+    p := CurrentProject.
+    (p notNil 
+    and:[(c := p changeSet) notNil]) ifTrue:[
+	c addMethodPrivacyChange:aMethod in:aClass 
+    ]
+
+    "Modified: 27.8.1995 / 22:48:17 / claus"
 ! !
 
 !Project methodsFor:'accessing'!