X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
**IMPORTANT**: Since version 1.3.0, this is the main repository of Grease. Versions older than 1.1.9 can be found in the [Smalltalkhub repository](http://www.smalltalkhub.com/#!/~Seaside/Grease11). Check out the [releases list](https://github.com/SeasideSt/Grease/releases) for all version numbers in this repository.

The Grease Portability Library [![Build Status](https://travis-ci.org/SeasideSt/Grease.png?branch=master)](https://travis-ci.org/SeasideSt/Grease)
The Grease Portability Library [![Build Status](https://travis-ci.org/SeasideSt/Grease.svg?branch=master)](https://travis-ci.org/SeasideSt/Grease)
======

The main repository of Grease is on Smalltalkhub: (http://www.smalltalkhub.com/#!/~Seaside/Grease11). This repository mirrors it.

Grease enhances the ANSI Smalltalk standard. With only a few exceptions, we assume platforms are fully ANSI-compliant. Platforms want to support Seaside and standardization makes this easier for the project’s developers and its porters.
Grease enhances the ANSI Smalltalk standard. With only a few exceptions, we assume platforms are fully ANSI-compliant. Platforms want to support Seaside and standardization makes this easier for the project’s developers and its porters.

Grease defines expected APIs with unit tests. Platforms can quickly determine if they are compatible and users can examine the tests to determine exactly which behaviours they can count on.

Grease takes a pragmatic approach to compatibility. Sometimes a method behaves so differently on two platforms, for example, that we are forced to avoid it or to standardize on a new selector. To get standard exception signaling on all platforms, Grease is forced to provide special exception classes that can be subclassed. Sometimes we need to put “right” aside and settle, instead, on a solution that can be implemented everywhere.
Grease takes a pragmatic approach to compatibility. Sometimes a method behaves so differently on two platforms, for example, that we are forced to avoid it or to standardize on a new selector. To get standard exception signaling on all platforms, Grease is forced to provide special exception classes that can be subclassed. Sometimes we need to put “right” aside and settle, instead, on a solution that can be implemented everywhere.

Grease tries to be concise and consistent. Despite its pragmatic approach, we still want to be “right” as much as possible. Because it’s hard to remove functionality once it has been added, we need to carefully consider each addition before proceeding. We’re moving slowly and looking for methods that are commonly used and that have clear names and semantics.
Grease tries to be concise and consistent. Despite its pragmatic approach, we still want to be “right” as much as possible. Because it’s hard to remove functionality once it has been added, we need to carefully consider each addition before proceeding. We’re moving slowly and looking for methods that are commonly used and that have clear names and semantics.

Grease does not try to solve all problems. We are not testing Sockets or HTTP clients. We don’t expect platforms to have standard SSL or graphics libraries. Its scope may grow over time, but for now we’re focusing on extending the functionality of the core classes defined in the ANSI standard (collections, exceptions, streams, blocks, etc.) and on other pieces of functionality that are critical to the Seaside project (e.g. random number generation and secure hashing).
Grease does not try to solve all problems. We are not testing Sockets or HTTP clients. We don’t expect platforms to have standard SSL or graphics libraries. Its scope may grow over time, but for now we’re focusing on extending the functionality of the core classes defined in the ANSI standard (collections, exceptions, streams, blocks, etc.) and on other pieces of functionality that are critical to the Seaside project (e.g. random number generation and secure hashing).

Grease is widely adopted. Implementations exist already for all platforms that support Seaside 3.x. As well as Seaside, new versions of Magritte, Pier, and Monticello are already being implemented on top of Grease.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
accessing
use: anObject during: aBlock
| p oldValue result |
"Proper implementation instead of use 'super value:during:' because that one does not return value, perhaps this should be fixed in DynamicVariable?"
| p hasOldValue oldValue result |
"Implementation cannot send a supercall to value:during: because:
- this method needs to return the value
- the defaultValue may not be invoked here to support throwing errors as defaultValue
- nil may not remain installed as the default value once the block has finished running"
p := Processor activeProcess.
hasOldValue := p environment includesKey: self.
oldValue := p environmentAt: self.
[
p environmentAt: self put: anObject.
result := aBlock value ]
ensure: [ p environmentAt: self put: oldValue ].
ensure: [
hasOldValue
ifFalse: [ p environment removeKey: self ]
ifTrue: [ p environmentAt: self put: oldValue ] ].
^ result
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"class" : {
"default" : "JohanBrichau 07/23/2017 09:48",
"defaultValue" : "JohanBrichau 07/23/2017 09:47",
"use:during:" : "JohanBrichau 07/23/2017 07:39" },
"use:during:" : "JB 09/08/2017 00:34" },
"instance" : {
} }
47 changes: 46 additions & 1 deletion repository/Grease-GemStone-Core.package/monticello.meta/version

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
value: anObject during: aBlock
| p oldValue |
p := Processor activeProcess.
oldValue := p psValueAt: index.
^ [
p psValueAt: index put: anObject.
aBlock value ] ensure: [ p psValueAt: index put: oldValue ]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
"defaultValue" : "JohanBrichau 7/23/2017 17:55",
"use:during:" : "MaxLeske 5/16/2017 21:54" },
"instance" : {
"default" : "JohanBrichau 7/23/2017 17:56" } }
"default" : "JohanBrichau 7/23/2017 17:56",
"value:during:" : "JohanBrichau 7/23/2017 21:20" } }
12 changes: 11 additions & 1 deletion repository/Grease-Pharo30-Core.package/monticello.meta/version
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
(name 'Grease-Pharo30-Core-MaxLeske.25' message 'merged by GitFileTree-MergeDriver' id '196d127f-a98d-4b2d-9234-c2d2c9fdd687' date '23 July 2017' time '11:33:53.733442 am' author 'MaxLeske' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.24' message 'Added GRDynamicVariable class>>defaultValue to represent the default value of a GRDynamicVariable. Previously, this was GRDynamicvariable>>default but this was not compatible for all platforms' id 'ae256fa1-7340-4d02-8b46-ddabaf8c0196' date '23 July 2017' time '5:56:18.263198 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-MaxLeske.23' message 'merged by GitFileTree-MergeDriver' id 'bf826cec-f28e-4871-a5a8-f86c21244de8' date '25 May 2017' time '2:48:46.179573 pm' author 'MaxLeske' ancestors ((name 'Grease-Pharo30-Core-MaxLeske.22' message '* added GRDynamicVariable as replacement for WADynamicVariable' id 'ea9f25a6-270c-0d00-82d8-687107321642' date '18 May 2017' time '7:45:27.980288 am' author 'MaxLeske' ancestors ((name 'Grease-Pharo30-Core-pmm.21' message '- direct rendering for ScaledDecimal' id 'db8b6a8e-ce95-4c7b-817a-0fc352c0c000' date '26 August 2016' time '8:56:20.501423 am' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.20' message '- lint fixes' id 'ec123007-ffe6-483d-aba9-e36840b7a24c' date '25 August 2016' time '11:03:48.029702 am' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.19' message 'Added missing method GRPharoUtf8Coded>>invalidUtf8' id '3fc62b04-668c-4f6d-801d-54640757217c' date '18 January 2016' time '8:15:58.41072 am' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.18' message 'Implements #bindingOf: in Pharo3+' id 'cbd9dc15-a5ad-4b29-8399-e185c2b38f8e' date '12 July 2015' time '2:47:09.890712 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.17' message 'Missing sign on ScaledDecimal>>greaseString(https://github.com/SeasideSt/Grease/issues/1)Thanks Hilaire!' id 'bd1dc3a1-c04d-47ab-9637-c6ba13afe679' date '25 May 2015' time '9:05:39.60184 am' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.16' message 'additional file library methods' id 'bd9e3924-0ff7-443a-a361-68768ee52b77' date '3 October 2014' time '8:05:16.758249 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-pmm.15' message 'Issue 792: Issue encoding a non-ascii character preceded by an xml-unsafe one- https://code.google.com/p/seaside/issues/detail?id=792' id 'ee0aef7f-007a-4b55-ab96-ac338d55fed0' date '21 May 2014' time '9:30:02.077151 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.14' message 'Issue 789: Running WAFilelibraryTest on Pharo3 leaves Seaside-Tests-Core package in a dirty state https://code.google.com/p/seaside/issues/detail?id=789' id 'e845ca33-9427-435c-9a3c-f3d3a6669295' date '19 April 2014' time '5:23:30.089075 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.13' message 'move GRCountingStream from Pharo-only package to Core' id 'af3fd2e2-3290-4de5-8ea1-a92a78eeed4a' date '16 February 2014' time '9:29:51.277053 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.12' message 'bugfix #readWriteByteStream http://forum.world.st/errorImproperStore-error-because-of-change-in-GRPharoPlatform-gt-gt-readWriteByteStream-td4737266.html' id 'f0022f14-d33b-47cd-98e9-891c3d72e7af' date '18 January 2014' time '7:06:52.139327 am' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-pmm.11' message 'Issue 770: ScaledDecimal rendering supporthttp://code.google.com/p/seaside/issues/detail?id=770' id '9cfba12f-0b05-432d-84d1-d5cd8bf23dfe' date '15 September 2013' time '12:25:15.521 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.10' message '- add #doSilentlyBack:' id '5ccc9407-d97b-45f3-b9b0-c5135257da27' date '12 September 2013' time '6:07:05.251 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.9' message '- fix URLs' id 'd89a3a93-8df2-4fef-b4ed-6d99b3e4befb' date '12 September 2013' time '4:01:20.912841 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.8' message '- fix metadata' id '53897910-3143-4a50-8b56-3af0a1219593' date '12 September 2013' time '3:55:52.88988 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.7' message 'Issue 760: addAllFilesIn: is broken in Pharo 20http://code.google.com/p/seaside/issues/detail?id=760' id '326a7053-4672-4be5-b268-90e286a74f6c' date '12 September 2013' time '12:14:04.352265 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.6' message 'Issue 760: addAllFilesIn: is broken in Pharo 20http://code.google.com/p/seaside/issues/detail?id=760' id 'e43e7571-1bd1-4733-b53f-72a19245eed1' date '12 September 2013' time '12:10:25.447758 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.5' message '- FileSystem fixes' id '2a3dc16b-d38e-4f50-be28-2138a431d832' date '12 September 2013' time '12:05:46.224478 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.4' message '- fix compilation' id '8d649251-34e2-4ed0-a007-223b556888a8' date '12 September 2013' time '11:25:48.069182 am' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-DamienCassou.3' message '- Pharo 3.0: no need for sending #defaultMethodTrailer anymore' id 'c5d1b0db-bf87-43a3-bd4b-9d4d47169699' date '9 September 2013' time '10:39:38.671985 am' author 'DamienCassou' ancestors ((name 'Grease-Pharo30-Core-MattSpr.2' message 'Fixed #compile:into:classified: for Pharo3.0.' id '26925549-0374-4ecc-a49b-fd8d4e28962d' date '28 August 2013' time '10:43:32.58787 am' author 'MattSpr' ancestors ((name 'Grease-Pharo30-Core-MattSpr.1' message 'Copy of package from Pharo 2.0.' id '6da53441-b2d0-49dc-ae04-15d757b7a8af' date '28 August 2013' time '10:41:57.145859 am' author 'MattSpr' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())(name 'Grease-Pharo30-Core-PavelKrivanek.22' message 'move extensions of Behavior to TBehavior' id '72b159cb-0b0a-0d00-90c8-922f067edcaa' date '21 April 2017' time '11:41:09.810975 am' author 'PavelKrivanek' ancestors ((id 'db8b6a8e-ce95-4c7b-817a-0fc352c0c000')) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
(name 'Grease-Pharo30-Core-JohanBrichau.25' message 'Override on GRDynamicVariable: #defaultValue should not be called from within #use:during:' id 'b1abf22f-4255-4003-9ccb-7690ff121a19' date '24 July 2017' time '8:07:45.175466 am' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.24' message 'Added GRDynamicVariable class>>defaultValue to represent the default value of a GRDynamicVariable. Previously, this was GRDynamicvariable>>default but this was not compatible for all platforms' id 'ae256fa1-7340-4d02-8b46-ddabaf8c0196' date '23 July 2017' time '5:56:18.263198 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-MaxLeske.23' message 'merged by GitFileTree-MergeDriver' id 'bf826cec-f28e-4871-a5a8-f86c21244de8' date '25 May 2017' time '2:48:46.179573 pm' author 'MaxLeske' ancestors ((name 'Grease-Pharo30-Core-MaxLeske.22' message '* added GRDynamicVariable as replacement for WADynamicVariable' id 'ea9f25a6-270c-0d00-82d8-687107321642' date '18 May 2017' time '7:45:27.980288 am' author 'MaxLeske' ancestors ((name 'Grease-Pharo30-Core-pmm.21' message '- direct rendering for ScaledDecimal' id 'db8b6a8e-ce95-4c7b-817a-0fc352c0c000' date '26 August 2016' time '8:56:20.501423 am' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.20' message '- lint fixes' id 'ec123007-ffe6-483d-aba9-e36840b7a24c' date '25 August 2016' time '11:03:48.029702 am' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.19' message 'Added missing method GRPharoUtf8Coded>>invalidUtf8' id '3fc62b04-668c-4f6d-801d-54640757217c' date '18 January 2016' time '8:15:58.41072 am' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.18' message 'Implements #bindingOf: in Pharo3+' id 'cbd9dc15-a5ad-4b29-8399-e185c2b38f8e' date '12 July 2015' time '2:47:09.890712 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.17' message 'Missing sign on ScaledDecimal>>greaseString
(https://github.com/SeasideSt/Grease/issues/1)

Thanks Hilaire!' id 'bd1dc3a1-c04d-47ab-9637-c6ba13afe679' date '25 May 2015' time '9:05:39.60184 am' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.16' message 'additional file library methods' id 'bd9e3924-0ff7-443a-a361-68768ee52b77' date '3 October 2014' time '8:05:16.758249 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-pmm.15' message 'Issue 792: Issue encoding a non-ascii character preceded by an xml-unsafe one
- https://code.google.com/p/seaside/issues/detail?id=792' id 'ee0aef7f-007a-4b55-ab96-ac338d55fed0' date '21 May 2014' time '9:30:02.077151 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.14' message 'Issue 789: Running WAFilelibraryTest on Pharo3 leaves Seaside-Tests-Core package in a dirty state

https://code.google.com/p/seaside/issues/detail?id=789' id 'e845ca33-9427-435c-9a3c-f3d3a6669295' date '19 April 2014' time '5:23:30.089075 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.13' message 'move GRCountingStream from Pharo-only package to Core' id 'af3fd2e2-3290-4de5-8ea1-a92a78eeed4a' date '16 February 2014' time '9:29:51.277053 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-JohanBrichau.12' message 'bugfix #readWriteByteStream
http://forum.world.st/errorImproperStore-error-because-of-change-in-GRPharoPlatform-gt-gt-readWriteByteStream-td4737266.html' id 'f0022f14-d33b-47cd-98e9-891c3d72e7af' date '18 January 2014' time '7:06:52.139327 am' author 'JohanBrichau' ancestors ((name 'Grease-Pharo30-Core-pmm.11' message 'Issue 770: ScaledDecimal rendering support
http://code.google.com/p/seaside/issues/detail?id=770' id '9cfba12f-0b05-432d-84d1-d5cd8bf23dfe' date '15 September 2013' time '12:25:15.521 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.10' message '- add #doSilentlyBack:' id '5ccc9407-d97b-45f3-b9b0-c5135257da27' date '12 September 2013' time '6:07:05.251 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.9' message '- fix URLs' id 'd89a3a93-8df2-4fef-b4ed-6d99b3e4befb' date '12 September 2013' time '4:01:20.912841 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.8' message '- fix metadata' id '53897910-3143-4a50-8b56-3af0a1219593' date '12 September 2013' time '3:55:52.88988 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.7' message 'Issue 760: addAllFilesIn: is broken in Pharo 20
http://code.google.com/p/seaside/issues/detail?id=760' id '326a7053-4672-4be5-b268-90e286a74f6c' date '12 September 2013' time '12:14:04.352265 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.6' message 'Issue 760: addAllFilesIn: is broken in Pharo 20
http://code.google.com/p/seaside/issues/detail?id=760' id 'e43e7571-1bd1-4733-b53f-72a19245eed1' date '12 September 2013' time '12:10:25.447758 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.5' message '- FileSystem fixes' id '2a3dc16b-d38e-4f50-be28-2138a431d832' date '12 September 2013' time '12:05:46.224478 pm' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-pmm.4' message '- fix compilation' id '8d649251-34e2-4ed0-a007-223b556888a8' date '12 September 2013' time '11:25:48.069182 am' author 'pmm' ancestors ((name 'Grease-Pharo30-Core-DamienCassou.3' message '- Pharo 3.0: no need for sending #defaultMethodTrailer anymore' id 'c5d1b0db-bf87-43a3-bd4b-9d4d47169699' date '9 September 2013' time '10:39:38.671985 am' author 'DamienCassou' ancestors ((name 'Grease-Pharo30-Core-MattSpr.2' message 'Fixed #compile:into:classified: for Pharo3.0.' id '26925549-0374-4ecc-a49b-fd8d4e28962d' date '28 August 2013' time '10:43:32.58787 am' author 'MattSpr' ancestors ((name 'Grease-Pharo30-Core-MattSpr.1' message 'Copy of package from Pharo 2.0.' id '6da53441-b2d0-49dc-ae04-15d757b7a8af' date '28 August 2013' time '10:41:57.145859 am' author 'MattSpr' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())(name 'Grease-Pharo30-Core-PavelKrivanek.22' message 'move extensions of Behavior to TBehavior' id '72b159cb-0b0a-0d00-90c8-922f067edcaa' date '21 April 2017' time '11:41:09.810975 am' author 'PavelKrivanek' ancestors ((id 'db8b6a8e-ce95-4c7b-817a-0fc352c0c000')) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
tests
testDefaultValue
self assert: GRTestDynamicVariable value = 'default test value'
self assert: GRTestDynamicVariable value = 'default test value'.

GRTestDynamicVariable
use: 'my value'
during: [ ].
self assert: GRTestDynamicVariable value = 'default test value' description:'The default value is no longer correct'.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"testWithoutValue" : "MaxLeske 5/18/2017 07:42",
"testAnswer" : "MaxLeske 5/18/2017 07:42",
"testWithNestedValue" : "MaxLeske 5/18/2017 07:42",
"testDefaultValue" : "JohanBrichau 7/23/2017 16:57",
"testDefaultValue" : "JohanBrichau 9/8/2017 09:53",
"testWithValue" : "MaxLeske 5/18/2017 07:42"
},
"class" : { }
Expand Down
64 changes: 63 additions & 1 deletion repository/Grease-Tests-Core.package/monticello.meta/version

Large diffs are not rendered by default.

X Tutup