From 88459fabb0f0c1a8307d8cfa657e92708e5cbfff Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 14:22:44 +0100 Subject: [PATCH 01/15] Add #greaseAsByteArray and implementation for Squeak --- .../instance/greaseAsByteArray.st | 3 +++ .../Collection.extension/properties.json | 3 +++ .../instance/integerAsByteArray..st | 3 +++ .../instance/greaseAsByteArray.st | 3 +++ .../instance/greaseByteAt..st | 3 +++ .../instance/greaseBytesCount.st | 3 +++ .../instance/integerAsByteArray..st | 7 ++++++ .../instance/greaseByteAt..st | 8 ++++++ .../instance/greaseBytesCount.st | 8 ++++++ .../LargeInteger.extension/properties.json | 3 +++ .../ManifestGreaseSqueakCore.class/README.md | 1 + ...iciousTrueFalseOrNilRuleV1FalsePositive.st | 3 +++ ...eSendsDifferentSuperRuleV1FalsePositive.st | 3 +++ .../ruleSuperSendsRuleV1FalsePositive.st | 3 +++ .../properties.json | 11 ++++++++ .../instance/greaseByteAt..st | 14 +++++++++++ .../instance/greaseBytesCount.st | 25 +++++++++++++++++++ .../monticello.meta/categories.st | 1 + .../instance/testBase64Decode.st | 2 +- .../instance/testBase64Encode.st | 2 +- .../instance/testGreaseAsByteArray.st | 5 ++++ .../instance/testGreaseByteAt.st | 4 +++ .../instance/testGreaseBytesCount.st | 3 +++ 23 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 repository/Grease-Core.package/Collection.extension/instance/greaseAsByteArray.st create mode 100644 repository/Grease-Core.package/Collection.extension/properties.json create mode 100644 repository/Grease-Core.package/GRPlatform.class/instance/integerAsByteArray..st create mode 100644 repository/Grease-Core.package/Integer.extension/instance/greaseAsByteArray.st create mode 100644 repository/Grease-Core.package/Integer.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Core.package/Integer.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/integerAsByteArray..st create mode 100644 repository/Grease-Squeak-Core.package/LargeInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Squeak-Core.package/LargeInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Squeak-Core.package/LargeInteger.extension/properties.json create mode 100644 repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/README.md create mode 100644 repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/class/ruleLiteralArrayContainsSuspiciousTrueFalseOrNilRuleV1FalsePositive.st create mode 100644 repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/class/ruleSendsDifferentSuperRuleV1FalsePositive.st create mode 100644 repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/class/ruleSuperSendsRuleV1FalsePositive.st create mode 100644 repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/properties.json create mode 100644 repository/Grease-Squeak-Core.package/SmallInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Squeak-Core.package/SmallInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseAsByteArray.st create mode 100644 repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseByteAt.st create mode 100644 repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseBytesCount.st diff --git a/repository/Grease-Core.package/Collection.extension/instance/greaseAsByteArray.st b/repository/Grease-Core.package/Collection.extension/instance/greaseAsByteArray.st new file mode 100644 index 00000000..dacf78b3 --- /dev/null +++ b/repository/Grease-Core.package/Collection.extension/instance/greaseAsByteArray.st @@ -0,0 +1,3 @@ +*Grease-Core +greaseAsByteArray + ^ self asByteArray \ No newline at end of file diff --git a/repository/Grease-Core.package/Collection.extension/properties.json b/repository/Grease-Core.package/Collection.extension/properties.json new file mode 100644 index 00000000..48f9f8d9 --- /dev/null +++ b/repository/Grease-Core.package/Collection.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "Collection" +} \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/integerAsByteArray..st b/repository/Grease-Core.package/GRPlatform.class/instance/integerAsByteArray..st new file mode 100644 index 00000000..6d847f6d --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/integerAsByteArray..st @@ -0,0 +1,3 @@ +encoding +integerAsByteArray: anInteger + ^ anInteger asByteArray \ No newline at end of file diff --git a/repository/Grease-Core.package/Integer.extension/instance/greaseAsByteArray.st b/repository/Grease-Core.package/Integer.extension/instance/greaseAsByteArray.st new file mode 100644 index 00000000..844c7d1f --- /dev/null +++ b/repository/Grease-Core.package/Integer.extension/instance/greaseAsByteArray.st @@ -0,0 +1,3 @@ +*Grease-Core +greaseAsByteArray + ^ GRPlatform current integerAsByteArray: self \ No newline at end of file diff --git a/repository/Grease-Core.package/Integer.extension/instance/greaseByteAt..st b/repository/Grease-Core.package/Integer.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..b3317119 --- /dev/null +++ b/repository/Grease-Core.package/Integer.extension/instance/greaseByteAt..st @@ -0,0 +1,3 @@ +*Grease-Core +greaseByteAt: index + ^ self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/Integer.extension/instance/greaseBytesCount.st b/repository/Grease-Core.package/Integer.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..92dda9bd --- /dev/null +++ b/repository/Grease-Core.package/Integer.extension/instance/greaseBytesCount.st @@ -0,0 +1,3 @@ +*Grease-Core +greaseBytesCount + ^ self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/integerAsByteArray..st b/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/integerAsByteArray..st new file mode 100644 index 00000000..124003a4 --- /dev/null +++ b/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/integerAsByteArray..st @@ -0,0 +1,7 @@ +encoding +integerAsByteArray: anInteger + | stream | + stream := ByteArray new writeStream. + anInteger greaseBytesCount to: 1 by: -1 do: [:digitIndex | + stream nextPut: (anInteger greaseByteAt: digitIndex)]. + ^ stream contents \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-Squeak-Core.package/LargeInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..cb42ba36 --- /dev/null +++ b/repository/Grease-Squeak-Core.package/LargeInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,8 @@ +*Grease-Squeak-Core +greaseByteAt: index + "Primitive. Answer the value of an indexable field in the receiver. LargePositiveInteger uses bytes of base two number, and each is a 'digit' base 256. Fail if the argument (the index) is not an Integer or is out of bounds. Essential. See Object documentation whatIsAPrimitive." + + + self bytesCount < index + ifTrue: [^0] + ifFalse: [^super at: index] \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/LargeInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Squeak-Core.package/LargeInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..fef20052 --- /dev/null +++ b/repository/Grease-Squeak-Core.package/LargeInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,8 @@ +*Grease-Squeak-Core +greaseBytesCount + "Primitive. Answer the number of indexable fields in the receiver. This + value is the same as the largest legal subscript. Essential. See Object + documentation whatIsAPrimitive." + + + self primitiveFailed \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/LargeInteger.extension/properties.json b/repository/Grease-Squeak-Core.package/LargeInteger.extension/properties.json new file mode 100644 index 00000000..029bc676 --- /dev/null +++ b/repository/Grease-Squeak-Core.package/LargeInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "LargeInteger" +} \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/README.md b/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/README.md new file mode 100644 index 00000000..69df3dee --- /dev/null +++ b/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/README.md @@ -0,0 +1 @@ +Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/class/ruleLiteralArrayContainsSuspiciousTrueFalseOrNilRuleV1FalsePositive.st b/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/class/ruleLiteralArrayContainsSuspiciousTrueFalseOrNilRuleV1FalsePositive.st new file mode 100644 index 00000000..30d0c795 --- /dev/null +++ b/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/class/ruleLiteralArrayContainsSuspiciousTrueFalseOrNilRuleV1FalsePositive.st @@ -0,0 +1,3 @@ +code-critics +ruleLiteralArrayContainsSuspiciousTrueFalseOrNilRuleV1FalsePositive + ^ #(#(#(#RGMetaclassDefinition #(#'ManifestGreaseSqueakCore class' #ManifestGreaseSqueakCore)) #'2023-10-29T14:22:04.342701+01:00') ) \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/class/ruleSendsDifferentSuperRuleV1FalsePositive.st b/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/class/ruleSendsDifferentSuperRuleV1FalsePositive.st new file mode 100644 index 00000000..590a0f54 --- /dev/null +++ b/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/class/ruleSendsDifferentSuperRuleV1FalsePositive.st @@ -0,0 +1,3 @@ +code-critics +ruleSendsDifferentSuperRuleV1FalsePositive + ^ #(#(#(#RGMethodDefinition #(#LargeInteger #greaseByteAt: #false)) #'2023-10-29T14:21:20.47823+01:00') ) \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/class/ruleSuperSendsRuleV1FalsePositive.st b/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/class/ruleSuperSendsRuleV1FalsePositive.st new file mode 100644 index 00000000..fc987551 --- /dev/null +++ b/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/class/ruleSuperSendsRuleV1FalsePositive.st @@ -0,0 +1,3 @@ +code-critics +ruleSuperSendsRuleV1FalsePositive + ^ #(#(#(#RGMethodDefinition #(#LargeInteger #greaseByteAt: #false)) #'2023-10-29T14:20:58.840268+01:00') ) \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/properties.json b/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/properties.json new file mode 100644 index 00000000..4ca4e732 --- /dev/null +++ b/repository/Grease-Squeak-Core.package/ManifestGreaseSqueakCore.class/properties.json @@ -0,0 +1,11 @@ +{ + "commentStamp" : "", + "super" : "PackageManifest", + "category" : "Grease-Squeak-Core-Manifest", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "ManifestGreaseSqueakCore", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/SmallInteger.extension/instance/greaseByteAt..st b/repository/Grease-Squeak-Core.package/SmallInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..6052de43 --- /dev/null +++ b/repository/Grease-Squeak-Core.package/SmallInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,14 @@ +*Grease-Squeak-Core +greaseByteAt: n + "Answer the value of an apparent byte-indexable field in the receiver, + analogous to the large integers, which are organized as bytes." + + n = 1 + ifTrue: [ + "Negate carefully in case the receiver is SmallInteger minVal" + ^ self < 0 + ifTrue: [ -256 - self bitAnd: 255 ] + ifFalse: [ self bitAnd: 255 ] ]. + ^ self < 0 + ifTrue: [ (-256 - self bitShift: -8) + 1 byteAt: n - 1 ] + ifFalse: [ (self bitShift: 8 - (n bitShift: 3)) bitAnd: 255 ] \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/SmallInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Squeak-Core.package/SmallInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..4f61b909 --- /dev/null +++ b/repository/Grease-Squeak-Core.package/SmallInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,25 @@ +*Grease-Squeak-Core +greaseBytesCount + "Answer the number of indexable fields in the receiver. This value is the + same as the largest legal subscript. Included so that a SmallInteger can + behave like a LargePositiveInteger or LargeNegativeInteger." + + "32768 == (1 bitShift: 15)" + "32768 bytesCount >>> 2" + + "65536 == (1 bitShift: 16)" + "65536 bytesCount >>> 3" + + | value length | + length := 1. + value := self. + value >= 0 + ifTrue: + [[value > 255] whileTrue: + [value := value bitShift: -8. + length := length + 1]] + ifFalse: + [[value < -255] whileTrue: + [value := value bitShift: -8. + length := length + 1]]. + ^length \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/monticello.meta/categories.st b/repository/Grease-Squeak-Core.package/monticello.meta/categories.st index f0465eda..bc6c762f 100644 --- a/repository/Grease-Squeak-Core.package/monticello.meta/categories.st +++ b/repository/Grease-Squeak-Core.package/monticello.meta/categories.st @@ -1 +1,2 @@ SystemOrganization addCategory: #'Grease-Squeak-Core'! +SystemOrganization addCategory: #'Grease-Squeak-Core-Manifest'! diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testBase64Decode.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testBase64Decode.st index 0a42403f..92cf811a 100644 --- a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testBase64Decode.st +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testBase64Decode.st @@ -1,4 +1,4 @@ -tests +tests-encoding testBase64Decode | input | input := #( diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testBase64Encode.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testBase64Encode.st index d1a2b4be..5bf20858 100644 --- a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testBase64Encode.st +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testBase64Encode.st @@ -1,4 +1,4 @@ -tests +tests-encoding testBase64Encode | input | input := #( diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseAsByteArray.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseAsByteArray.st new file mode 100644 index 00000000..e9265615 --- /dev/null +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseAsByteArray.st @@ -0,0 +1,5 @@ +tests-encoding +testGreaseAsByteArray + self assert: 1024 greaseAsByteArray equals: #[4 0]. + self assert: #[1 2 3] greaseAsByteArray equals: #[1 2 3]. + self assert: '123' greaseAsByteArray equals: #[49 50 51] \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseByteAt.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseByteAt.st new file mode 100644 index 00000000..46197041 --- /dev/null +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseByteAt.st @@ -0,0 +1,4 @@ +tests-encoding +testGreaseByteAt + self assert: (1024 greaseByteAt: 1) equals: 0. + self assert: (1024 greaseByteAt: 2) equals: 4 \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseBytesCount.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseBytesCount.st new file mode 100644 index 00000000..75949207 --- /dev/null +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseBytesCount.st @@ -0,0 +1,3 @@ +tests-encoding +testGreaseBytesCount + self assert: 1024 greaseBytesCount equals: 2 \ No newline at end of file From f2de9930cea8b378467978a8ae9f8dfa1af751e8 Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 14:26:02 +0100 Subject: [PATCH 02/15] Add #greaseAsByteArray implementation for Pharo --- .../LargeInteger.extension/instance/greaseByteAt..st | 3 +++ .../LargeInteger.extension/instance/greaseBytesCount.st | 3 +++ .../LargeInteger.extension/properties.json | 3 +++ .../SmallInteger.extension/instance/greaseByteAt..st | 3 +++ .../SmallInteger.extension/instance/greaseBytesCount.st | 3 +++ .../SmallInteger.extension/properties.json | 3 +++ 6 files changed, 18 insertions(+) create mode 100644 repository/Grease-Pharo100-Core.package/LargeInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Pharo100-Core.package/LargeInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Pharo100-Core.package/LargeInteger.extension/properties.json create mode 100644 repository/Grease-Pharo100-Core.package/SmallInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Pharo100-Core.package/SmallInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Pharo100-Core.package/SmallInteger.extension/properties.json diff --git a/repository/Grease-Pharo100-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-Pharo100-Core.package/LargeInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..6b1d45ee --- /dev/null +++ b/repository/Grease-Pharo100-Core.package/LargeInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,3 @@ +*Grease-Pharo100-Core +greaseByteAt: index + ^ self byteAt: index \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/LargeInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Pharo100-Core.package/LargeInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..ef791cd5 --- /dev/null +++ b/repository/Grease-Pharo100-Core.package/LargeInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,3 @@ +*Grease-Pharo100-Core +greaseBytesCount + ^ self bytesCount \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/LargeInteger.extension/properties.json b/repository/Grease-Pharo100-Core.package/LargeInteger.extension/properties.json new file mode 100644 index 00000000..029bc676 --- /dev/null +++ b/repository/Grease-Pharo100-Core.package/LargeInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "LargeInteger" +} \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/SmallInteger.extension/instance/greaseByteAt..st b/repository/Grease-Pharo100-Core.package/SmallInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..6b1d45ee --- /dev/null +++ b/repository/Grease-Pharo100-Core.package/SmallInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,3 @@ +*Grease-Pharo100-Core +greaseByteAt: index + ^ self byteAt: index \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/SmallInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Pharo100-Core.package/SmallInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..ef791cd5 --- /dev/null +++ b/repository/Grease-Pharo100-Core.package/SmallInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,3 @@ +*Grease-Pharo100-Core +greaseBytesCount + ^ self bytesCount \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/SmallInteger.extension/properties.json b/repository/Grease-Pharo100-Core.package/SmallInteger.extension/properties.json new file mode 100644 index 00000000..ca9cd21f --- /dev/null +++ b/repository/Grease-Pharo100-Core.package/SmallInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "SmallInteger" +} \ No newline at end of file From eac187b90f83bd8002c06ae318602f250283413f Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 14:37:04 +0100 Subject: [PATCH 03/15] Add #greaseByteAt: and #greaseBytesCound implementations for Pharo --- .../LargeInteger.extension/instance/greaseByteAt..st | 3 +++ .../LargeInteger.extension/instance/greaseBytesCount.st | 3 +++ .../LargeInteger.extension/properties.json | 3 +++ .../SmallInteger.extension/instance/greaseByteAt..st | 3 +++ .../SmallInteger.extension/instance/greaseBytesCount.st | 3 +++ .../SmallInteger.extension/properties.json | 3 +++ 6 files changed, 18 insertions(+) create mode 100644 repository/Grease-Pharo90-Core.package/LargeInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Pharo90-Core.package/LargeInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Pharo90-Core.package/LargeInteger.extension/properties.json create mode 100644 repository/Grease-Pharo90-Core.package/SmallInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Pharo90-Core.package/SmallInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Pharo90-Core.package/SmallInteger.extension/properties.json diff --git a/repository/Grease-Pharo90-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-Pharo90-Core.package/LargeInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..6472e03c --- /dev/null +++ b/repository/Grease-Pharo90-Core.package/LargeInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,3 @@ +*Grease-Pharo90-Core +greaseByteAt: index + ^ self byteAt: index \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/LargeInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Pharo90-Core.package/LargeInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..9d7d8a82 --- /dev/null +++ b/repository/Grease-Pharo90-Core.package/LargeInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,3 @@ +*Grease-Pharo90-Core +greaseBytesCount + ^ self bytesCount \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/LargeInteger.extension/properties.json b/repository/Grease-Pharo90-Core.package/LargeInteger.extension/properties.json new file mode 100644 index 00000000..029bc676 --- /dev/null +++ b/repository/Grease-Pharo90-Core.package/LargeInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "LargeInteger" +} \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/SmallInteger.extension/instance/greaseByteAt..st b/repository/Grease-Pharo90-Core.package/SmallInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..6472e03c --- /dev/null +++ b/repository/Grease-Pharo90-Core.package/SmallInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,3 @@ +*Grease-Pharo90-Core +greaseByteAt: index + ^ self byteAt: index \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/SmallInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Pharo90-Core.package/SmallInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..9d7d8a82 --- /dev/null +++ b/repository/Grease-Pharo90-Core.package/SmallInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,3 @@ +*Grease-Pharo90-Core +greaseBytesCount + ^ self bytesCount \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/SmallInteger.extension/properties.json b/repository/Grease-Pharo90-Core.package/SmallInteger.extension/properties.json new file mode 100644 index 00000000..ca9cd21f --- /dev/null +++ b/repository/Grease-Pharo90-Core.package/SmallInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "SmallInteger" +} \ No newline at end of file From 1e6b6532e3cf191fb85fb5a2cace46815c6ef8a9 Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 14:39:08 +0100 Subject: [PATCH 04/15] Add #greaseByteAt: and #greaseBytesCound implementations for Pharo 7 --- .../LargeInteger.extension/instance/greaseByteAt..st | 3 +++ .../LargeInteger.extension/instance/greaseBytesCount.st | 3 +++ .../LargeInteger.extension/properties.json | 3 +++ .../SmallInteger.extension/instance/greaseByteAt..st | 3 +++ .../SmallInteger.extension/instance/greaseBytesCount.st | 3 +++ .../SmallInteger.extension/properties.json | 3 +++ 6 files changed, 18 insertions(+) create mode 100644 repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Pharo70-Core.package/LargeInteger.extension/properties.json create mode 100644 repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Pharo70-Core.package/SmallInteger.extension/properties.json diff --git a/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..038f115b --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,3 @@ +*Grease-Pharo70-Core +greaseByteAt: index + ^ self byteAt: index \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..e9fca83e --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,3 @@ +*Grease-Pharo70-Core +greaseBytesCount + ^ self bytesCount \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/LargeInteger.extension/properties.json b/repository/Grease-Pharo70-Core.package/LargeInteger.extension/properties.json new file mode 100644 index 00000000..029bc676 --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/LargeInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "LargeInteger" +} \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseByteAt..st b/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..038f115b --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,3 @@ +*Grease-Pharo70-Core +greaseByteAt: index + ^ self byteAt: index \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..e9fca83e --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,3 @@ +*Grease-Pharo70-Core +greaseBytesCount + ^ self bytesCount \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/SmallInteger.extension/properties.json b/repository/Grease-Pharo70-Core.package/SmallInteger.extension/properties.json new file mode 100644 index 00000000..ca9cd21f --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/SmallInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "SmallInteger" +} \ No newline at end of file From 65bc55e2ff5db4d2bfe9fd56fe6912cb39cf4596 Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 14:40:46 +0100 Subject: [PATCH 05/15] Add #greaseByteAt: and #greaseBytesCound implementations for Pharo 6 --- .../LargeInteger.extension/instance/greaseByteAt..st | 3 +++ .../LargeInteger.extension/instance/greaseBytesCount.st | 3 +++ .../LargeInteger.extension/properties.json | 3 +++ .../SmallInteger.extension/instance/greaseByteAt..st | 3 +++ .../SmallInteger.extension/instance/greaseBytesCount.st | 3 +++ .../SmallInteger.extension/properties.json | 3 +++ 6 files changed, 18 insertions(+) create mode 100644 repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Pharo60-Core.package/LargeInteger.extension/properties.json create mode 100644 repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Pharo60-Core.package/SmallInteger.extension/properties.json diff --git a/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..d6f41d3c --- /dev/null +++ b/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,3 @@ +*Grease-Pharo60-Core +greaseByteAt: index + ^ self byteAt: index \ No newline at end of file diff --git a/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..a389d89c --- /dev/null +++ b/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,3 @@ +*Grease-Pharo60-Core +greaseBytesCount + ^ self bytesCount \ No newline at end of file diff --git a/repository/Grease-Pharo60-Core.package/LargeInteger.extension/properties.json b/repository/Grease-Pharo60-Core.package/LargeInteger.extension/properties.json new file mode 100644 index 00000000..029bc676 --- /dev/null +++ b/repository/Grease-Pharo60-Core.package/LargeInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "LargeInteger" +} \ No newline at end of file diff --git a/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseByteAt..st b/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..d6f41d3c --- /dev/null +++ b/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,3 @@ +*Grease-Pharo60-Core +greaseByteAt: index + ^ self byteAt: index \ No newline at end of file diff --git a/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..a389d89c --- /dev/null +++ b/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,3 @@ +*Grease-Pharo60-Core +greaseBytesCount + ^ self bytesCount \ No newline at end of file diff --git a/repository/Grease-Pharo60-Core.package/SmallInteger.extension/properties.json b/repository/Grease-Pharo60-Core.package/SmallInteger.extension/properties.json new file mode 100644 index 00000000..ca9cd21f --- /dev/null +++ b/repository/Grease-Pharo60-Core.package/SmallInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "SmallInteger" +} \ No newline at end of file From f67408f88e8dad371101148ded8680837e0d6797 Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 15:01:55 +0100 Subject: [PATCH 06/15] Improve tests for #greaseAsByteArray, #greaseByteAt:, #greaseByteCounts --- .../GRPlatformTest.class/instance/testGreaseAsByteArray.st | 2 ++ .../GRPlatformTest.class/instance/testGreaseByteAt.st | 6 +++++- .../GRPlatformTest.class/instance/testGreaseBytesCount.st | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseAsByteArray.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseAsByteArray.st index e9265615..545b3c5b 100644 --- a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseAsByteArray.st +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseAsByteArray.st @@ -1,5 +1,7 @@ tests-encoding testGreaseAsByteArray self assert: 1024 greaseAsByteArray equals: #[4 0]. + self assert: (SmallInteger maxVal + 10) greaseAsByteArray equals: #[16 0 0 0 0 0 0 9]. + self assert: (SmallInteger minVal - 10) greaseAsByteArray equals: #[16 0 0 0 0 0 0 10]. self assert: #[1 2 3] greaseAsByteArray equals: #[1 2 3]. self assert: '123' greaseAsByteArray equals: #[49 50 51] \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseByteAt.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseByteAt.st index 46197041..3d2b1b9c 100644 --- a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseByteAt.st +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseByteAt.st @@ -1,4 +1,8 @@ tests-encoding testGreaseByteAt self assert: (1024 greaseByteAt: 1) equals: 0. - self assert: (1024 greaseByteAt: 2) equals: 4 \ No newline at end of file + self assert: (1024 greaseByteAt: 2) equals: 4. + self assert: ((SmallInteger maxVal + 10) greaseByteAt: 1) equals: 9. + self assert: ((SmallInteger maxVal + 10) greaseByteAt: 8) equals: 16. + self assert: ((SmallInteger minVal - 10) greaseByteAt: 1) equals: 10. + self assert: ((SmallInteger minVal - 10) greaseByteAt: 8) equals: 16 \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseBytesCount.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseBytesCount.st index 75949207..d69bbf63 100644 --- a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseBytesCount.st +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testGreaseBytesCount.st @@ -1,3 +1,5 @@ tests-encoding testGreaseBytesCount - self assert: 1024 greaseBytesCount equals: 2 \ No newline at end of file + self assert: 1024 greaseBytesCount equals: 2. + self assert: (SmallInteger maxVal + 10) greaseBytesCount equals: 8. + self assert: (SmallInteger minVal + 10) greaseBytesCount equals: 8 \ No newline at end of file From 845a2c13d8bcbcb30ff87fcb42195db29d8d7544 Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 15:02:36 +0100 Subject: [PATCH 07/15] Fix implementation of #greaseByteAt:, #greaseBytesCount in Pharo 7 --- .../instance/greaseByteAt..st | 7 +++++- .../instance/greaseBytesCount.st | 7 +++++- .../instance/greaseByteAt..st | 15 ++++++++++-- .../instance/greaseBytesCount.st | 24 ++++++++++++++++++- 4 files changed, 48 insertions(+), 5 deletions(-) diff --git a/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseByteAt..st index 038f115b..234e429d 100644 --- a/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseByteAt..st +++ b/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseByteAt..st @@ -1,3 +1,8 @@ *Grease-Pharo70-Core greaseByteAt: index - ^ self byteAt: index \ No newline at end of file + "Primitive. Answer the value of an indexable field in the receiver. LargePositiveInteger uses bytes of base two number, and each is a 'digit' base 256. Fail if the argument (the index) is not an Integer or is out of bounds. Essential. See Object documentation whatIsAPrimitive." + + + self greaseBytesCount < index + ifTrue: [^0] + ifFalse: [^super at: index] \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseBytesCount.st index e9fca83e..adb5d76c 100644 --- a/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseBytesCount.st +++ b/repository/Grease-Pharo70-Core.package/LargeInteger.extension/instance/greaseBytesCount.st @@ -1,3 +1,8 @@ *Grease-Pharo70-Core greaseBytesCount - ^ self bytesCount \ No newline at end of file + "Primitive. Answer the number of indexable fields in the receiver. This + value is the same as the largest legal subscript. Essential. See Object + documentation whatIsAPrimitive." + + + self primitiveFailed \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseByteAt..st b/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseByteAt..st index 038f115b..f47ffe65 100644 --- a/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseByteAt..st +++ b/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseByteAt..st @@ -1,3 +1,14 @@ *Grease-Pharo70-Core -greaseByteAt: index - ^ self byteAt: index \ No newline at end of file +greaseByteAt: n + "Answer the value of an apparent byte-indexable field in the receiver, + analogous to the large integers, which are organized as bytes." + + n = 1 + ifTrue: [ + "Negate carefully in case the receiver is SmallInteger minVal" + ^ self < 0 + ifTrue: [ -256 - self bitAnd: 255 ] + ifFalse: [ self bitAnd: 255 ] ]. + ^ self < 0 + ifTrue: [ (-256 - self bitShift: -8) + 1 byteAt: n - 1 ] + ifFalse: [ (self bitShift: 8 - (n bitShift: 3)) bitAnd: 255 ] \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseBytesCount.st index e9fca83e..3acd5b44 100644 --- a/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseBytesCount.st +++ b/repository/Grease-Pharo70-Core.package/SmallInteger.extension/instance/greaseBytesCount.st @@ -1,3 +1,25 @@ *Grease-Pharo70-Core greaseBytesCount - ^ self bytesCount \ No newline at end of file + "Answer the number of indexable fields in the receiver. This value is the + same as the largest legal subscript. Included so that a SmallInteger can + behave like a LargePositiveInteger or LargeNegativeInteger." + + "32768 == (1 bitShift: 15)" + "32768 bytesCount >>> 2" + + "65536 == (1 bitShift: 16)" + "65536 bytesCount >>> 3" + + | value length | + length := 1. + value := self. + value >= 0 + ifTrue: + [[value > 255] whileTrue: + [value := value bitShift: -8. + length := length + 1]] + ifFalse: + [[value < -255] whileTrue: + [value := value bitShift: -8. + length := length + 1]]. + ^length \ No newline at end of file From 7049682665c167c87c2f37fac4e3d09892eb2716 Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 15:05:15 +0100 Subject: [PATCH 08/15] Fix implementation of #greaseByteAt:, #greaseBytesCount in Pharo 6 --- .../GRPharoPlatform.class/README.md | 2 +- .../instance/integerAsByteArray..st | 7 ++++++ .../GRPharoPlatform.class/properties.json | 2 +- .../instance/greaseByteAt..st | 7 +++++- .../instance/greaseBytesCount.st | 7 +++++- .../instance/greaseByteAt..st | 15 ++++++++++-- .../instance/greaseBytesCount.st | 24 ++++++++++++++++++- 7 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/integerAsByteArray..st diff --git a/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/README.md b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/README.md index f0375aac..e71bb46d 100644 --- a/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/README.md +++ b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/README.md @@ -1 +1 @@ -A WASqueakPlatform is the Squeak implementation of SeasidePlatformSupport, the Seaside class that provides functionality that can not be implemented in a platform independent way. +A GRPharoPlatform is the Pharo implementation of GRPlatform, the Grease class that provides functionality that can not be implemented in a platform independent way. diff --git a/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/integerAsByteArray..st b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/integerAsByteArray..st new file mode 100644 index 00000000..124003a4 --- /dev/null +++ b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/integerAsByteArray..st @@ -0,0 +1,7 @@ +encoding +integerAsByteArray: anInteger + | stream | + stream := ByteArray new writeStream. + anInteger greaseBytesCount to: 1 by: -1 do: [:digitIndex | + stream nextPut: (anInteger greaseByteAt: digitIndex)]. + ^ stream contents \ No newline at end of file diff --git a/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/properties.json b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/properties.json index 8ccc85e2..fc75f419 100644 --- a/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/properties.json +++ b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/properties.json @@ -1,5 +1,5 @@ { - "commentStamp" : "pmm 6/1/2008 01:03", + "commentStamp" : "pmm 2/1/2014 13:28", "super" : "GRPlatform", "category" : "Grease-Pharo60-Core", "classinstvars" : [ ], diff --git a/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseByteAt..st index d6f41d3c..61ee208c 100644 --- a/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseByteAt..st +++ b/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseByteAt..st @@ -1,3 +1,8 @@ *Grease-Pharo60-Core greaseByteAt: index - ^ self byteAt: index \ No newline at end of file + "Primitive. Answer the value of an indexable field in the receiver. LargePositiveInteger uses bytes of base two number, and each is a 'digit' base 256. Fail if the argument (the index) is not an Integer or is out of bounds. Essential. See Object documentation whatIsAPrimitive." + + + self greaseBytesCount < index + ifTrue: [^0] + ifFalse: [^super at: index] \ No newline at end of file diff --git a/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseBytesCount.st index a389d89c..43a22aa9 100644 --- a/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseBytesCount.st +++ b/repository/Grease-Pharo60-Core.package/LargeInteger.extension/instance/greaseBytesCount.st @@ -1,3 +1,8 @@ *Grease-Pharo60-Core greaseBytesCount - ^ self bytesCount \ No newline at end of file + "Primitive. Answer the number of indexable fields in the receiver. This + value is the same as the largest legal subscript. Essential. See Object + documentation whatIsAPrimitive." + + + self primitiveFailed \ No newline at end of file diff --git a/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseByteAt..st b/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseByteAt..st index d6f41d3c..9f0d7dec 100644 --- a/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseByteAt..st +++ b/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseByteAt..st @@ -1,3 +1,14 @@ *Grease-Pharo60-Core -greaseByteAt: index - ^ self byteAt: index \ No newline at end of file +greaseByteAt: n + "Answer the value of an apparent byte-indexable field in the receiver, + analogous to the large integers, which are organized as bytes." + + n = 1 + ifTrue: [ + "Negate carefully in case the receiver is SmallInteger minVal" + ^ self < 0 + ifTrue: [ -256 - self bitAnd: 255 ] + ifFalse: [ self bitAnd: 255 ] ]. + ^ self < 0 + ifTrue: [ (-256 - self bitShift: -8) + 1 byteAt: n - 1 ] + ifFalse: [ (self bitShift: 8 - (n bitShift: 3)) bitAnd: 255 ] \ No newline at end of file diff --git a/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseBytesCount.st index a389d89c..bb983402 100644 --- a/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseBytesCount.st +++ b/repository/Grease-Pharo60-Core.package/SmallInteger.extension/instance/greaseBytesCount.st @@ -1,3 +1,25 @@ *Grease-Pharo60-Core greaseBytesCount - ^ self bytesCount \ No newline at end of file + "Answer the number of indexable fields in the receiver. This value is the + same as the largest legal subscript. Included so that a SmallInteger can + behave like a LargePositiveInteger or LargeNegativeInteger." + + "32768 == (1 bitShift: 15)" + "32768 bytesCount >>> 2" + + "65536 == (1 bitShift: 16)" + "65536 bytesCount >>> 3" + + | value length | + length := 1. + value := self. + value >= 0 + ifTrue: + [[value > 255] whileTrue: + [value := value bitShift: -8. + length := length + 1]] + ifFalse: + [[value < -255] whileTrue: + [value := value bitShift: -8. + length := length + 1]]. + ^length \ No newline at end of file From b9ae2e0e064e2337a97d8b5a31f7220929f85ebc Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 15:13:05 +0100 Subject: [PATCH 09/15] Fix #greaseByteAt: for Squeak --- .../LargeInteger.extension/instance/greaseByteAt..st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repository/Grease-Squeak-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-Squeak-Core.package/LargeInteger.extension/instance/greaseByteAt..st index cb42ba36..8f7cab92 100644 --- a/repository/Grease-Squeak-Core.package/LargeInteger.extension/instance/greaseByteAt..st +++ b/repository/Grease-Squeak-Core.package/LargeInteger.extension/instance/greaseByteAt..st @@ -3,6 +3,6 @@ greaseByteAt: index "Primitive. Answer the value of an indexable field in the receiver. LargePositiveInteger uses bytes of base two number, and each is a 'digit' base 256. Fail if the argument (the index) is not an Integer or is out of bounds. Essential. See Object documentation whatIsAPrimitive." - self bytesCount < index + self greaseBytesCount < index ifTrue: [^0] ifFalse: [^super at: index] \ No newline at end of file From c7c9826066f1d8c4ce4a9982d1d9084135aa26db Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 15:16:25 +0100 Subject: [PATCH 10/15] Add implementation of #greaseAsByteArray for Squeak 5 --- .../Grease-Squeak5-Core.package/.filetree | 5 ++-- .../Behavior.extension/properties.json | 3 ++- .../BlockClosure.extension/properties.json | 3 ++- .../BlockContext.extension/properties.json | 3 ++- .../ByteArray.extension/properties.json | 3 ++- .../Character.extension/properties.json | 3 ++- .../Collection.extension/properties.json | 3 ++- .../Duration.extension/properties.json | 3 ++- .../properties.json | 3 ++- .../GRDynamicVariable.class/properties.json | 19 ++++++-------- .../GRPackage.extension/properties.json | 3 ++- .../properties.json | 19 +++++++------- .../GRPharoGenericCodec.class/properties.json | 19 +++++++------- .../GRPharoLatin1Codec.class/properties.json | 19 +++++++------- .../properties.json | 19 ++++++-------- .../GRPharoPlatform.class/properties.json | 19 +++++++------- .../properties.json | 19 +++++++------- .../GRPharoUtf8Codec.class/properties.json | 19 ++++++-------- .../properties.json | 19 +++++++------- .../properties.json | 3 ++- .../instance/integerAsByteArray..st | 7 ++++++ .../GRSqueakPlatform.class/properties.json | 19 ++++++-------- .../properties.json | 19 ++++++-------- .../Interval.extension/properties.json | 3 ++- .../instance/greaseByteAt..st | 8 ++++++ .../instance/greaseBytesCount.st | 8 ++++++ .../LargeInteger.extension/properties.json | 3 +++ .../MessageSend.extension/properties.json | 3 ++- .../Number.extension/properties.json | 3 ++- .../Object.extension/properties.json | 3 ++- .../Point.extension/properties.json | 3 ++- .../properties.json | 3 ++- .../ScaledDecimal.extension/properties.json | 3 ++- .../properties.json | 3 ++- .../instance/greaseByteAt..st | 14 +++++++++++ .../instance/greaseBytesCount.st | 25 +++++++++++++++++++ .../SmallInteger.extension/properties.json | 3 ++- .../SocketStream.extension/properties.json | 3 ++- .../String.extension/properties.json | 3 ++- .../Symbol.extension/properties.json | 3 ++- .../WriteStream.extension/properties.json | 3 ++- .../properties.json | 3 +-- 42 files changed, 209 insertions(+), 142 deletions(-) create mode 100644 repository/Grease-Squeak5-Core.package/GRSqueakPlatform.class/instance/integerAsByteArray..st create mode 100644 repository/Grease-Squeak5-Core.package/LargeInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Squeak5-Core.package/LargeInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Squeak5-Core.package/LargeInteger.extension/properties.json create mode 100644 repository/Grease-Squeak5-Core.package/SmallInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Squeak5-Core.package/SmallInteger.extension/instance/greaseBytesCount.st diff --git a/repository/Grease-Squeak5-Core.package/.filetree b/repository/Grease-Squeak5-Core.package/.filetree index 8998102c..57a67973 100644 --- a/repository/Grease-Squeak5-Core.package/.filetree +++ b/repository/Grease-Squeak5-Core.package/.filetree @@ -1,4 +1,5 @@ { - "noMethodMetaData" : true, "separateMethodMetaAndSource" : false, - "useCypressPropertiesFile" : true } + "noMethodMetaData" : true, + "useCypressPropertiesFile" : true +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/Behavior.extension/properties.json b/repository/Grease-Squeak5-Core.package/Behavior.extension/properties.json index 37061187..c4116c4c 100644 --- a/repository/Grease-Squeak5-Core.package/Behavior.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/Behavior.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Behavior" } + "name" : "Behavior" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/BlockClosure.extension/properties.json b/repository/Grease-Squeak5-Core.package/BlockClosure.extension/properties.json index 1d6f4884..2190e5e2 100644 --- a/repository/Grease-Squeak5-Core.package/BlockClosure.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/BlockClosure.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "BlockClosure" } + "name" : "BlockClosure" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/BlockContext.extension/properties.json b/repository/Grease-Squeak5-Core.package/BlockContext.extension/properties.json index ea80c1e5..fab3588c 100644 --- a/repository/Grease-Squeak5-Core.package/BlockContext.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/BlockContext.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "BlockContext" } + "name" : "BlockContext" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/ByteArray.extension/properties.json b/repository/Grease-Squeak5-Core.package/ByteArray.extension/properties.json index 191a2eca..f81bcb8d 100644 --- a/repository/Grease-Squeak5-Core.package/ByteArray.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/ByteArray.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "ByteArray" } + "name" : "ByteArray" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/Character.extension/properties.json b/repository/Grease-Squeak5-Core.package/Character.extension/properties.json index 7532e33e..5219281d 100644 --- a/repository/Grease-Squeak5-Core.package/Character.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/Character.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Character" } + "name" : "Character" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/Collection.extension/properties.json b/repository/Grease-Squeak5-Core.package/Collection.extension/properties.json index 93b0dc32..48f9f8d9 100644 --- a/repository/Grease-Squeak5-Core.package/Collection.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/Collection.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Collection" } + "name" : "Collection" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/Duration.extension/properties.json b/repository/Grease-Squeak5-Core.package/Duration.extension/properties.json index 512e0f01..d141a092 100644 --- a/repository/Grease-Squeak5-Core.package/Duration.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/Duration.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Duration" } + "name" : "Duration" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRDelegatingStream.extension/properties.json b/repository/Grease-Squeak5-Core.package/GRDelegatingStream.extension/properties.json index 472cde09..5ec29ea0 100644 --- a/repository/Grease-Squeak5-Core.package/GRDelegatingStream.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRDelegatingStream.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "GRDelegatingStream" } + "name" : "GRDelegatingStream" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRDynamicVariable.class/properties.json b/repository/Grease-Squeak5-Core.package/GRDynamicVariable.class/properties.json index 516d3166..1bebf7ef 100644 --- a/repository/Grease-Squeak5-Core.package/GRDynamicVariable.class/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRDynamicVariable.class/properties.json @@ -1,14 +1,11 @@ { - "category" : "Grease-Squeak5-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "", - "instvars" : [ - ], - "name" : "GRDynamicVariable", - "pools" : [ - ], "super" : "DynamicVariable", - "type" : "normal" } + "category" : "Grease-Squeak5-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "GRDynamicVariable", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRPackage.extension/properties.json b/repository/Grease-Squeak5-Core.package/GRPackage.extension/properties.json index dd2faaf0..ae522a7e 100644 --- a/repository/Grease-Squeak5-Core.package/GRPackage.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRPackage.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "GRPackage" } + "name" : "GRPackage" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRPharoConverterCodecStream.class/properties.json b/repository/Grease-Squeak5-Core.package/GRPharoConverterCodecStream.class/properties.json index 13abd07b..6f58ab43 100644 --- a/repository/Grease-Squeak5-Core.package/GRPharoConverterCodecStream.class/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRPharoConverterCodecStream.class/properties.json @@ -1,14 +1,13 @@ { - "category" : "Grease-Squeak5-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "pmm 9/14/2013 15:53", + "super" : "GRCodecStream", + "category" : "Grease-Squeak5-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], "instvars" : [ - "converter" ], + "converter" + ], "name" : "GRPharoConverterCodecStream", - "pools" : [ - ], - "super" : "GRCodecStream", - "type" : "normal" } + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRPharoGenericCodec.class/properties.json b/repository/Grease-Squeak5-Core.package/GRPharoGenericCodec.class/properties.json index b24261dc..d11ecb62 100644 --- a/repository/Grease-Squeak5-Core.package/GRPharoGenericCodec.class/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRPharoGenericCodec.class/properties.json @@ -1,15 +1,14 @@ { - "category" : "Grease-Squeak5-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "", + "super" : "GRCodec", + "category" : "Grease-Squeak5-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], "instvars" : [ "name", - "urlCodec" ], + "urlCodec" + ], "name" : "GRPharoGenericCodec", - "pools" : [ - ], - "super" : "GRCodec", - "type" : "normal" } + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRPharoLatin1Codec.class/properties.json b/repository/Grease-Squeak5-Core.package/GRPharoLatin1Codec.class/properties.json index 81f473c2..33ac00e1 100644 --- a/repository/Grease-Squeak5-Core.package/GRPharoLatin1Codec.class/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRPharoLatin1Codec.class/properties.json @@ -1,14 +1,13 @@ { - "category" : "Grease-Squeak5-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "", + "super" : "GRNullCodec", + "category" : "Grease-Squeak5-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], "instvars" : [ - "name" ], + "name" + ], "name" : "GRPharoLatin1Codec", - "pools" : [ - ], - "super" : "GRNullCodec", - "type" : "normal" } + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRPharoLatin1CodecStream.class/properties.json b/repository/Grease-Squeak5-Core.package/GRPharoLatin1CodecStream.class/properties.json index 8b83b652..812a948d 100644 --- a/repository/Grease-Squeak5-Core.package/GRPharoLatin1CodecStream.class/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRPharoLatin1CodecStream.class/properties.json @@ -1,14 +1,11 @@ { - "category" : "Grease-Squeak5-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "", - "instvars" : [ - ], - "name" : "GRPharoLatin1CodecStream", - "pools" : [ - ], "super" : "GRNullCodecStream", - "type" : "normal" } + "category" : "Grease-Squeak5-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "GRPharoLatin1CodecStream", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/properties.json b/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/properties.json index 7320ab9a..debe249f 100644 --- a/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/properties.json @@ -1,15 +1,14 @@ { + "commentStamp" : "pmm 2/1/2014 13:28", + "super" : "GRPlatform", "category" : "Grease-Squeak5-Core", - "classinstvars" : [ - ], + "classinstvars" : [ ], + "pools" : [ ], "classvars" : [ "UrlTable", - "XmlTable" ], - "commentStamp" : "pmm 2/1/2014 13:28", - "instvars" : [ - ], + "XmlTable" + ], + "instvars" : [ ], "name" : "GRPharoPlatform", - "pools" : [ - ], - "super" : "GRPlatform", - "type" : "normal" } + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRPharoRandomProvider.class/properties.json b/repository/Grease-Squeak5-Core.package/GRPharoRandomProvider.class/properties.json index 513b71fb..179e4cfe 100644 --- a/repository/Grease-Squeak5-Core.package/GRPharoRandomProvider.class/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRPharoRandomProvider.class/properties.json @@ -1,15 +1,14 @@ { + "commentStamp" : "", + "super" : "GRObject", "category" : "Grease-Squeak5-Core", "classinstvars" : [ "mutex", - "generator" ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], + "generator" + ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], "name" : "GRPharoRandomProvider", - "pools" : [ - ], - "super" : "GRObject", - "type" : "normal" } + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRPharoUtf8Codec.class/properties.json b/repository/Grease-Squeak5-Core.package/GRPharoUtf8Codec.class/properties.json index 68130682..a91d6cd3 100644 --- a/repository/Grease-Squeak5-Core.package/GRPharoUtf8Codec.class/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRPharoUtf8Codec.class/properties.json @@ -1,14 +1,11 @@ { - "category" : "Grease-Squeak5-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "pmm 2/20/2009 12:51", - "instvars" : [ - ], - "name" : "GRPharoUtf8Codec", - "pools" : [ - ], "super" : "GRCodec", - "type" : "normal" } + "category" : "Grease-Squeak5-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "GRPharoUtf8Codec", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRPharoUtf8CodecStream.class/properties.json b/repository/Grease-Squeak5-Core.package/GRPharoUtf8CodecStream.class/properties.json index ec018ce3..08f8b877 100644 --- a/repository/Grease-Squeak5-Core.package/GRPharoUtf8CodecStream.class/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRPharoUtf8CodecStream.class/properties.json @@ -1,15 +1,14 @@ { + "commentStamp" : "pmm 2/20/2009 12:27", + "super" : "GRPharoConverterCodecStream", "category" : "Grease-Squeak5-Core", - "classinstvars" : [ - ], + "classinstvars" : [ ], + "pools" : [ ], "classvars" : [ "Latin1ToUtf8Encodings", - "Latin1ToUtf8Map" ], - "commentStamp" : "pmm 2/20/2009 12:27", - "instvars" : [ - ], + "Latin1ToUtf8Map" + ], + "instvars" : [ ], "name" : "GRPharoUtf8CodecStream", - "pools" : [ - ], - "super" : "GRPharoConverterCodecStream", - "type" : "normal" } + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRSmallDictionary.extension/properties.json b/repository/Grease-Squeak5-Core.package/GRSmallDictionary.extension/properties.json index 943ee5f4..0d78b749 100644 --- a/repository/Grease-Squeak5-Core.package/GRSmallDictionary.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRSmallDictionary.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "GRSmallDictionary" } + "name" : "GRSmallDictionary" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRSqueakPlatform.class/instance/integerAsByteArray..st b/repository/Grease-Squeak5-Core.package/GRSqueakPlatform.class/instance/integerAsByteArray..st new file mode 100644 index 00000000..124003a4 --- /dev/null +++ b/repository/Grease-Squeak5-Core.package/GRSqueakPlatform.class/instance/integerAsByteArray..st @@ -0,0 +1,7 @@ +encoding +integerAsByteArray: anInteger + | stream | + stream := ByteArray new writeStream. + anInteger greaseBytesCount to: 1 by: -1 do: [:digitIndex | + stream nextPut: (anInteger greaseByteAt: digitIndex)]. + ^ stream contents \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRSqueakPlatform.class/properties.json b/repository/Grease-Squeak5-Core.package/GRSqueakPlatform.class/properties.json index 3bae2a24..11b4a3aa 100644 --- a/repository/Grease-Squeak5-Core.package/GRSqueakPlatform.class/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRSqueakPlatform.class/properties.json @@ -1,14 +1,11 @@ { - "category" : "Grease-Squeak5-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "", - "instvars" : [ - ], - "name" : "GRSqueakPlatform", - "pools" : [ - ], "super" : "GRPharoPlatform", - "type" : "normal" } + "category" : "Grease-Squeak5-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "GRSqueakPlatform", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRWorkingWriteStream.class/properties.json b/repository/Grease-Squeak5-Core.package/GRWorkingWriteStream.class/properties.json index cfa193a9..8b6e98d9 100644 --- a/repository/Grease-Squeak5-Core.package/GRWorkingWriteStream.class/properties.json +++ b/repository/Grease-Squeak5-Core.package/GRWorkingWriteStream.class/properties.json @@ -1,14 +1,11 @@ { - "category" : "Grease-Squeak5-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "pmm 8/25/2011 18:30", - "instvars" : [ - ], - "name" : "GRWorkingWriteStream", - "pools" : [ - ], "super" : "WriteStream", - "type" : "normal" } + "category" : "Grease-Squeak5-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "GRWorkingWriteStream", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/Interval.extension/properties.json b/repository/Grease-Squeak5-Core.package/Interval.extension/properties.json index d468cd35..534eb553 100644 --- a/repository/Grease-Squeak5-Core.package/Interval.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/Interval.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Interval" } + "name" : "Interval" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-Squeak5-Core.package/LargeInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..c4560695 --- /dev/null +++ b/repository/Grease-Squeak5-Core.package/LargeInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,8 @@ +*Grease-Squeak5-Core +greaseByteAt: index + "Primitive. Answer the value of an indexable field in the receiver. LargePositiveInteger uses bytes of base two number, and each is a 'digit' base 256. Fail if the argument (the index) is not an Integer or is out of bounds. Essential. See Object documentation whatIsAPrimitive." + + + self greaseBytesCount < index + ifTrue: [^0] + ifFalse: [^super at: index] \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/LargeInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Squeak5-Core.package/LargeInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..c9172272 --- /dev/null +++ b/repository/Grease-Squeak5-Core.package/LargeInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,8 @@ +*Grease-Squeak5-Core +greaseBytesCount + "Primitive. Answer the number of indexable fields in the receiver. This + value is the same as the largest legal subscript. Essential. See Object + documentation whatIsAPrimitive." + + + self primitiveFailed \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/LargeInteger.extension/properties.json b/repository/Grease-Squeak5-Core.package/LargeInteger.extension/properties.json new file mode 100644 index 00000000..029bc676 --- /dev/null +++ b/repository/Grease-Squeak5-Core.package/LargeInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "LargeInteger" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/MessageSend.extension/properties.json b/repository/Grease-Squeak5-Core.package/MessageSend.extension/properties.json index 66fcc3c1..00669b90 100644 --- a/repository/Grease-Squeak5-Core.package/MessageSend.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/MessageSend.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "MessageSend" } + "name" : "MessageSend" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/Number.extension/properties.json b/repository/Grease-Squeak5-Core.package/Number.extension/properties.json index 1d2c94d4..71dace88 100644 --- a/repository/Grease-Squeak5-Core.package/Number.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/Number.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Number" } + "name" : "Number" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/Object.extension/properties.json b/repository/Grease-Squeak5-Core.package/Object.extension/properties.json index 3d3b9ec4..f30a86e1 100644 --- a/repository/Grease-Squeak5-Core.package/Object.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/Object.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Object" } + "name" : "Object" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/Point.extension/properties.json b/repository/Grease-Squeak5-Core.package/Point.extension/properties.json index 3ae71f02..c6cf8dd5 100644 --- a/repository/Grease-Squeak5-Core.package/Point.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/Point.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Point" } + "name" : "Point" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/PositionableStream.extension/properties.json b/repository/Grease-Squeak5-Core.package/PositionableStream.extension/properties.json index 9e1697a6..8e090ee3 100644 --- a/repository/Grease-Squeak5-Core.package/PositionableStream.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/PositionableStream.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "PositionableStream" } + "name" : "PositionableStream" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/ScaledDecimal.extension/properties.json b/repository/Grease-Squeak5-Core.package/ScaledDecimal.extension/properties.json index 6e425dda..75f85f87 100644 --- a/repository/Grease-Squeak5-Core.package/ScaledDecimal.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/ScaledDecimal.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "ScaledDecimal" } + "name" : "ScaledDecimal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/SequenceableCollection.extension/properties.json b/repository/Grease-Squeak5-Core.package/SequenceableCollection.extension/properties.json index 3b2523c3..a68b7db6 100644 --- a/repository/Grease-Squeak5-Core.package/SequenceableCollection.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/SequenceableCollection.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "SequenceableCollection" } + "name" : "SequenceableCollection" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/SmallInteger.extension/instance/greaseByteAt..st b/repository/Grease-Squeak5-Core.package/SmallInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..0599d162 --- /dev/null +++ b/repository/Grease-Squeak5-Core.package/SmallInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,14 @@ +*Grease-Squeak5-Core +greaseByteAt: n + "Answer the value of an apparent byte-indexable field in the receiver, + analogous to the large integers, which are organized as bytes." + + n = 1 + ifTrue: [ + "Negate carefully in case the receiver is SmallInteger minVal" + ^ self < 0 + ifTrue: [ -256 - self bitAnd: 255 ] + ifFalse: [ self bitAnd: 255 ] ]. + ^ self < 0 + ifTrue: [ (-256 - self bitShift: -8) + 1 byteAt: n - 1 ] + ifFalse: [ (self bitShift: 8 - (n bitShift: 3)) bitAnd: 255 ] \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/SmallInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Squeak5-Core.package/SmallInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..bcc66a59 --- /dev/null +++ b/repository/Grease-Squeak5-Core.package/SmallInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,25 @@ +*Grease-Squeak5-Core +greaseBytesCount + "Answer the number of indexable fields in the receiver. This value is the + same as the largest legal subscript. Included so that a SmallInteger can + behave like a LargePositiveInteger or LargeNegativeInteger." + + "32768 == (1 bitShift: 15)" + "32768 bytesCount >>> 2" + + "65536 == (1 bitShift: 16)" + "65536 bytesCount >>> 3" + + | value length | + length := 1. + value := self. + value >= 0 + ifTrue: + [[value > 255] whileTrue: + [value := value bitShift: -8. + length := length + 1]] + ifFalse: + [[value < -255] whileTrue: + [value := value bitShift: -8. + length := length + 1]]. + ^length \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/SmallInteger.extension/properties.json b/repository/Grease-Squeak5-Core.package/SmallInteger.extension/properties.json index d2d9ab4a..ca9cd21f 100644 --- a/repository/Grease-Squeak5-Core.package/SmallInteger.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/SmallInteger.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "SmallInteger" } + "name" : "SmallInteger" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/SocketStream.extension/properties.json b/repository/Grease-Squeak5-Core.package/SocketStream.extension/properties.json index 4800d84e..797e09e5 100644 --- a/repository/Grease-Squeak5-Core.package/SocketStream.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/SocketStream.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "SocketStream" } + "name" : "SocketStream" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/String.extension/properties.json b/repository/Grease-Squeak5-Core.package/String.extension/properties.json index c2138507..b20f2de3 100644 --- a/repository/Grease-Squeak5-Core.package/String.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/String.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "String" } + "name" : "String" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/Symbol.extension/properties.json b/repository/Grease-Squeak5-Core.package/Symbol.extension/properties.json index 565e67b0..8c6bce81 100644 --- a/repository/Grease-Squeak5-Core.package/Symbol.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/Symbol.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Symbol" } + "name" : "Symbol" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/WriteStream.extension/properties.json b/repository/Grease-Squeak5-Core.package/WriteStream.extension/properties.json index 239b3632..8688e80d 100644 --- a/repository/Grease-Squeak5-Core.package/WriteStream.extension/properties.json +++ b/repository/Grease-Squeak5-Core.package/WriteStream.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "WriteStream" } + "name" : "WriteStream" +} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/properties.json b/repository/Grease-Squeak5-Core.package/properties.json index f037444a..6f31cf5a 100644 --- a/repository/Grease-Squeak5-Core.package/properties.json +++ b/repository/Grease-Squeak5-Core.package/properties.json @@ -1,2 +1 @@ -{ - } +{ } \ No newline at end of file From b13fba907e0bf749c993ce0b2826c5554869d122 Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 15:18:40 +0100 Subject: [PATCH 11/15] Add implementation of #greaseAsByteArray for Squeak 6 --- .../Grease-Squeak6-Core.package/.filetree | 5 ++-- .../Behavior.extension/properties.json | 3 ++- .../BlockClosure.extension/properties.json | 3 ++- .../ByteArray.extension/properties.json | 3 ++- .../Character.extension/properties.json | 3 ++- .../Collection.extension/properties.json | 3 ++- .../Duration.extension/properties.json | 3 ++- .../properties.json | 3 ++- .../GRDynamicVariable.class/properties.json | 19 ++++++-------- .../GRPackage.extension/properties.json | 3 ++- .../properties.json | 19 +++++++------- .../GRPharoGenericCodec.class/properties.json | 19 +++++++------- .../GRPharoLatin1Codec.class/properties.json | 19 +++++++------- .../properties.json | 19 ++++++-------- .../GRPharoPlatform.class/properties.json | 19 +++++++------- .../GRPharoUtf8Codec.class/properties.json | 19 ++++++-------- .../properties.json | 19 +++++++------- .../properties.json | 3 ++- .../instance/integerAsByteArray..st | 7 ++++++ .../GRSqueakPlatform.class/properties.json | 19 ++++++-------- .../properties.json | 19 ++++++-------- .../Interval.extension/properties.json | 3 ++- .../instance/greaseByteAt..st | 8 ++++++ .../instance/greaseBytesCount.st | 8 ++++++ .../LargeInteger.extension/properties.json | 3 +++ .../MessageSend.extension/properties.json | 3 ++- .../Number.extension/properties.json | 3 ++- .../Object.extension/properties.json | 3 ++- .../properties.json | 3 ++- .../Random.extension/properties.json | 3 ++- .../ScaledDecimal.extension/properties.json | 3 ++- .../properties.json | 3 ++- .../instance/greaseByteAt..st | 14 +++++++++++ .../instance/greaseBytesCount.st | 25 +++++++++++++++++++ .../SmallInteger.extension/properties.json | 3 +++ .../SocketStream.extension/properties.json | 3 ++- .../String.extension/properties.json | 3 ++- .../Symbol.extension/properties.json | 3 ++- .../WriteStream.extension/properties.json | 3 ++- .../properties.json | 3 +-- 40 files changed, 199 insertions(+), 130 deletions(-) create mode 100644 repository/Grease-Squeak6-Core.package/GRSqueakPlatform.class/instance/integerAsByteArray..st create mode 100644 repository/Grease-Squeak6-Core.package/LargeInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Squeak6-Core.package/LargeInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Squeak6-Core.package/LargeInteger.extension/properties.json create mode 100644 repository/Grease-Squeak6-Core.package/SmallInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-Squeak6-Core.package/SmallInteger.extension/instance/greaseBytesCount.st create mode 100644 repository/Grease-Squeak6-Core.package/SmallInteger.extension/properties.json diff --git a/repository/Grease-Squeak6-Core.package/.filetree b/repository/Grease-Squeak6-Core.package/.filetree index 8998102c..57a67973 100644 --- a/repository/Grease-Squeak6-Core.package/.filetree +++ b/repository/Grease-Squeak6-Core.package/.filetree @@ -1,4 +1,5 @@ { - "noMethodMetaData" : true, "separateMethodMetaAndSource" : false, - "useCypressPropertiesFile" : true } + "noMethodMetaData" : true, + "useCypressPropertiesFile" : true +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/Behavior.extension/properties.json b/repository/Grease-Squeak6-Core.package/Behavior.extension/properties.json index 37061187..c4116c4c 100644 --- a/repository/Grease-Squeak6-Core.package/Behavior.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/Behavior.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Behavior" } + "name" : "Behavior" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/BlockClosure.extension/properties.json b/repository/Grease-Squeak6-Core.package/BlockClosure.extension/properties.json index 1d6f4884..2190e5e2 100644 --- a/repository/Grease-Squeak6-Core.package/BlockClosure.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/BlockClosure.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "BlockClosure" } + "name" : "BlockClosure" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/ByteArray.extension/properties.json b/repository/Grease-Squeak6-Core.package/ByteArray.extension/properties.json index 191a2eca..f81bcb8d 100644 --- a/repository/Grease-Squeak6-Core.package/ByteArray.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/ByteArray.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "ByteArray" } + "name" : "ByteArray" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/Character.extension/properties.json b/repository/Grease-Squeak6-Core.package/Character.extension/properties.json index 7532e33e..5219281d 100644 --- a/repository/Grease-Squeak6-Core.package/Character.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/Character.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Character" } + "name" : "Character" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/Collection.extension/properties.json b/repository/Grease-Squeak6-Core.package/Collection.extension/properties.json index 93b0dc32..48f9f8d9 100644 --- a/repository/Grease-Squeak6-Core.package/Collection.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/Collection.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Collection" } + "name" : "Collection" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/Duration.extension/properties.json b/repository/Grease-Squeak6-Core.package/Duration.extension/properties.json index 512e0f01..d141a092 100644 --- a/repository/Grease-Squeak6-Core.package/Duration.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/Duration.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Duration" } + "name" : "Duration" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRDelegatingStream.extension/properties.json b/repository/Grease-Squeak6-Core.package/GRDelegatingStream.extension/properties.json index 472cde09..5ec29ea0 100644 --- a/repository/Grease-Squeak6-Core.package/GRDelegatingStream.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRDelegatingStream.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "GRDelegatingStream" } + "name" : "GRDelegatingStream" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRDynamicVariable.class/properties.json b/repository/Grease-Squeak6-Core.package/GRDynamicVariable.class/properties.json index f57ef2b1..29e10449 100644 --- a/repository/Grease-Squeak6-Core.package/GRDynamicVariable.class/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRDynamicVariable.class/properties.json @@ -1,14 +1,11 @@ { - "category" : "Grease-Squeak6-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "", - "instvars" : [ - ], - "name" : "GRDynamicVariable", - "pools" : [ - ], "super" : "DynamicVariable", - "type" : "normal" } + "category" : "Grease-Squeak6-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "GRDynamicVariable", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRPackage.extension/properties.json b/repository/Grease-Squeak6-Core.package/GRPackage.extension/properties.json index dd2faaf0..ae522a7e 100644 --- a/repository/Grease-Squeak6-Core.package/GRPackage.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRPackage.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "GRPackage" } + "name" : "GRPackage" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRPharoConverterCodecStream.class/properties.json b/repository/Grease-Squeak6-Core.package/GRPharoConverterCodecStream.class/properties.json index 5188d099..c77f1f04 100644 --- a/repository/Grease-Squeak6-Core.package/GRPharoConverterCodecStream.class/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRPharoConverterCodecStream.class/properties.json @@ -1,14 +1,13 @@ { - "category" : "Grease-Squeak6-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "pmm 9/14/2013 15:53", + "super" : "GRCodecStream", + "category" : "Grease-Squeak6-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], "instvars" : [ - "converter" ], + "converter" + ], "name" : "GRPharoConverterCodecStream", - "pools" : [ - ], - "super" : "GRCodecStream", - "type" : "normal" } + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRPharoGenericCodec.class/properties.json b/repository/Grease-Squeak6-Core.package/GRPharoGenericCodec.class/properties.json index ed667ed9..60757cc7 100644 --- a/repository/Grease-Squeak6-Core.package/GRPharoGenericCodec.class/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRPharoGenericCodec.class/properties.json @@ -1,15 +1,14 @@ { - "category" : "Grease-Squeak6-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "", + "super" : "GRCodec", + "category" : "Grease-Squeak6-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], "instvars" : [ "name", - "urlCodec" ], + "urlCodec" + ], "name" : "GRPharoGenericCodec", - "pools" : [ - ], - "super" : "GRCodec", - "type" : "normal" } + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRPharoLatin1Codec.class/properties.json b/repository/Grease-Squeak6-Core.package/GRPharoLatin1Codec.class/properties.json index 2bba6f1e..465a7ff3 100644 --- a/repository/Grease-Squeak6-Core.package/GRPharoLatin1Codec.class/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRPharoLatin1Codec.class/properties.json @@ -1,14 +1,13 @@ { - "category" : "Grease-Squeak6-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "", + "super" : "GRNullCodec", + "category" : "Grease-Squeak6-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], "instvars" : [ - "name" ], + "name" + ], "name" : "GRPharoLatin1Codec", - "pools" : [ - ], - "super" : "GRNullCodec", - "type" : "normal" } + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRPharoLatin1CodecStream.class/properties.json b/repository/Grease-Squeak6-Core.package/GRPharoLatin1CodecStream.class/properties.json index bdc575a0..35dcea6b 100644 --- a/repository/Grease-Squeak6-Core.package/GRPharoLatin1CodecStream.class/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRPharoLatin1CodecStream.class/properties.json @@ -1,14 +1,11 @@ { - "category" : "Grease-Squeak6-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "", - "instvars" : [ - ], - "name" : "GRPharoLatin1CodecStream", - "pools" : [ - ], "super" : "GRNullCodecStream", - "type" : "normal" } + "category" : "Grease-Squeak6-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "GRPharoLatin1CodecStream", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRPharoPlatform.class/properties.json b/repository/Grease-Squeak6-Core.package/GRPharoPlatform.class/properties.json index 2094c89e..b1c5df09 100644 --- a/repository/Grease-Squeak6-Core.package/GRPharoPlatform.class/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRPharoPlatform.class/properties.json @@ -1,15 +1,14 @@ { + "commentStamp" : "pmm 2/1/2014 13:28", + "super" : "GRPlatform", "category" : "Grease-Squeak6-Core", - "classinstvars" : [ - ], + "classinstvars" : [ ], + "pools" : [ ], "classvars" : [ "UrlTable", - "XmlTable" ], - "commentStamp" : "pmm 2/1/2014 13:28", - "instvars" : [ - ], + "XmlTable" + ], + "instvars" : [ ], "name" : "GRPharoPlatform", - "pools" : [ - ], - "super" : "GRPlatform", - "type" : "normal" } + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRPharoUtf8Codec.class/properties.json b/repository/Grease-Squeak6-Core.package/GRPharoUtf8Codec.class/properties.json index 7312da07..5668906f 100644 --- a/repository/Grease-Squeak6-Core.package/GRPharoUtf8Codec.class/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRPharoUtf8Codec.class/properties.json @@ -1,14 +1,11 @@ { - "category" : "Grease-Squeak6-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "pmm 2/20/2009 12:51", - "instvars" : [ - ], - "name" : "GRPharoUtf8Codec", - "pools" : [ - ], "super" : "GRCodec", - "type" : "normal" } + "category" : "Grease-Squeak6-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "GRPharoUtf8Codec", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRPharoUtf8CodecStream.class/properties.json b/repository/Grease-Squeak6-Core.package/GRPharoUtf8CodecStream.class/properties.json index 4c02a23b..5313f68b 100644 --- a/repository/Grease-Squeak6-Core.package/GRPharoUtf8CodecStream.class/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRPharoUtf8CodecStream.class/properties.json @@ -1,15 +1,14 @@ { + "commentStamp" : "pmm 2/20/2009 12:27", + "super" : "GRPharoConverterCodecStream", "category" : "Grease-Squeak6-Core", - "classinstvars" : [ - ], + "classinstvars" : [ ], + "pools" : [ ], "classvars" : [ "Latin1ToUtf8Encodings", - "Latin1ToUtf8Map" ], - "commentStamp" : "pmm 2/20/2009 12:27", - "instvars" : [ - ], + "Latin1ToUtf8Map" + ], + "instvars" : [ ], "name" : "GRPharoUtf8CodecStream", - "pools" : [ - ], - "super" : "GRPharoConverterCodecStream", - "type" : "normal" } + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRSmallDictionary.extension/properties.json b/repository/Grease-Squeak6-Core.package/GRSmallDictionary.extension/properties.json index 943ee5f4..0d78b749 100644 --- a/repository/Grease-Squeak6-Core.package/GRSmallDictionary.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRSmallDictionary.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "GRSmallDictionary" } + "name" : "GRSmallDictionary" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRSqueakPlatform.class/instance/integerAsByteArray..st b/repository/Grease-Squeak6-Core.package/GRSqueakPlatform.class/instance/integerAsByteArray..st new file mode 100644 index 00000000..124003a4 --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/GRSqueakPlatform.class/instance/integerAsByteArray..st @@ -0,0 +1,7 @@ +encoding +integerAsByteArray: anInteger + | stream | + stream := ByteArray new writeStream. + anInteger greaseBytesCount to: 1 by: -1 do: [:digitIndex | + stream nextPut: (anInteger greaseByteAt: digitIndex)]. + ^ stream contents \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRSqueakPlatform.class/properties.json b/repository/Grease-Squeak6-Core.package/GRSqueakPlatform.class/properties.json index 068d89c9..3ac2e32c 100644 --- a/repository/Grease-Squeak6-Core.package/GRSqueakPlatform.class/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRSqueakPlatform.class/properties.json @@ -1,14 +1,11 @@ { - "category" : "Grease-Squeak6-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "", - "instvars" : [ - ], - "name" : "GRSqueakPlatform", - "pools" : [ - ], "super" : "GRPharoPlatform", - "type" : "normal" } + "category" : "Grease-Squeak6-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "GRSqueakPlatform", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRWorkingWriteStream.class/properties.json b/repository/Grease-Squeak6-Core.package/GRWorkingWriteStream.class/properties.json index e4e89dfa..caf9c2fc 100644 --- a/repository/Grease-Squeak6-Core.package/GRWorkingWriteStream.class/properties.json +++ b/repository/Grease-Squeak6-Core.package/GRWorkingWriteStream.class/properties.json @@ -1,14 +1,11 @@ { - "category" : "Grease-Squeak6-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "pmm 8/25/2011 18:30", - "instvars" : [ - ], - "name" : "GRWorkingWriteStream", - "pools" : [ - ], "super" : "WriteStream", - "type" : "normal" } + "category" : "Grease-Squeak6-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "GRWorkingWriteStream", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/Interval.extension/properties.json b/repository/Grease-Squeak6-Core.package/Interval.extension/properties.json index d468cd35..534eb553 100644 --- a/repository/Grease-Squeak6-Core.package/Interval.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/Interval.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Interval" } + "name" : "Interval" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-Squeak6-Core.package/LargeInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..9cec08f2 --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/LargeInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,8 @@ +*Grease-Squeak6-Core +greaseByteAt: index + "Primitive. Answer the value of an indexable field in the receiver. LargePositiveInteger uses bytes of base two number, and each is a 'digit' base 256. Fail if the argument (the index) is not an Integer or is out of bounds. Essential. See Object documentation whatIsAPrimitive." + + + self greaseBytesCount < index + ifTrue: [^0] + ifFalse: [^super at: index] \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/LargeInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Squeak6-Core.package/LargeInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..0e345af9 --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/LargeInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,8 @@ +*Grease-Squeak6-Core +greaseBytesCount + "Primitive. Answer the number of indexable fields in the receiver. This + value is the same as the largest legal subscript. Essential. See Object + documentation whatIsAPrimitive." + + + self primitiveFailed \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/LargeInteger.extension/properties.json b/repository/Grease-Squeak6-Core.package/LargeInteger.extension/properties.json new file mode 100644 index 00000000..029bc676 --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/LargeInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "LargeInteger" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/MessageSend.extension/properties.json b/repository/Grease-Squeak6-Core.package/MessageSend.extension/properties.json index 66fcc3c1..00669b90 100644 --- a/repository/Grease-Squeak6-Core.package/MessageSend.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/MessageSend.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "MessageSend" } + "name" : "MessageSend" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/Number.extension/properties.json b/repository/Grease-Squeak6-Core.package/Number.extension/properties.json index 1d2c94d4..71dace88 100644 --- a/repository/Grease-Squeak6-Core.package/Number.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/Number.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Number" } + "name" : "Number" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/Object.extension/properties.json b/repository/Grease-Squeak6-Core.package/Object.extension/properties.json index 3d3b9ec4..f30a86e1 100644 --- a/repository/Grease-Squeak6-Core.package/Object.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/Object.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Object" } + "name" : "Object" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/PositionableStream.extension/properties.json b/repository/Grease-Squeak6-Core.package/PositionableStream.extension/properties.json index 9e1697a6..8e090ee3 100644 --- a/repository/Grease-Squeak6-Core.package/PositionableStream.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/PositionableStream.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "PositionableStream" } + "name" : "PositionableStream" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/Random.extension/properties.json b/repository/Grease-Squeak6-Core.package/Random.extension/properties.json index 1c67d9ee..b6485d17 100644 --- a/repository/Grease-Squeak6-Core.package/Random.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/Random.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Random" } + "name" : "Random" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/ScaledDecimal.extension/properties.json b/repository/Grease-Squeak6-Core.package/ScaledDecimal.extension/properties.json index 6e425dda..75f85f87 100644 --- a/repository/Grease-Squeak6-Core.package/ScaledDecimal.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/ScaledDecimal.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "ScaledDecimal" } + "name" : "ScaledDecimal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/properties.json b/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/properties.json index 3b2523c3..a68b7db6 100644 --- a/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "SequenceableCollection" } + "name" : "SequenceableCollection" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/SmallInteger.extension/instance/greaseByteAt..st b/repository/Grease-Squeak6-Core.package/SmallInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..50dd9644 --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/SmallInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,14 @@ +*Grease-Squeak6-Core +greaseByteAt: n + "Answer the value of an apparent byte-indexable field in the receiver, + analogous to the large integers, which are organized as bytes." + + n = 1 + ifTrue: [ + "Negate carefully in case the receiver is SmallInteger minVal" + ^ self < 0 + ifTrue: [ -256 - self bitAnd: 255 ] + ifFalse: [ self bitAnd: 255 ] ]. + ^ self < 0 + ifTrue: [ (-256 - self bitShift: -8) + 1 byteAt: n - 1 ] + ifFalse: [ (self bitShift: 8 - (n bitShift: 3)) bitAnd: 255 ] \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/SmallInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Squeak6-Core.package/SmallInteger.extension/instance/greaseBytesCount.st new file mode 100644 index 00000000..cb39e69c --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/SmallInteger.extension/instance/greaseBytesCount.st @@ -0,0 +1,25 @@ +*Grease-Squeak6-Core +greaseBytesCount + "Answer the number of indexable fields in the receiver. This value is the + same as the largest legal subscript. Included so that a SmallInteger can + behave like a LargePositiveInteger or LargeNegativeInteger." + + "32768 == (1 bitShift: 15)" + "32768 bytesCount >>> 2" + + "65536 == (1 bitShift: 16)" + "65536 bytesCount >>> 3" + + | value length | + length := 1. + value := self. + value >= 0 + ifTrue: + [[value > 255] whileTrue: + [value := value bitShift: -8. + length := length + 1]] + ifFalse: + [[value < -255] whileTrue: + [value := value bitShift: -8. + length := length + 1]]. + ^length \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/SmallInteger.extension/properties.json b/repository/Grease-Squeak6-Core.package/SmallInteger.extension/properties.json new file mode 100644 index 00000000..ca9cd21f --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/SmallInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "SmallInteger" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/SocketStream.extension/properties.json b/repository/Grease-Squeak6-Core.package/SocketStream.extension/properties.json index 4800d84e..797e09e5 100644 --- a/repository/Grease-Squeak6-Core.package/SocketStream.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/SocketStream.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "SocketStream" } + "name" : "SocketStream" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/String.extension/properties.json b/repository/Grease-Squeak6-Core.package/String.extension/properties.json index c2138507..b20f2de3 100644 --- a/repository/Grease-Squeak6-Core.package/String.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/String.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "String" } + "name" : "String" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/Symbol.extension/properties.json b/repository/Grease-Squeak6-Core.package/Symbol.extension/properties.json index 565e67b0..8c6bce81 100644 --- a/repository/Grease-Squeak6-Core.package/Symbol.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/Symbol.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Symbol" } + "name" : "Symbol" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/WriteStream.extension/properties.json b/repository/Grease-Squeak6-Core.package/WriteStream.extension/properties.json index 239b3632..8688e80d 100644 --- a/repository/Grease-Squeak6-Core.package/WriteStream.extension/properties.json +++ b/repository/Grease-Squeak6-Core.package/WriteStream.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "WriteStream" } + "name" : "WriteStream" +} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/properties.json b/repository/Grease-Squeak6-Core.package/properties.json index f037444a..6f31cf5a 100644 --- a/repository/Grease-Squeak6-Core.package/properties.json +++ b/repository/Grease-Squeak6-Core.package/properties.json @@ -1,2 +1 @@ -{ - } +{ } \ No newline at end of file From 9f6bc4147d93ef8b2628458fbe6ac89566ca90ad Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 15:37:23 +0100 Subject: [PATCH 12/15] LargeInteger does not exist in Squeak Move extensions from LargeInteger to LargePositiveInteger --- .../LargeInteger.extension/properties.json | 3 --- .../instance/greaseByteAt..st | 0 .../instance/greaseBytesCount.st | 0 .../LargePositiveInteger.extension/properties.json | 3 +++ 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 repository/Grease-Squeak6-Core.package/LargeInteger.extension/properties.json rename repository/Grease-Squeak6-Core.package/{LargeInteger.extension => LargePositiveInteger.extension}/instance/greaseByteAt..st (100%) rename repository/Grease-Squeak6-Core.package/{LargeInteger.extension => LargePositiveInteger.extension}/instance/greaseBytesCount.st (100%) create mode 100644 repository/Grease-Squeak6-Core.package/LargePositiveInteger.extension/properties.json diff --git a/repository/Grease-Squeak6-Core.package/LargeInteger.extension/properties.json b/repository/Grease-Squeak6-Core.package/LargeInteger.extension/properties.json deleted file mode 100644 index 029bc676..00000000 --- a/repository/Grease-Squeak6-Core.package/LargeInteger.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "LargeInteger" -} \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-Squeak6-Core.package/LargePositiveInteger.extension/instance/greaseByteAt..st similarity index 100% rename from repository/Grease-Squeak6-Core.package/LargeInteger.extension/instance/greaseByteAt..st rename to repository/Grease-Squeak6-Core.package/LargePositiveInteger.extension/instance/greaseByteAt..st diff --git a/repository/Grease-Squeak6-Core.package/LargeInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Squeak6-Core.package/LargePositiveInteger.extension/instance/greaseBytesCount.st similarity index 100% rename from repository/Grease-Squeak6-Core.package/LargeInteger.extension/instance/greaseBytesCount.st rename to repository/Grease-Squeak6-Core.package/LargePositiveInteger.extension/instance/greaseBytesCount.st diff --git a/repository/Grease-Squeak6-Core.package/LargePositiveInteger.extension/properties.json b/repository/Grease-Squeak6-Core.package/LargePositiveInteger.extension/properties.json new file mode 100644 index 00000000..4fea44e2 --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/LargePositiveInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "LargePositiveInteger" +} \ No newline at end of file From 8963e58339483e9b1e271dd0084e1008be5076a6 Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 29 Oct 2023 15:39:01 +0100 Subject: [PATCH 13/15] LargeInteger does not exist in Squeak Move extensions from LargeInteger to LargePositiveInteger --- .../LargeInteger.extension/properties.json | 3 --- .../instance/greaseByteAt..st | 0 .../instance/greaseBytesCount.st | 0 .../LargePositiveInteger.extension/properties.json | 3 +++ 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 repository/Grease-Squeak5-Core.package/LargeInteger.extension/properties.json rename repository/Grease-Squeak5-Core.package/{LargeInteger.extension => LargePositiveInteger.extension}/instance/greaseByteAt..st (100%) rename repository/Grease-Squeak5-Core.package/{LargeInteger.extension => LargePositiveInteger.extension}/instance/greaseBytesCount.st (100%) create mode 100644 repository/Grease-Squeak5-Core.package/LargePositiveInteger.extension/properties.json diff --git a/repository/Grease-Squeak5-Core.package/LargeInteger.extension/properties.json b/repository/Grease-Squeak5-Core.package/LargeInteger.extension/properties.json deleted file mode 100644 index 029bc676..00000000 --- a/repository/Grease-Squeak5-Core.package/LargeInteger.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "LargeInteger" -} \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-Squeak5-Core.package/LargePositiveInteger.extension/instance/greaseByteAt..st similarity index 100% rename from repository/Grease-Squeak5-Core.package/LargeInteger.extension/instance/greaseByteAt..st rename to repository/Grease-Squeak5-Core.package/LargePositiveInteger.extension/instance/greaseByteAt..st diff --git a/repository/Grease-Squeak5-Core.package/LargeInteger.extension/instance/greaseBytesCount.st b/repository/Grease-Squeak5-Core.package/LargePositiveInteger.extension/instance/greaseBytesCount.st similarity index 100% rename from repository/Grease-Squeak5-Core.package/LargeInteger.extension/instance/greaseBytesCount.st rename to repository/Grease-Squeak5-Core.package/LargePositiveInteger.extension/instance/greaseBytesCount.st diff --git a/repository/Grease-Squeak5-Core.package/LargePositiveInteger.extension/properties.json b/repository/Grease-Squeak5-Core.package/LargePositiveInteger.extension/properties.json new file mode 100644 index 00000000..4fea44e2 --- /dev/null +++ b/repository/Grease-Squeak5-Core.package/LargePositiveInteger.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "LargePositiveInteger" +} \ No newline at end of file From 4c66a68da78ca0fd16de4cebd8fd436ccd0fe803 Mon Sep 17 00:00:00 2001 From: Johan Brichau Date: Mon, 30 Oct 2023 22:10:38 +0100 Subject: [PATCH 14/15] add implementation in GemStone for Integer>>greaseByteAt: and Integer>>greaseByteCount on SmallInteger and LargeInteger --- .../LargeInteger.extension/instance/greaseByteAt..st | 4 ++++ .../LargeInteger.extension/instance/greaseByteCount.st | 4 ++++ .../LargeInteger.extension/properties.json | 2 ++ .../SmallInteger.extension/instance/greaseByteAt..st | 4 ++++ .../SmallInteger.extension/instance/greaseByteCount.st | 4 ++++ .../SmallInteger.extension/properties.json | 2 ++ 6 files changed, 20 insertions(+) create mode 100644 repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseByteCount.st create mode 100644 repository/Grease-GemStone-Core.package/LargeInteger.extension/properties.json create mode 100644 repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseByteAt..st create mode 100644 repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseByteCount.st create mode 100644 repository/Grease-GemStone-Core.package/SmallInteger.extension/properties.json diff --git a/repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseByteAt..st b/repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..315c86a0 --- /dev/null +++ b/repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,4 @@ +*grease-gemstone-core +greaseByteAt: index + + ^ self digitAt: index \ No newline at end of file diff --git a/repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseByteCount.st b/repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseByteCount.st new file mode 100644 index 00000000..62b61a78 --- /dev/null +++ b/repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseByteCount.st @@ -0,0 +1,4 @@ +*grease-gemstone-core +greaseByteCount + + ^ self digitLength \ No newline at end of file diff --git a/repository/Grease-GemStone-Core.package/LargeInteger.extension/properties.json b/repository/Grease-GemStone-Core.package/LargeInteger.extension/properties.json new file mode 100644 index 00000000..187ee5a7 --- /dev/null +++ b/repository/Grease-GemStone-Core.package/LargeInteger.extension/properties.json @@ -0,0 +1,2 @@ +{ + "name" : "LargeInteger" } diff --git a/repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseByteAt..st b/repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseByteAt..st new file mode 100644 index 00000000..315c86a0 --- /dev/null +++ b/repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseByteAt..st @@ -0,0 +1,4 @@ +*grease-gemstone-core +greaseByteAt: index + + ^ self digitAt: index \ No newline at end of file diff --git a/repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseByteCount.st b/repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseByteCount.st new file mode 100644 index 00000000..62b61a78 --- /dev/null +++ b/repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseByteCount.st @@ -0,0 +1,4 @@ +*grease-gemstone-core +greaseByteCount + + ^ self digitLength \ No newline at end of file diff --git a/repository/Grease-GemStone-Core.package/SmallInteger.extension/properties.json b/repository/Grease-GemStone-Core.package/SmallInteger.extension/properties.json new file mode 100644 index 00000000..d2d9ab4a --- /dev/null +++ b/repository/Grease-GemStone-Core.package/SmallInteger.extension/properties.json @@ -0,0 +1,2 @@ +{ + "name" : "SmallInteger" } From f7d9822060308c22db43eaa536f7bcba955075d2 Mon Sep 17 00:00:00 2001 From: Johan Brichau Date: Mon, 30 Oct 2023 22:15:29 +0100 Subject: [PATCH 15/15] correct typo in method name --- .../instance/{greaseByteCount.st => greaseBytesCount.st} | 2 +- .../instance/{greaseByteCount.st => greaseBytesCount.st} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/{greaseByteCount.st => greaseBytesCount.st} (71%) rename repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/{greaseByteCount.st => greaseBytesCount.st} (71%) diff --git a/repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseByteCount.st b/repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseBytesCount.st similarity index 71% rename from repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseByteCount.st rename to repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseBytesCount.st index 62b61a78..1a552749 100644 --- a/repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseByteCount.st +++ b/repository/Grease-GemStone-Core.package/LargeInteger.extension/instance/greaseBytesCount.st @@ -1,4 +1,4 @@ *grease-gemstone-core -greaseByteCount +greaseBytesCount ^ self digitLength \ No newline at end of file diff --git a/repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseByteCount.st b/repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseBytesCount.st similarity index 71% rename from repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseByteCount.st rename to repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseBytesCount.st index 62b61a78..1a552749 100644 --- a/repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseByteCount.st +++ b/repository/Grease-GemStone-Core.package/SmallInteger.extension/instance/greaseBytesCount.st @@ -1,4 +1,4 @@ *grease-gemstone-core -greaseByteCount +greaseBytesCount ^ self digitLength \ No newline at end of file