Re: [Pharo-dev] new pharo cheatsheet
I agree that enumeration is more useful but it wouldn't be bad to have something in there to indicate the 1-index nature, such as *'abcd' at: 2* will result in $b That's all I was suggesting. Actually, having some cheat sheet on basic enumeration wouldn't be bad as that is a real strength of Smalltalk. Mention and illustrate what do: collect: and select: do. Then mention that there are other ones like count: and sum:. Cheers, Jeff On Sat, Apr 9, 2016 at 4:57 AM Cyril Ferlicot D.wrote: > Le 08/04/2016 22:08, J.F. Rick a écrit : > > It looks good. I might mention that most data structures are 1 indexed > > as most other languages tend to be 0 indexed and that throws people new > > to the language. > > > > I use Pharo since 1 year now and I had to use indexes only 3-4 times. I > think it is more important to say that Pharo have Collections with an > awesome API. > > -- > Cyril Ferlicot > > http://www.synectique.eu > > 165 Avenue Bretagne > Lille 59000 France > >
[Pharo-dev] Phexample based on StateSpecs
Hi. I got feedback from Moose guys that Mocketry has problems to be used together with Phexample package. Problem related to own version of "should expressions" in Phexample. So I propose to make Phexample based on StateSpecs. I commit new version 3.0 (with baseline 2.0) with this changes.It allows use Mocketry together with Phexample without problem. Some of Phexample expressions are not exist in StateSpecs. For now they works without changes by own Phexample implementation. One expression was removed because it is not compatible with StateSpecs. It is "should *be* blablabla". Now *#be* expression are based on StateSpecs where you can send any "boolean message" to receiver of should and it will be verified for truth: #(1 2) should be isEmpty 1 should be even. I think it is more simple and practical approach. You can easily browse and debug "predicate" methods of validated objects. And you don't need to extend should expression by "new words" Anyway it is not critical for Moose tests. They are same as before. *There is most noticeable change* in extracting description of some kind of expressions: Set new isEmpty should not beTrue In previous version you will get error "did not expect #isEmpty to be true". There is some magic to implement it. But it is not works generally: Set new isEmpty should not equal: true. It will return "expected true but got false" . So with new version first expression will produce "Got true but it should not be true". To achieve better description StateSpecs provides different approaches without special magic: - boolean expressions (described above) Set new should not *be* isEmpty "fail with: aSet should not be isEmpty" #(1 2) should *be* isEmpty 1 should *be* even. - property expressions by *#where *message (0@0 corner: 2@3) *where* corner x should be: 10 Any messages chain can be sent after #where message to verify deep property. And failure will looked like: "Got 2 from "(0@0 corner: 2@3) corner x" but it should be 10. I hope we can agree on using StateSpecs. It provides more simple and reusable solution. Reusability of StateSpecs achieved by first class specifications of object state and first class validation failures. They are reused to describe message stub arguments like mock someMessageWith: (Kind of: Number) Also they allows to implement different kind of presentation for specific specs and failures to improve debugger. At the end I want suggest to deprecate all kind of beTrue/beFalse/true/false/nil. They provides nothing more than bool should be: true bool should be: false object should be: nil And one expression I completely not understand: 600.123456789 should beCloseTo: 600.1. Why it is not implemented as "(a - b) abs < precision"? (precision = 0.0001 in Phexample) It is implemented as "(a - b) abs / (a abs max: b abs) < precision" In StateSpecs it will looks like 600.123456789 should equal: 600.1 within: 0.0001. Which of course will fail by my definition Best regards Denis
[Pharo-dev] [pharo-project/pharo-core] dfabd9: 50681
Branch: refs/heads/5.0 Home: https://github.com/pharo-project/pharo-core Commit: dfabd9545ac28cf2636de8bf1ecac3b0a6b62803 https://github.com/pharo-project/pharo-core/commit/dfabd9545ac28cf2636de8bf1ecac3b0a6b62803 Author: Jenkins Build ServerDate: 2016-04-11 (Mon, 11 Apr 2016) Changed paths: M ConfigurationOfRubric.package/ConfigurationOfRubric.class/instance/symbolic versions/stable_.st A ConfigurationOfRubric.package/ConfigurationOfRubric.class/instance/versions/version217_.st A ConfigurationOfRubric.package/ConfigurationOfRubric.class/instance/versions/version218_.st A Morphic-Widgets-Tree.package/MorphTreeNodeMorph.class/instance/announcements/announceDeleted.st M Morphic-Widgets-Tree.package/MorphTreeNodeMorph.class/instance/initialization/initWithContents_prior_forList_indentLevel_.st M Morphic-Widgets-Tree.package/MorphTreeNodeMorph.class/instance/updating/delete.st M Morphic-Widgets-Windows.package/SystemWindow.class/class/top window/noteTopWindowIn_.st M Rubric.package/RubAbstractTextArea.class/instance/initialize/plugFindReplace.st M Rubric.package/RubFindReplaceService.class/instance/accessing/textArea_.st M Rubric.package/RubGhostTextDisplayer.class/instance/submorphs-accessing/noteNewOwner_.st M Rubric.package/RubHighlightSegmentMorph.class/instance/event handling/registerTextArea.st M Rubric.package/RubPluggableTextMorph.class/instance/accessing scrollbars/registerScrollChanges_.st M Rubric.package/RubPrimarySelectionMorph.class/instance/event handling/registerTextArea.st M Rubric.package/RubShoutStylerDecorator.class/instance/editing/style_.st M Rubric.package/RubTextSegmentMorph.class/instance/event handling/registerTextArea.st R ScriptLoader50.package/ScriptLoader.class/instance/pharo - scripts/script50680.st A ScriptLoader50.package/ScriptLoader.class/instance/pharo - scripts/script50681.st R ScriptLoader50.package/ScriptLoader.class/instance/pharo - updates/update50680.st A ScriptLoader50.package/ScriptLoader.class/instance/pharo - updates/update50681.st M ScriptLoader50.package/ScriptLoader.class/instance/public/commentForCurrentUpdate.st Log Message: --- 50681 17284 Rubric SubscriptOutOfBounds error https://pharo.fogbugz.com/f/cases/17284 17972 Remove depended in MorphTreeNodeMorph on deletion https://pharo.fogbugz.com/f/cases/17972 17968 a window should not be the top window after its deletion https://pharo.fogbugz.com/f/cases/17968 http://files.pharo.org/image/50/50681.zip
[Pharo-dev] [pharo-project/pharo-core]
Branch: refs/tags/50681 Home: https://github.com/pharo-project/pharo-core
Re: [Pharo-dev] Missing #removeDuplicates
2016-04-10 8:55 GMT+02:00 Volkert: > Sorry. i meant AthensSkatch ;-) It is a nice demo about using athens. > > http://smalltalkhub.com/#!/~NicolaiHess/AthensSketch Hi Volkert, I just replaced #removeDuplicates with #asSet (this should work now). (and replaced some deprecated on:send:to: calls (for Announcements) with when:send:to: in the latest version. Nicolai > > > > On 10.04.2016 07:42, stepharo wrote: > >> >> >> Le 9/4/16 22:36, Volkert a écrit : >> >>> What happens to OrderedCollection>>removeDuplicates in Pharo 5.0? In >>> Pharo 4.0 it was part of a Package "GroupManager"? >>> >> >> It was probably badly implemented or only used in group manager (whose >> code was terrible) and we cleaned it. >> Now we could reintroduce it but in the right place and with tests. >> >>> It breaks the nice Package "AthensScratch" in Pharo 5.0 >>> >> >> what is athenscracth? >> >>> >>> BW. >>> Volkert >>> >>> >>> >> >> > >