Method.st
changeset 423 7a4bfd3cc267
parent 421 a0807a38319d
child 438 6c03b347369f
--- a/Method.st	Thu Sep 07 13:59:50 1995 +0200
+++ b/Method.st	Fri Sep 08 18:46:46 1995 +0200
@@ -23,7 +23,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Method.st,v 1.47 1995-09-03 15:05:22 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Method.st,v 1.48 1995-09-08 16:46:11 claus Exp $
 '!
 
 !Method class methodsFor:'documentation'!
@@ -44,7 +44,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Method.st,v 1.47 1995-09-03 15:05:22 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Method.st,v 1.48 1995-09-08 16:46:11 claus Exp $
 "
 !
 
@@ -158,7 +158,7 @@
 maxNumberOfArguments
     "this limit will be removed in one of the next versions ..."
 
-    ^ 15  "cannot be easily changed"
+    ^ 15  "cannot be easily changed; should ask the VM about this number"
 ! !
 
 !Method methodsFor:'queries'!
@@ -168,6 +168,29 @@
      true returned here - the method is redefined from Object."
 
     ^ true
+!
+
+modificationTime
+    "try to extract the modificationTime as a timeStamp from
+     the receivers source. If there is no source or no history line, 
+     we do not know the modification time, and nil is returned."
+
+    |s list histLine|
+
+    HistoryManager isNil ifTrue:[^ nil].
+    s := self source.
+    s isNil ifTrue:[^ nil].
+    list := HistoryManager getAllHistoriesFrom:s.
+    list size == 0 ifTrue:[^ nil].
+    histLine := list last.
+    ^ AbsoluteTime date:histLine date time:histLine time
+
+    "
+     (Method compiledMethodAt:#modificationTime) modificationTime
+     (Method compiledMethodAt:#isMethod) modificationTime 
+    "
+
+    "Modified: 8.9.1995 / 15:08:22 / claus"
 ! !
 
 !Method methodsFor:'accessing'!
@@ -1447,11 +1470,11 @@
      dont want a lazy method ...
     "
     Class withoutUpdatingChangesDo:[
-        silent := Smalltalk silentLoading:true.
-        lazy := Compiler compileLazy:false.
-        machineCode := Compiler stcCompilation:#never.
+	silent := Smalltalk silentLoading:true.
+	lazy := Compiler compileLazy:false.
+	machineCode := Compiler stcCompilation:#never.
 
-        [
+	[
 	    |compiler|
 
 	    compiler := cls compilerClass.
@@ -1462,20 +1485,20 @@
 	    "/
 	    (compiler respondsTo:#compile:forClass:inCategory:notifying:install:skipIfSame:)
 	    ifTrue:[
-	        temporaryMethod := compiler
+		temporaryMethod := compiler
 				     compile:sourceString
 				     forClass:cls
 				     inCategory:(self category)
 				     notifying:nil
 				     install:false.
 	    ] ifFalse:[
-	        temporaryMethod := compiler new
+		temporaryMethod := compiler new
 				     compile:sourceString 
 				     in:cls 
 				     notifying:nil 
 				     ifFail:nil
 	    ].
-        ] valueNowOrOnUnwindDo:[
+	] valueNowOrOnUnwindDo:[
 	    Compiler compileLazy:lazy.
 	    Compiler stcCompilation:machineCode.
 	    Smalltalk silentLoading:silent.