--- a/AbstractSourceFileReader.st Wed Nov 18 06:57:38 2015 +0100
+++ b/AbstractSourceFileReader.st Thu Nov 19 06:41:24 2015 +0100
@@ -1,5 +1,7 @@
"{ Package: 'stx:libbasic' }"
+"{ NameSpace: Smalltalk }"
+
Object subclass:#AbstractSourceFileReader
instanceVariableNames:''
classVariableNames:''
@@ -31,6 +33,12 @@
"Created: / 16-08-2009 / 10:15:05 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !
+!AbstractSourceFileReader class methodsFor:'queries'!
+
+isAbstract
+ ^ self == AbstractSourceFileReader
+! !
+
!AbstractSourceFileReader methodsFor:'fileIn'!
fileIn:aFilename
@@ -54,14 +62,14 @@
!AbstractSourceFileReader class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/AbstractSourceFileReader.st,v 1.7 2013-06-23 22:22:01 cg Exp $'
+ ^ '$Header$'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/AbstractSourceFileReader.st,v 1.7 2013-06-23 22:22:01 cg Exp $'
+ ^ '$Header$'
!
version_SVN
- ^'$Id: AbstractSourceFileReader.st,v 1.7 2013-06-23 22:22:01 cg Exp $'
+ ^'$Id$'
! !
--- a/AbstractSourceFileWriter.st Wed Nov 18 06:57:38 2015 +0100
+++ b/AbstractSourceFileWriter.st Thu Nov 19 06:41:24 2015 +0100
@@ -49,6 +49,12 @@
"
! !
+!AbstractSourceFileWriter class methodsFor:'queries'!
+
+isAbstract
+ ^ self == AbstractSourceFileWriter
+! !
+
!AbstractSourceFileWriter class methodsFor:'signal constants'!
methodSourceRewriteQuery
@@ -223,11 +229,11 @@
!AbstractSourceFileWriter class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/AbstractSourceFileWriter.st,v 1.12 2015-01-28 17:02:47 cg Exp $'
+ ^ '$Header$'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/AbstractSourceFileWriter.st,v 1.12 2015-01-28 17:02:47 cg Exp $'
+ ^ '$Header$'
!
version_SVN
--- a/AbstractTime.st Wed Nov 18 06:57:38 2015 +0100
+++ b/AbstractTime.st Thu Nov 19 06:41:24 2015 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 1995 by Claus Gittinger
All Rights Reserved
@@ -325,6 +323,10 @@
!AbstractTime class methodsFor:'queries'!
+isAbstract
+ ^ self == AbstractTime
+!
+
microsecondClockValue
"return microseconds seconds of now"
@@ -510,6 +512,7 @@
"
! !
+
!AbstractTime methodsFor:'abstract'!
hours
@@ -1028,6 +1031,7 @@
"/ ^ aTimestamp getSeconds - self getSeconds
! !
+
!AbstractTime methodsFor:'printing & storing'!
addBasicPrintBindingsTo:aDictionary language:languageOrNil
@@ -1460,10 +1464,10 @@
!AbstractTime class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/AbstractTime.st,v 1.92 2015-06-06 12:56:45 cg Exp $'
+ ^ '$Header$'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/AbstractTime.st,v 1.92 2015-06-06 12:56:45 cg Exp $'
+ ^ '$Header$'
! !
--- a/Autoload.st Wed Nov 18 06:57:38 2015 +0100
+++ b/Autoload.st Thu Nov 19 06:41:24 2015 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 1991 by Claus Gittinger
All Rights Reserved
@@ -614,7 +612,7 @@
!
isAbstract
- ^ false "/ actually: dont know, but do not want to load my class for this query
+ ^ false "/ actually: don't know, but do not want to load my class for this query
!
new
@@ -847,11 +845,11 @@
!Autoload class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.171 2015-05-16 09:51:57 cg Exp $'
+ ^ '$Header$'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/Autoload.st,v 1.171 2015-05-16 09:51:57 cg Exp $'
+ ^ '$Header$'
! !
--- a/Behavior.st Wed Nov 18 06:57:38 2015 +0100
+++ b/Behavior.st Thu Nov 19 06:41:24 2015 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1988 by Claus Gittinger
All Rights Reserved
@@ -23,7 +25,7 @@
!Behavior class methodsFor:'documentation'!
VS
- ^ '§Header: /cvs/stx/stx/libbasic/Behavior.st,v 1.315 2011/11/29 10:20:21 cg Exp §'
+ ^ '§Header: /cvs/stx/stx/libbasic/Behavior.st,v 1.315 2011/11/29 10:20:21 cg Exp §'
!
copyright
@@ -3157,9 +3159,9 @@
!Behavior methodsFor:'misc ui support'!
browse
- "open a browser showing the receiver"
-
- self browserClass openInClass:self
+ "open a browser showing the receiver. Returns the browser"
+
+ ^ self browserClass openInClass:self
"
Array browserClass
@@ -3168,9 +3170,10 @@
!
browse:selector
- "open a browser showing the receiver"
-
- self browserClass openInClass:self selector:selector
+ "open a browser showing the receiver.
+ Returns the browser"
+
+ ^ self browserClass openInClass:self selector:selector
"
Array browse:#at:put:
@@ -3574,6 +3577,11 @@
!
isAbstract
+ "true if this is an abstract class
+ (has no direct instances, should not be instantiated).
+ Usually, this means that it only provides shared protocol for its
+ subclasses, which should be used."
+
^ false
!
@@ -3637,6 +3645,14 @@
"Created: / 06-08-2006 / 15:23:57 / cg"
!
+isUtilityClass
+ "a utility class is one which is not to be instantiated,
+ but only provides a number of utility functions on the class side.
+ It is usually also abstract"
+
+ ^ false
+!
+
isVisualStartable
^ false
--- a/Boolean.st Wed Nov 18 06:57:38 2015 +0100
+++ b/Boolean.st Thu Nov 19 06:41:24 2015 +0100
@@ -11,6 +11,8 @@
"
"{ Package: 'stx:libbasic' }"
+"{ NameSpace: Smalltalk }"
+
Object subclass:#Boolean
instanceVariableNames:''
classVariableNames:''
@@ -90,6 +92,9 @@
"
! !
+
+
+
!Boolean class methodsFor:'queries'!
hasSharedInstances
@@ -100,6 +105,10 @@
^ true
!
+isAbstract
+ ^ self == Boolean
+!
+
isBuiltInClass
"return true if this class is known by the run-time-system.
Here, true is returned (for my two subclasses)."
@@ -110,6 +119,8 @@
! !
+
+
!Boolean methodsFor:'blocked'!
addDependent:someOne
@@ -193,6 +204,7 @@
^ self printString
! !
+
!Boolean methodsFor:'testing'!
isBoolean
@@ -228,13 +240,14 @@
^ aVisitor visitBoolean:self with:aParameter
! !
+
!Boolean class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Boolean.st,v 1.43 2014-07-09 16:21:02 cg Exp $'
+ ^ '$Header$'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/Boolean.st,v 1.43 2014-07-09 16:21:02 cg Exp $'
+ ^ '$Header$'
! !
--- a/Infinity.st Wed Nov 18 06:57:38 2015 +0100
+++ b/Infinity.st Thu Nov 19 06:41:24 2015 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
This is a Manchester Goodie. It is distributed freely on condition
that you observe these conditions in respect of the whole Goodie, and on
@@ -170,6 +168,12 @@
"
! !
+!Infinity class methodsFor:'queries'!
+
+isAbstract
+ ^ self == Infinity
+! !
+
!Infinity methodsFor:'arithmetic'!
* aNumber
--- a/MetaNumber.st Wed Nov 18 06:57:38 2015 +0100
+++ b/MetaNumber.st Thu Nov 19 06:41:24 2015 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 2003 by eXept Software AG
All Rights Reserved
@@ -52,6 +50,12 @@
"
! !
+!MetaNumber class methodsFor:'queries'!
+
+isAbstract
+ ^ self == MetaNumber
+! !
+
!MetaNumber methodsFor:'coercing & converting'!
asFloat
--- a/ProgrammingLanguage.st Wed Nov 18 06:57:38 2015 +0100
+++ b/ProgrammingLanguage.st Thu Nov 19 06:41:24 2015 +0100
@@ -186,6 +186,12 @@
"Created: / 16-08-2009 / 10:57:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !
+!ProgrammingLanguage class methodsFor:'queries'!
+
+isAbstract
+ ^ self == ProgrammingLanguage
+! !
+
!ProgrammingLanguage class methodsFor:'testing'!
isAvailable: langName
@@ -255,6 +261,7 @@
"Created: / 16-08-2009 / 10:42:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !
+
!ProgrammingLanguage methodsFor:'accessing-classes'!
codeGeneratorClass
@@ -475,12 +482,6 @@
"Created: / 17-03-2011 / 10:16:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-isJavaLike
- "true iff this is the Java like language (Java or Ruby)"
-
- ^ false
-!
-
isProgrammingLanguage
^true
@@ -573,11 +574,11 @@
!ProgrammingLanguage class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ProgrammingLanguage.st,v 1.35 2015-02-08 03:40:54 cg Exp $'
+ ^ '$Header$'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/ProgrammingLanguage.st,v 1.35 2015-02-08 03:40:54 cg Exp $'
+ ^ '$Header$'
!
version_SVN
--- a/String.st Wed Nov 18 06:57:38 2015 +0100
+++ b/String.st Thu Nov 19 06:41:24 2015 +0100
@@ -930,10 +930,10 @@
#ifdef __SCHTEAM__
if (start.isSmallInteger()
&& aCharacter.isSTCharacter()) {
- int idx1Based = start.intValue(); // st index is 1 based
- int jIdx = self.asString().indexOf(aCharacter.charValue(), idx1Based-1);
-
- return context._RETURN( jIdx+1 ); // st index is 1 based
+ int idx1Based = start.intValue(); // st index is 1 based
+ int jIdx = self.asString().indexOf(aCharacter.charValue(), idx1Based-1);
+
+ return context._RETURN( jIdx+1 ); // st index is 1 based
}
#else
@@ -951,77 +951,92 @@
OBJ cls;
if (__isSmallInteger(start)) {
- index = __intVal(start);
- if (index > 0) {
- if (__isCharacter(aCharacter)) {
- byteValue = __intVal(__characterVal(aCharacter));
- if (byteValue <= 0xFF) {
- last = __stringSize(self);
- cp = __stringVal(self);
- if ((cls = __qClass(self)) != String) {
- int numInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-
- cp += numInstBytes;
- last -= numInstBytes;
- }
- if (index <= last) {
+ index = __intVal(start);
+ if (index > 0) {
+ if (__isCharacter(aCharacter)) {
+ byteValue = __intVal(__characterVal(aCharacter));
+ if (byteValue <= 0xFF) {
+ last = __stringSize(self);
+ cp = __stringVal(self);
+ if ((cls = __qClass(self)) != String) {
+ int numInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+
+ cp += numInstBytes;
+ last -= numInstBytes;
+ }
+ if (index <= last) {
# ifdef FAST_MEMCHR
- ncp = (unsigned char *) memchr(cp+index-1, byteValue, last+1-index);
- if (ncp) {
- RETURN ( __mkSmallInteger(ncp - cp + 1) );
- }
+ ncp = (unsigned char *) memchr(cp+index-1, byteValue, last+1-index);
+ if (ncp) {
+ RETURN ( __mkSmallInteger(ncp - cp + 1) );
+ }
# else
# ifdef __UNROLL_LOOPS__
- {
- int last3 = last-3;
-
- for (; index <= last3; index += 4) {
- if (cp[index-1] == byteValue) { RETURN ( __mkSmallInteger(index) ); }
- if (cp[index-1+1] == byteValue) { RETURN ( __mkSmallInteger(index+1) ); }
- if (cp[index-1+2] == byteValue) { RETURN ( __mkSmallInteger(index+2) ); }
- if (cp[index-1+3] == byteValue) { RETURN ( __mkSmallInteger(index+3) ); }
- }
- }
+ {
+ int last3 = last-3;
+
+ for (; index <= last3; index += 4) {
+ if (cp[index-1] == byteValue) { RETURN ( __mkSmallInteger(index) ); }
+ if (cp[index-1+1] == byteValue) { RETURN ( __mkSmallInteger(index+1) ); }
+ if (cp[index-1+2] == byteValue) { RETURN ( __mkSmallInteger(index+2) ); }
+ if (cp[index-1+3] == byteValue) { RETURN ( __mkSmallInteger(index+3) ); }
+ }
+ }
# endif
# ifdef V1
- for (; index <= last; index++) {
- if (cp[index-1] == byteValue) {
- RETURN ( __mkSmallInteger(index) );
- }
- }
+ for (; index <= last; index++) {
+ if (cp[index-1] == byteValue) {
+ RETURN ( __mkSmallInteger(index) );
+ }
+ }
# endif
# ifdef V2
- {
- // see bit twiddling hacks
+ {
+ // see bit twiddling hacks
# define hasZeroByte(v) (((v) - 0x01010101UL) & ~(v) & 0x80808080UL)
# define hasByteM(v,m) hasZeroByte( (v) ^ m)
-
- // the following loop checks four bytes at once
- if (((index-1) & 0x3) == 0) {
- int last4 = last-4;
- int m = (~0UL/255 * (byteValue));
-
- while (index <= last4) {
- unsigned int v = *(unsigned int *)(cp+index-1);
-
- if (hasByteM(v,m)) break;
- index += 4;
- }
- }
- while (index <= last) {
- if (cp[index-1] == byteValue) {
- RETURN ( __mkSmallInteger(index) );
- }
- index++;
- }
- }
+# if __POINTER_SIZE__ == 8
+# define hasZeroByte8(v) (((v) - 0x0101010101010101ULL) & ~(v) & 0x8080808080808080ULL)
+# define hasByteM8(v,m) hasZeroByte8( (v) ^ m)
+ // the following loop checks eight bytes at once
+ if (((index-1) & 0x7) == 0) {
+ int last8 = last-8;
+ INT m = (~0UL/255 * (byteValue));
+
+ while (index <= last8) {
+ unsigned INT v = *(unsigned INT *)(cp+index-1);
+
+ if (hasByteM8(v,m)) break;
+ index += 8;
+ }
+ }
+# endif
+ // the following loop checks four bytes at once
+ if (((index-1) & 0x3) == 0) {
+ int last4 = last-4;
+ int m = (~0UL/255 * (byteValue));
+
+ while (index <= last4) {
+ unsigned int v = *(unsigned int *)(cp+index-1);
+
+ if (hasByteM(v,m)) break;
+ index += 4;
+ }
+ }
+ while (index <= last) {
+ if (cp[index-1] == byteValue) {
+ RETURN ( __mkSmallInteger(index) );
+ }
+ index++;
+ }
+ }
# endif
# endif
- }
- }
- }
- RETURN ( __mkSmallInteger(0) );
- }
+ }
+ }
+ }
+ RETURN ( __mkSmallInteger(0) );
+ }
}
# undef V2
#endif /* not SCHTEAM */
@@ -1124,14 +1139,14 @@
s atAllPut:$a.
s at:512 put:(Character space).
Time millisecondsToRun:[
- 1000000 timesRepeat:[ s indexOf:(Character space) ]
+ 1000000 timesRepeat:[ s indexOf:(Character space) ]
]
timing (ms):
- v1: 1763 normal
- 2340 +unroll
- 3308 memsrch !!
- v2: 1045
+ v1: 1763 normal
+ 2340 +unroll
+ 3308 memsrch !!
+ v2: 1045
"
"Modified: / 10-01-2012 / 17:09:34 / cg"