1564 unsigned char *cp1, *cp2; |
1564 unsigned char *cp1, *cp2; |
1565 OBJ cls; |
1565 OBJ cls; |
1566 OBJ myCls; |
1566 OBJ myCls; |
1567 |
1567 |
1568 if (__isNonNilObject(s)) { |
1568 if (__isNonNilObject(s)) { |
1569 cls = __qClass(s); |
1569 cls = __qClass(s); |
1570 myCls = __qClass(self); |
1570 myCls = __qClass(self); |
1571 |
1571 |
1572 if ((cls == String) || (cls == Symbol) || (cls == myCls)) { |
1572 if (__isStringLike(s) || (cls == myCls)) { |
1573 cp1 = __stringVal(self); |
1573 cp1 = __stringVal(self); |
1574 |
1574 |
1575 /* |
1575 /* |
1576 * care for instances of subclasses ... |
1576 * care for instances of subclasses ... |
1577 */ |
1577 */ |
1578 if (myCls != String) { |
1578 if (myCls != String) { |
1579 int n = __OBJS2BYTES__(__intVal(__ClassInstPtr(myCls)->c_ninstvars)); |
1579 int n = __OBJS2BYTES__(__intVal(__ClassInstPtr(myCls)->c_ninstvars)); |
1580 |
1580 |
1581 cp1 += n; |
1581 cp1 += n; |
1582 } |
1582 } |
1583 |
1583 |
1584 cp2 = __stringVal(s); |
1584 cp2 = __stringVal(s); |
1585 /* |
1585 /* |
1586 * care for instances of subclasses ... |
1586 * care for instances of subclasses ... |
1587 */ |
1587 */ |
1588 if (cls != String) { |
1588 if (cls != String) { |
1589 int n = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars)); |
1589 int n = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars)); |
1590 |
1590 |
1591 cp2 += n; |
1591 cp2 += n; |
1592 } |
1592 } |
1593 |
1593 |
1594 #ifdef HAS_STRCOLL |
1594 #ifdef HAS_STRCOLL |
1595 cmp = strcoll(cp1, cp2); |
1595 cmp = strcoll(cp1, cp2); |
1596 #else |
1596 #else |
1597 cmp = strcmp(cp1, cp2); |
1597 cmp = strcmp(cp1, cp2); |
1598 #endif |
1598 #endif |
1599 |
1599 |
1600 if (cmp > 0) { |
1600 if (cmp > 0) { |
1601 RETURN ( __mkSmallInteger(1) ); |
1601 RETURN ( __mkSmallInteger(1) ); |
1602 } |
1602 } |
1603 if (cmp < 0) { |
1603 if (cmp < 0) { |
1604 RETURN ( __mkSmallInteger(-1) ); |
1604 RETURN ( __mkSmallInteger(-1) ); |
1605 } |
1605 } |
1606 RETURN ( __mkSmallInteger(0) ); |
1606 RETURN ( __mkSmallInteger(0) ); |
1607 } |
1607 } |
1608 } |
1608 } |
1609 %}. |
1609 %}. |
1610 " |
1610 " |
1611 currently, this operation is only defined for strings, symbols |
1611 currently, this operation is only defined for strings, symbols |
1612 and subclasses. |
1612 and subclasses. |
1961 '{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}' asUUID |
1961 '{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}' asUUID |
1962 'EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B' asUUID |
1962 'EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B' asUUID |
1963 " |
1963 " |
1964 |
1964 |
1965 "Modified: / 02-08-2007 / 16:43:29 / cg" |
1965 "Modified: / 02-08-2007 / 16:43:29 / cg" |
1966 ! |
|
1967 |
|
1968 uncapitalized |
|
1969 "Answer a <readableString> which is a copy of the receiver but with |
|
1970 the first character converted to its lowercase equivalent." |
|
1971 |
|
1972 ^ self asLowercaseFirst |
|
1973 "/ | answer | |
|
1974 "/ #swAdded. |
|
1975 "/ (answer := self copy) isEmpty ifFalse: [ |
|
1976 "/ answer at: 1 put: (self first asLowercase)]. |
|
1977 "/ ^answer |
|
1978 ! |
1966 ! |
1979 |
1967 |
1980 withTabsExpanded:numSpaces |
1968 withTabsExpanded:numSpaces |
1981 "return a string with the characters of the receiver where all tabulator characters |
1969 "return a string with the characters of the receiver where all tabulator characters |
1982 are expanded into spaces (assuming numSpaces-col tabs). |
1970 are expanded into spaces (assuming numSpaces-col tabs). |