added: #literalsDetect:ifNone:
authorClaus Gittinger <cg@exept.de>
Fri, 13 Nov 2009 10:55:39 +0100
changeset 2275 726c29682fd8
parent 2274 eac570b08474
child 2276 8dd02a5127f3
added: #literalsDetect:ifNone:
LazyMethod.st
--- a/LazyMethod.st	Mon Nov 09 21:01:13 2009 +0100
+++ b/LazyMethod.st	Fri Nov 13 10:55:39 2009 +0100
@@ -9,7 +9,6 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
-
 "{ Package: 'stx:libcomp' }"
 
 Method variableSubclass:#LazyMethod
@@ -180,6 +179,15 @@
     ^ #()
 !
 
+literalsDetect:aBlock ifNone:exceptionalValue
+    "cannot ask a lazyMethod for literals ..."
+
+    |m|
+
+    (m := self asExecutableMethod) notNil ifTrue:[^ m literalsDetect:aBlock ifNone:exceptionalValue].
+    ^ exceptionalValue value
+!
+
 messagesSent
     "cannot ask a lazyMethod for messagesSent ..."
 
@@ -222,7 +230,11 @@
 !LazyMethod class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/LazyMethod.st,v 1.34 2003-09-05 10:27:21 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/LazyMethod.st,v 1.35 2009-11-13 09:55:39 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libcomp/LazyMethod.st,v 1.35 2009-11-13 09:55:39 cg Exp $'
 ! !
 
 LazyMethod initialize!