Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
November 2017
- 87 participants
- 872 messages
Re: [Pharo-users] Why does the test runner show red when I correct a test?
by Richard Sargent
That would be fine.
The point is that, without running the test in its entirety, from start to
finish, without interruption, error, or failure, one cannot claim success.
On Fri, Nov 10, 2017 at 9:34 AM, Sean P. DeNigris <sean(a)clipperadams.com>
wrote:
> Richard Sargent wrote
> > The only reliable conclusion one can make from such an interrupted run is
> > whether it failed again. So, it would be possible to determine that the
> > test should be coloured red, but it is impossible to *reliably* claim
> that
> > the test should be coloured green.
>
> What if we ran the test again as if from the browser/runner before setting
> the icon?
>
>
>
> -----
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>
Nov. 10, 2017
Re: [Pharo-users] About implementing a "Mini Pillar" in-image renderer for Pharo ...
by Tudor Girba
Hi,
As shown at ESUG, GT Documenter offers an advanced viewer (and editor) for Pillar working on top of Bloc.
You can get it by loading:
Iceberg enableMetacelloIntegration: true.
Metacello new
baseline: 'GToolkit';
repository: 'github://feenkcom/gtoolkit/src';
load.
For example, you can then inspect:
'PATH_TO_ICEBERG/feenkcom/gtoolkit/doc/transcript/index.pillarâ asFileReference
Cheers,
Doru
> On Nov 10, 2017, at 12:58 PM, H. Hirzel <hannes.hirzel(a)gmail.com> wrote:
>
> A note:
>
> Tudor Girba wrote:
> <tudor(a)tudorgirba.com> Fri, Aug 25, 2017 at 1:31 PM
> Reply-To: Any question about pharo is welcome <pharo-users(a)lists.pharo.org>
> To: Any question about pharo is welcome <pharo-users(a)lists.pharo.org>
>
> Hi,
>
> As mentioned in an announcement about 10 days ago, we are building a
> Pillar editor with inline viewing abilities in Bloc. Here is how it
> looked like. Please note the embedded picture. We continued working on
> it since then and we will probably announce the next version this
> weekend:
>
>
> Maybe there is now enough progress to do simple presentations in Bloc?
>
>
> On 11/10/17, H. Hirzel <hannes.hirzel(a)gmail.com> wrote:
>> Hello
>>
>> In the thread 'including Pillar in Pharo image by default' it was
>> suggested by Stephane Ducasse to include a subset of Pillar in the
>> Pharo image[1] .
>>
>> I'd like to extend that proposal a little bit it in order to do very
>> simple presentations. This should allow to describe at least part of
>> the slides used in the MOOC course [3].
>>
>> This will be _a possible_ solution to the question brought up in the
>> thread 'Writing "powerpoint" like presentations in Pharo?'.
>>
>> Another use is to write instructions with executable content within
>> the image ("Assistants").
>>
>> So below is the a proposal for a Pillar syntax _subset_ for class
>> comments and _simple_ presentations.
>> The numbering scheme follows the 'Pillar syntax cheat sheet' [2]
>>
>>
>>
>>
>> MINI PILLAR SYNTAX (a subset of Pillar)
>>
>> 1. Headers
>>
>> !Header 1
>> !!Header 2
>> !!!Header 3
>>
>>
>> 2. Lists
>>
>> - Unordered List
>> # Ordered list
>>
>>
>>
>> 5. Emphasis
>>
>> ""bold""
>>
>>
>> 6. Code blocks
>>
>> [[[
>> Transcript show: 'Hello World'.
>> \]]]
>>
>>
>> 9. Annotation
>>
>> ${slide:title=About Pharo}$
>>
>>
>>
>>
>> Next week I plan to implement the rendering of this 'Mini Pillar' in
>> Morphic using the Morphic API subset that works in Pharo and Squeak.
>>
>> A renderer using Bloc would also be nice. [4]
>>
>> Comments, suggestions, code snippets and other help is welcome.
>>
>> Regards
>> Hannes
>>
>>
>>
>>
>> --------------------------------------------------------------------------------------------------
>> [1] Pillar subset for class comments
>>
>> Stephane Ducasse
>> <stepharo.self(a)gmail.com> Fri, Aug 11, 2017 at 7:09 PM
>> To: Any question about pharo is welcome <pharo-users(a)lists.pharo.org>
>>
>> Tx cyril
>>
>> For class comment I image that we want
>>
>> !
>>
>> -
>> -
>> *url*
>> and bold
>> [[[
>>
>> ]]]
>>
>> Did I miss something.
>>
>> Stef
>>
>>
>>
>>
>>
>> --------------------------------------------------------------------------------------------------
>> [2]
>> http://pillarhub.pharocloud.com/hub/pillarhub/pillarcheatsheet
>> --------------------------------------------------------------------------------------------------
>>
>>
>> 1. Headers
>>
>> !Header 1
>> !!Header 2
>> !!!Header 3
>> !!!!Header 4
>> !!!!!Header 5
>> !!!!!!Header 6
>>
>> 2. Lists
>>
>> - Unordered List
>> # Ordered list
>>
>> 3. Table
>>
>> |! Left |! Right |! Centered
>> |{Left |}Right| Centered
>>
>>
>> 4. Description
>> Note
>> on a new line
>>
>> ;head
>> :item
>>
>>
>> 5. Emphasis
>>
>> ""bold""
>> ''italic''
>> --strikethrough--
>> __underscore__
>> ==inline code==
>> @@subscript@@
>> ^^sub-script^^
>>
>> 6. Code blocks
>>
>> [[[labÂel=ÂhelÂloSÂcriÂpt|ÂcapÂtioÂn=How to print Hello
>> World|ÂlanÂguaÂge=ÂSmaÂlltalk
>> Transcript show: 'Hello World'.
>> \]]]
>>
>>
>> 7. Raw
>>
>>
>> {{{latex:
>> this is how you inject raw \LaTeX in your output file
>> }}}
>>
>> {{{marÂkdown:
>> this is how you inject raw `markdown` in your output file
>> }}}
>>
>> {{{html:
>> this is how you inject raw <b>ÂhtmÂl</Âb> in your output file
>> }}}
>>
>>
>> 8. Links
>>
>> Anchor @anchor (new line)
>> Internal link *anchor*
>> External link *Google>http://google.com*
>> Image +Caption>file://image.png|width=50|label=label+
>>
>>
>> 9. Annotation
>> Note
>> on a new line
>>
>> Annotation @@note this is a note
>> Todo item @@todo this is to do
>>
>>
>> 10. Comments
>>
>> % each line starting with % is commented
>>
>>
>> 11. References
>>
>> This document is copied from
>> http://www.cheatography.com/benjaminvanryseghem/cheat-sheets/pillar/
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ----------------------------------------------------------------------
>> [3] Example pillar code for slides
>> ----------------------------------------------------------------------
>>
>> https://github.com/SquareBracketAssociates/PharoMooc/blob/master/Slides/1-T…
>>
>> {
>> "title":"To the Roots of Objects",
>> "subtitle":"Learning from beauty",
>> "author":"Stephane Ducasse",
>> "complement":"http://stephane.ducasse.free.fr/ \\\\
>> stephane.ducasse(a)inria.fr"
>> }
>>
>>
>> ${toc:depthLevel=2|level=0|highlight=0}$
>>
>> %Les sections ne sont pas des titres de slide mais définnissent la
>> structure du doucment. Il est possible de rajouter
>> "renderStructureAsSlide":false dans pillar.conf pour ne pas créer de
>> slide à partir d'un titre.
>>
>>
>> ${slide:title=License}$
>>
>> +>file://figures/CreativeCommons.png|width=50|label=figCreativeCommons+
>>
>>
>> ! Introduction
>>
>> %
>> ${toc:depthLevel=1|level=0|highlight=1}$
>>
>>
>> ${slide:title=Really?!|label=really}$
>>
>> ${columns}$
>>
>> ${column:width=50}$
>>
>> %the width parameter take an Int between 1 and 100
>> %For now we have to pass a line before and after an annotation, I'll
>> correct that soon in Pillar.
>> - No primitive types
>> - No hardcoded constructs for conditional
>> - Only messages
>> - Only objects
>>
>> ${column:width=50}$
>>
>> - and this works?
>> - I mean really?
>> - Not even slow?
>> - Can't be real!
>>
>> ${endColumns}$
>>
>> ${slide:title=Motto}$
>>
>> - Let's open our eyes, look, understand, and deeply understand the
>> underlying design aspects of object-oriented programming.
>>
>>
>> *@really*
>>
>> *TEST !>@really*
>>
>> ${slide:title=Booleans}$
>>
>> [[[language=smalltalk
>> 3 > 0
>> ifTrue: ['positive']
>> ifFalse: ['negative']
>> -> 'positive'
>> ]]]
>>
>> ${slide:title=Yes ifTrue\:ifFalse\: is a message!}$
>>
>> [[[language=smalltalk
>> Weather isRaining
>> ifTrue: [self takeMyUmbrella]
>> ifFalse: [self takeMySunglasses]
>> ]]]
>>
>> - Conceptually ==ifTrue:ifFalse:== is a message sent to an object: a
>> boolean!
>> - ==ifTrue:ifFalse:== is in fact radically optimized by the compiler
>> but you can implement another one such ==siAlors:sinon:== and check.
>>
>> ${slide:title=Booleans}$
>>
>> In Pharo booleans have nothing special
>> - & | not
>> - or: and: (lazy)
>> - xor:
>> - ifTrue:ifFalse:
>> - ifFalse:ifTrue:
>> - ...
>>
>> ${slide:title=Lazy Logical Operators}$
>>
>> *LINK>@frm:really*
>>
>> [[[language=smalltalk
>> false and: [1 error: 'crazy']
>> -> false and not an error
>> ]]]
>>
>> ! Exercices
>> ${toc:depthLevel=1|level=0|highlight=1}$
>>
>> !! Exercise 1: Implement not
>>
>> ${slide:title=Exercise 1\: Implement not}$
>>
>> - Propose an implementation of not in a world where you do not have
>> Booleans.
>> - You only have objects and messages.
>> [[[language=smalltalk
>> false not
>> -> true
>>
>> true not
>> -> false
>> ]]]
>>
>> !!Exercise 2: Implement | (Or) ifTrue: ifFalse:
>>
>> ${toc:depthLevel=2|level=0|highlight=1}$
>>
>> ${slide:title=Exercise 2\: Implement \| (Or)}$
>>
>> - Propose an implementation of or in a world where you do not have
>> Booleans.
>> - You only have objects and messages.
>>
>> [[[language=smalltalk
>> true | true -> true
>> true | false -> true
>> true | anything -> true
>>
>> false | true -> true
>> false | false -> false
>> false | anything -> anything
>> ]]]
>>
>> ${slide:title=Exercise2\: Variation - Implement ifTrue\:ifFalse\:}$
>>
>> - Propose an implementation of not in a world where you do not have
>> Booleans.
>> - You only have objects, messages and closures.
>>
>> [[[language=smalltalk
>> false ifTrue: [ 3 ] ifFalse: [ 5 ]
>> -> 5
>> true ifTrue: [ 3 ] ifFalse: [ 5 ]
>> -> 3
>> ]]]
>>
>> ! Boolean Implementation
>>
>> ${toc:depthLevel=1|level=0|highlight=1}$
>>
>> ${slide:title=Booleans Implementation Hint One}$
>>
>> - The solution does not use conditionals
>> - else we would obtain a recursive definition of ==ifTrue:ifFalse:==
>>
>> ${slide:title=Boolean Implementation Hint Two}$
>>
>> - The solution uses three classes: ==Boolean==, ==True== and ==False==
>> - ==false== and ==true== are unique instances described by their own
>> classes
>> - ==false== is an instance of the class ==False==
>> - ==true== is an instance of the class ==True==
>>
>> +Boolean Hierarchy>file://figures/BooleanHiearchyAndInstances.png|width=50+
>>
>> ${slide:title=How do we express choice in OOP?}$
>>
>> - We send messages to objects
>>
>> [[[language=smalltalk
>> aButton color
>> -> Color red
>>
>> aPane color
>> -> Color blue
>>
>> aWindow color
>> -> Color grey
>> ]]]
>>
>> - Let's the receiver decide
>>
>> - Do not ask, tell
>>
>> ${slide:title=Boolean not implementation}$
>>
>> - Class ==Boolean== is an abstract class that implements behavior
>> common to true and false. Its subclasses are ==True== and ==False==.
>> Subclasses must implement methods for logical operations ==&==,
>> ==not==, and controls ==and:==, ==or:==, ==ifTrue:==, ==ifFalse:==,
>> ==ifTrue:ifFalse:==, ==ifFalse:ifTrue:==
>>
>> [[[language=smalltalk
>> Boolean>>not
>> "Negation. Answer true if the receiver is false, answer false if the
>> receiver is true."
>> self subclassResponsibility
>> ]]]
>>
>> ${slide:title=Not implementation in two methods}$
>>
>> [[[language=smalltalk
>> False>>not
>> "Negation -- answer true since the receiver is false."
>> ^ true
>> ]]]
>>
>> [[[language=smalltalk
>> True>>not
>> "Negation--answer false since the receiver is true."
>> ^ false
>> ]]]
>>
>> ${slide:title=Not implementation in two methods}$
>>
>> +Not
>> implementation.>file://figures/BooleanHiearchyAndInstancesWithNotMethods.png|width=80+
>>
>> ${slide:title=\| (Or)}$
>> [[[language=smalltalk
>>
>> true | true -> true
>> true | false -> true
>> true | anything -> true
>>
>> false | true -> true
>> false | false -> false
>> false | anything -> anything
>>
>> ]]]
>>
>> ${slide:title=Boolean>> \| aBoolean}$
>>
>> [[[language=smalltalk
>> Boolean>> | aBoolean
>> "Evaluating disjunction (OR). Evaluate the argument. Answer true if
>> either the receiver or the argument is
>> true."
>> self subclassResponsibility
>> ]]]
>>
>> ${slide:title=False>> \| aBoolean}$
>>
>> [[[language=smalltalk
>> false | true -> true
>> false | false -> false
>> false | anything -> anything
>> ]]]
>>
>> [[[language=smalltalk
>> False >> | aBoolean
>> "Evaluating disjunction (OR) -- answer with the argument, aBoolean."
>> ^ aBoolean
>> ]]]
>>
>> ${slide:title=True>> \| aBoolean}$
>>
>> [[[language=smalltalk
>> true | true -> true
>> true | false -> true
>> true | anything -> true
>> ]]]
>>
>> [[[language=smalltalk
>> True>> | aBoolean
>> "Evaluating disjunction (OR) -- answer true since the receiver is true."
>> ^ self
>> ]]]
>>
>> ${slide:title=Or implementation in two methods}$
>>
>> +>file://figures/BooleanHiearchyAndInstancesWithOrMethods.png|width=80+
>>
>> ${slide:title=Implementing ifTrue\:ifFalse\:}$
>>
>> - Do you see the pattern?
>> - Remember that a closure freezes execution and that value launches
>> the execution of a frozen code.
>>
>> [[[language=smalltalk
>> True>>ifTrue: aTrueBlock ifFalse: aFalseBlock
>> ^ aTrueBlock value
>> ]]]
>>
>> [[[language=smalltalk
>> False>>ifTrue: aTrueBlock ifFalse: aFalseBlock
>> ^ aFalseBlock value
>> ]]]
>>
>> ${slide:title=Implementation Note}$
>>
>> - Note that the Virtual Machine shortcuts calls to boolean such as
>> condition for speed reason.
>> - But you can implement your own conditional method and debug to see
>> that sending a message is dispatching to the right object.
>>
>> ! So what ?
>>
>> ${toc:depthLevel=1|level=0|highlight=1}$
>>
>> ${slide:title=Ok so what?}$
>>
>> - You will probably not implement another Boolean classes
>> - So is it really that totally useless?
>>
>>
>> ${slide:title=Message sends act as case statements}$
>>
>> - The execution engine will select the right method in the class of the
>> receiver
>> - The case statements is dynamic in the sense that it depends on the
>> classes loaded and the objects to which the message is sent.
>> - Each time you send a message, the system will select the method
>> corresponding to the receiver.
>>
>>
>> ${slide:title=A Class Hierarchy is a Skeleton for Dynamic Dispatch}$
>>
>> - If we would have said that the ==Boolean== would be composed of only
>> one class, we could not have use dynamic binding.
>> - A class hierarchy is the exoskeleton for dynamic binding
>>
>> - Compare the solution with one class vs. a hierarchy.
>>
>> +One single class vs. a nice
>> hierarchy.>file://figures/Design-FatVsDispatch.png|width=70+
>>
>> - The hierarchy provides a way to specialize behavior.
>> - It is also more declarative in the sense that you only focus on one
>> class.
>> - It is more modular in the sense that you can package different
>> classes in different packages.
>>
>> ${slide:title=Avoid Conditionals}$
>>
>> - Use objects and messages, when you can
>> - The execution engine acts as a conditional switch: Use it!
>> - Check the AntiIfCampaign.
>>
>> ${slide:title=Follow-up: Implement ternary logic}$
>>
>> - Boolean: ==true==, ==false==, ==unknown==
>> +Ternaru Logic decision table
>>> file://figures/ArrayBoolean.png|width=30|label=fig:ternLogic+
>>
>> - Implementing in your own classes.
>>
>> ! Summary
>>
>> ${toc:depthLevel=1|level=0|highlight=1}$
>>
>> ${slide:title=Summary}$
>> - Tell, do not ask
>> - Let the receiver decide
>> - Message sends as potential dynamic conditional
>> - Class hiearchy builds a skeleton for dynamic dispatch
>> - Avoid conditional
>>
>>
>>
>>
>> -----------------------------------------
>> [4] Bloc
>> Load Bloc with executing in a playground (Pharo 6.1)
>>
>> Metacello new
>> baseline: 'Bloc';
>> repository: 'github://pharo-graphics/Bloc:pharo6.1/src';
>> load: #core
>>
>>
>> A tutorial to use bloc is available on
>> http://files.pharo.org/books/
>> Bloc Memory Game (alpha) is a first tutorial on Bloc the new graphics
>> core for Pharo. Booklet written by A. Chis, S. Ducasse, A. Syrel.
>>
>> http://files.pharo.org/books-pdfs/booklet-Bloc/2017-11-09-memorygame.pdf
>>
>> To load the memory game
>>
>> Metacello new
>> baseline: 'BlocTutorials';
>> repository: 'github://pharo-graphics/Tutorials/src';
>> load
>>
>>
>> A similar booklet could be done for the title
>> 'Doing a presentation / slide show / assitant with Bloc' (or similar,
>> adapt .....)
>>
>
--
www.tudorgirba.com
www.feenk.com
"Obvious things are difficult to teach."
Nov. 10, 2017
Re: [Pharo-users] FileReference basename of current dir
by Guillermo Polito
On Thu, Nov 9, 2017 at 10:12 PM, Norbert Hartl <norbert(a)hartl.name> wrote:
> is there a good explanation why
>
> âfooâ asFileReference parent basename
>
> gives â/â ?
>
I can only answer making one of the following assumtions
- You've launched your image doing a double click
- or by doing drag and drop on a vm
- or from the command line from the root '/' directory
In any of those three cases, the operating system will assign '/' as
working directory. Thus any file created from a relative path will be
relative to it.
Check also:
'fooâ asFileReference parent = FileSystem workingDirectory.
'fooâ asFileReference = FileSystem workingDirectory / 'foo'.
and:
'/â asFileReference = FileSystem workingDirectory.
--
Guille Polito
Research Engineer
Centre de Recherche en Informatique, Signal et Automatique de Lille
CRIStAL - UMR 9189
French National Center for Scientific Research - *http://www.cnrs.fr
<http://www.cnrs.fr>*
*Web:* *http://guillep.github.io* <http://guillep.github.io>
*Phone: *+33 06 52 70 66 13
Nov. 10, 2017
Re: [Pharo-users] Why does the test runner show red when I correct a test?
by Sean P. DeNigris
Richard Sargent wrote
> The only reliable conclusion one can make from such an interrupted run is
> whether it failed again. So, it would be possible to determine that the
> test should be coloured red, but it is impossible to *reliably* claim that
> the test should be coloured green.
What if we ran the test again as if from the browser/runner before setting
the icon?
-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Nov. 10, 2017
Re: [Pharo-users] perspective request for those earningalivingfromSmalltalk
by stephan
On 10-11-17 17:56, Prof. Andrew P. Black wrote:
>
>> On 6 Nov 2017, at 21:00 , Andrew Glynn <aglynn42(a)gmail.com> wrote:
>>
>> Btw, did Self ever work?
Self works fine. I played with it on a mac last year. I think Tobias
Pape released a new version last year or so.
Stephan
Nov. 10, 2017
Re: [Pharo-users] perspective request for those earningalivingfromSmalltalk
by Prof. Andrew P. Black
> On 6 Nov 2017, at 21:00 , Andrew Glynn <aglynn42(a)gmail.com> wrote:
>
> Btw, did Self ever work? At all? The last I remember it was in a similar state to Electron without the M$ adds in Visual Studio, i.e. the samples from the site donât build.
Self worked fine. It was a bit memory-hungry on the machines of the early 1990s, but I taught a class on OOP using it in about 1996 or 1997.
The NewtonScript language for the ill-fated Newton tablet was essentially Self. A bit ahead of its time â it would run fine in todayâs mobile phones.
Andrew Black
Nov. 10, 2017
Re: [Pharo-users] QCMagritte on Github
by stephan
On 10-11-17 15:59, laurent wrote:
> Now a QCMagritte image (vm 64) is built by Travis on each commit, see
>
> https://github.com/Afibre/QCMagritte/releases
>
> and
>
> https://travis-ci.org/Afibre/QCMagritte
Thanks, Laurent,
good to see progress being made.
Stephan
Nov. 10, 2017
Re: [Pharo-users] Why does the test runner show red when I correct a test?
by Richard Sargent
>
> I think it is correct because icon shows the last run state.
>
My claim is that is not a true statement.
Then it is up to user to check how test is working in normal way.
>
This is my point. You must do this or you cannot know.
The first statement should say "the last run state from the point of
interruption". Any changes made in the code after the interruption
invalidate your knowledge of the correctness of the code leading up to that
point.
The only reliable conclusion one can make from such an interrupted run is
whether it failed again. So, it would be possible to determine that the
test should be coloured red, but it is impossible to *reliably* claim that
the test should be coloured green.
Many people in our industry, our profession have a disturbing tendency to
be vague and practice self-deception. Take the concept of a "bug"as an
example. They don't "fly into" our code; we *put* them in it. *We* put them
in. That's why they should be called errors or defects.
Likewise, claiming that a test that failed run successfully and
uninterruptedly to completion "succeeded" is a fallacy. In general, the
test runner cannot make that claim. It lacks the knowledge to do so.
On Fri, Nov 10, 2017 at 1:21 AM, Denis Kudriashov <dionisiydk(a)gmail.com>
wrote:
> Hi Richard
>
> 2017-11-09 23:51 GMT+01:00 Richard Sargent <richard.sargent@
> gemtalksystems.com>:
>
>> I think it is correct to show green if you fix your problem in the
>>> debugger and then proceed and it passes all assertions. But it should
>>> equally fail if you proceed and it asserts false or craps out.
>>>
>>
>> It would be a lie. The truth is only that from that point on, it is
>> correct. You have no guarantee that your correction hasn't broken something
>> that would occur in the next run prior to the point at which you applied
>> the correction.
>>
>
> I think it is correct because icon shows the last run state. It is not
> depends on the way how user manages to pass or fail the test.
> So user can hack the test from the debugger and make it pass or fail using
> inspector, scripting or whatever interaction with available objects. When
> he closes the debugger (by proceed or window close) it is expected to see
> the result of this hacking in the UI. So test icon should be updated
> accordingly.
> Then it is up to user to check how test is working in normal way.
>
>
>>
>> Hence my assertion that you cannot determine the colour until the next
>> run.
>>
>
>
>
>>
>>
>> On Thu, Nov 9, 2017 at 2:47 PM, Tim Mackinnon <tim(a)testit.works> wrote:
>>
>>> Thanks Denis - I'll try my simple TDD test case in Pharo 7 (I haven't
>>> tried it yet - probably time to).
>>>
>>> I think it is correct to show green if you fix your problem in the
>>> debugger and then proceed and it passes all assertions. But it should
>>> equally fail if you proceed and it asserts false or craps out.
>>>
>>> Strange it would vary in 6.1 - but I'll check.
>>>
>>> Tim
>>>
>>> Sent from my iPhone
>>>
>>>
>>>
>>> Sent from my iPhone
>>> On 9 Nov 2017, at 19:54, Denis Kudriashov <dionisiydk(a)gmail.com> wrote:
>>>
>>> In Pharo 7 it works.
>>>
>>> 2017-11-09 18:29 GMT+01:00 Tim Mackinnon <tim(a)testit.works>:
>>>
>>>> Thanks for looking at this - there is an issue however - when you apply
>>>> that change (at least in a Pharo 6.1 image) - it shows green even when a
>>>> test fails? So I think its turned one problem into the opposite one.
>>>>
>>>> Unfortunately I havenât got a chance to look a bit deeper to help - but
>>>> it might be worth rolling back this change for now. We should fix it though
>>>> - and the answer must be in the area you have identified.
>>>>
>>>> tim
>>>>
>>>> On 9 Nov 2017, at 12:43, Denis Kudriashov <dionisiydk(a)gmail.com> wrote:
>>>>
>>>> And now it is in latest Pharo
>>>>
>>>> 2017-11-09 12:16 GMT+01:00 Denis Kudriashov <dionisiydk(a)gmail.com>:
>>>>
>>>>> Hi Tim.
>>>>>
>>>>> Fix is here 20661-Fixing-test-from-debugger-should-mark-test-as-gre
>>>>> en-when-proceed <https://github.com/pharo-project/pharo/pull/456> .
>>>>> Thank's for reporting. It forces me to fix. I always noticed it but
>>>>> never take it seriously :)
>>>>>
>>>>> 2017-11-09 11:32 GMT+01:00 Tim Mackinnon <tim(a)testit.works>:
>>>>>
>>>>>> Hi - I really like the build in test runner in the Pharo browsers,
>>>>>> and I was preparing a talk to show how great TDD is in Pharo and how we
>>>>>> arenât ashamed of our debugger when testing (it augments the experience in
>>>>>> fact - letting you poke around and get your thoughts straight).
>>>>>>
>>>>>> However - if I pick rerun in the test runner debugger - and step
>>>>>> through a test and then correct the failing code, and hit resume - the
>>>>>> browser always shows a red failure, even though the execution is now
>>>>>> correct. I have to run the test again.
>>>>>>
>>>>>> This doesnât seem right to me - are we missing a success event or
>>>>>> something?
>>>>>>
>>>>>>
>>>>>> Tim
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>
Nov. 10, 2017
Another example of invoking a REST/JSON web service - resolving User-Agent strings
by Sven Van Caekenberghe
In one of our web applications, when a user logs in, we give some meta/context information, like this:
You are user /users/4 in entity context /entities/0 for T3 using timezone Europe/Brussels [offset -1]
Last login Fri Nov 10 2017 15:15:46 from 80.89.7.35 using Safari 11 on Mac OS X 10
Your login count is 10,375
The last login info functions as a soft security measure. In it, the part after using, 'Safari 11 on Mac OS X 10', is computed from the (previous) User-Agent string of the web browser when the user last logged in. But these strings are quite complex. There exist web services that parse these complex user agent strings and extract all possible information out of them, including the high level description used above.
The previous solution stopped working and I configured a new one today [https://www.whatismybrowser.com] the core implementation of which I would like to share as yet another example.
(ZnClient new
systemPolicy;
url: 'https://api.whatismybrowser.com/api/v2/user_agent_parse';
accept: ZnMimeType applicationJson;
headerAt: 'x-api-key' put: '8cf7cee797f3c68d59055eac96778000';
contentReader: [ :entity | entity ifNotNil: [ NeoJSONObject fromString: entity contents ] ];
contentWriter: [ :object | ZnEntity json: object asString ];
contents: ({ 'user_agent' -> 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/604.3.5 (KHTML, like Gecko) Version/11.0.1 Safari/604.3.5' } as: NeoJSONObject);
post) parse at: 'simple_software_string'.
You have to create an account and insert your own API key. NeoJSON must be loaded.
Using #systemPolicy and #accept: makes this call throw an exception unless valid JSON is returned in a 2XX response. NeoJSONObject is a convenient way to use the NeoJSON infrastructure. The #parse message accesses the property by the same name (via a DNU), as does the #at: message (for keys that cannot be written as message sends).
Sven
Nov. 10, 2017
Re: [Pharo-users] Unable to load SmaCC on pharo6 (or pharo5)
by H. Hirzel
On 11/9/17, Federico.Balaguer <federico.balaguer(a)gmail.com> wrote:
> I would like to check if I need to use SmaCC for a project. I tried to
> install it on Pharo 6.1 32bits with iceberg but I was not able to do it.
>
> Then I tried to get SmaCC on an Pharo5
I just loaded SmaCC into a Pharo 5 - 32bit image. It worked fine.
Make sure that you have opened a Transcript window before loading
SmaCC through the catalog. This way you see if there are problems.
I loaded the 'stable' version and got on the Transcript what I copy in below.
--Hannes
ConfigurationOfSmaCC class>>updateSmalltalkhubSmaCC
(MCFileTreeGitRemoteRepository is Undeclared)
Loading 2.0.5.1 of ConfigurationOfSmaCC...
Fetched -> BaselineOfSmaCC-ThierryGoubier.8 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Loaded -> BaselineOfSmaCC-ThierryGoubier.8 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Project: SmaCC baseline
Fetched -> SmaCC-Source-Editing-ThierryGoubier.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-Runtime-ThierryGoubier.10 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-GLR-Runtime-ThierryGoubier.4 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-Development-ThierryGoubier.41 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-Development-UI-ThierryGoubier.31 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-Rewrite-Engine-ThierryGoubier.6 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-Smalltalk-Parser-ThierryGoubier.6 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-C-Parser-ThierryGoubier.5 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-CSV-ThierryGoubier.3 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-CSharp-ThierryGoubier.8 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-Cucumber-ThierryGoubier.9 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-Javascript-ThierryGoubier.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-Java-ThierryGoubier.9 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Fetched -> SmaCC-Python-ThierryGoubier.44 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1
Loaded -> SmaCC-Source-Editing-ThierryGoubier.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-Runtime-ThierryGoubier.10 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-GLR-Runtime-ThierryGoubier.4 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-Development-ThierryGoubier.41 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-Development-UI-ThierryGoubier.31 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-Rewrite-Engine-ThierryGoubier.6 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-Smalltalk-Parser-ThierryGoubier.6 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-C-Parser-ThierryGoubier.5 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-CSV-ThierryGoubier.3 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-CSharp-ThierryGoubier.8 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-Cucumber-ThierryGoubier.9 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-Javascript-ThierryGoubier.1 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-Java-ThierryGoubier.9 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
Loaded -> SmaCC-Python-ThierryGoubier.44 ---
github://ThierryGoubier/SmaCC:v2.0.5.1 --- cache
...finished 2.0.5.1
and Pharo6 images with "Catalog
> Browser" but I was not able to do it neither. The tool did pop up a message
> saying that Smacc was not tested for Pharo6 which was nice.
>
> Then I tried to clone the git repository to my local machine, I pointed
> iceberg to that local repository and then I loaded each package by hand. I
> was able to load BaselineOfSmaccBrowser but SmaCC-Rewrite-Engine failed to
> load with a debugger with a list of classes and methods that are missing
> (they are listed at the end of this message).
>
> Could some give an idea how to fix this?
>
> Thanks. Federico
>
>
> This package depends on the following classes:
> SmaCCStringInterval
> SmaCCParseNodeVisitor
> SmaCCScanner
> SmaCCParseNode
> SmaCCParser
> SmaCCString
> You must resolve these dependencies before you will be able to load these
> definitions:
> SmaCCAnnotatedString
> SmaCCAnnotatedString>>#addAnnotationTo:
> SmaCCAnnotatedString>>#intervalClass
> SmaCCAnnotatedString>>#newIntervalFor:
> SmaCCAnnotatedString>>#node
> SmaCCAnnotatedString>>#node:
> SmaCCAnnotatedString>>#removeInterval:
> SmaCCAnnotatedString>>#rule
> SmaCCAnnotatedString>>#rule:
> SmaCCAnnotatedStringInterval
> SmaCCAnnotatedStringInterval>>#addAllAnnotations:
> SmaCCAnnotatedStringInterval>>#addAnnotation:
> SmaCCAnnotatedStringInterval>>#annotations
> SmaCCAnnotatedStringInterval>>#annotations:
> SmaCCAnnotatedStringInterval>>#canBeMergedWith:
> SmaCCAnnotatedStringInterval>>#postCopy
> SmaCCCodeReplaceExpression
> SmaCCCodeReplaceExpression>>#acceptVisitor:
> SmaCCCodeReplaceExpression>>#code
> SmaCCCodeReplaceExpression>>#code:
> SmaCCCodeReplaceExpression>>#evaluateInContext:
> SmaCCCodeReplaceExpression>>#method
> SmaCCCodeReplaceExpression>>#tokenVariables
> SmaCCCompositeReplaceExpression
> SmaCCCompositeReplaceExpression>>#acceptVisitor:
> SmaCCCompositeReplaceExpression>>#compositeNodeVariables
> SmaCCCompositeReplaceExpression>>#evaluateInContext:
> SmaCCCompositeReplaceExpression>>#expressions
> SmaCCCompositeReplaceExpression>>#expressions:
> SmaCCCompositeReplaceExpression>>#initialize
> SmaCCNodeReplaceExpression
> SmaCCNodeReplaceExpression>>#acceptVisitor:
> SmaCCNodeReplaceExpression>>#addPostfixTo:inContext:
> SmaCCNodeReplaceExpression>>#addPrefixTo:inContext:
> SmaCCNodeReplaceExpression>>#afterPostfix
> SmaCCNodeReplaceExpression>>#afterPostfix:
> SmaCCNodeReplaceExpression>>#afterWhitespace
> SmaCCNodeReplaceExpression>>#afterWhitespace:
> SmaCCNodeReplaceExpression>>#beforePrefix
> SmaCCNodeReplaceExpression>>#beforePrefix:
> SmaCCNodeReplaceExpression>>#beforeWhitespace
> SmaCCNodeReplaceExpression>>#beforeWhitespace:
> SmaCCNodeReplaceExpression>>#evaluateInContext:
> SmaCCNodeReplaceExpression>>#name
> SmaCCNodeReplaceExpression>>#name:
> SmaCCNodeReplaceExpression>>#postfix
> SmaCCNodeReplaceExpression>>#postfix:
> SmaCCNodeReplaceExpression>>#prefix
> SmaCCNodeReplaceExpression>>#prefix:
> SmaCCNodeReplaceExpression>>#tokenVariables
> SmaCCReplaceExpression
> SmaCCReplaceExpression>>#acceptVisitor:
> SmaCCReplaceExpression>>#evaluateInContext:
> SmaCCReplaceExpressionParser
> SmaCCReplaceExpressionParser>>#cacheId
> SmaCCReplaceExpressionParser>>#definitionComment
> SmaCCReplaceExpressionParser>>#scannerClass
> SmaCCReplaceExpressionParser>>#startingStateForExpression
> SmaCCReplaceExpressionParser>>#reduceActionForCodeReplace1:
> SmaCCReplaceExpressionParser>>#reduceActionForExpression1:
> SmaCCReplaceExpressionParser>>#reduceActionForNodeReplace1:
> SmaCCReplaceExpressionParser>>#reduceActionForPostfixModifiers1:
> SmaCCReplaceExpressionParser>>#reduceActionForPrefixModifiers1:
> SmaCCReplaceExpressionParser>>#reduceActionForPrefixModifiers2:
> SmaCCReplaceExpressionParser>>#reduceActionForRewriteExpression3:
> SmaCCReplaceExpressionParser>>#reduceActionForRewriteExpressions1:
> SmaCCReplaceExpressionParser>>#reduceActionForRewriteExpressions2:
> SmaCCReplaceExpressionParser>>#reduceActionForStringReplace1:
> SmaCCReplaceExpressionParser>>#reduceActionForSwitchStateToCode1:
> SmaCCReplaceExpressionParser>>#reduceActionForSwitchStateToDefault1:
> SmaCCReplaceExpressionParser>>#reduceActionForSwitchStateToExpression1:
> SmaCCReplaceExpressionParser>>#reduceTable
> SmaCCReplaceExpressionParser>>#symbolNames
> SmaCCReplaceExpressionParser>>#symbolTypes
> SmaCCReplaceExpressionParser>>#transitionTable
> SmaCCReplaceExpressionScanner
> SmaCCReplaceExpressionScanner>>#codeExpressionId
> SmaCCReplaceExpressionScanner>>#emptySymbolTokenId
> SmaCCReplaceExpressionScanner>>#errorTokenId
> SmaCCReplaceExpressionScanner>>#isValidCode
> SmaCCReplaceExpressionScanner>>#next
> SmaCCReplaceExpressionScanner>>#scanCode
> SmaCCReplaceExpressionScanner>>#scanForToken
> SmaCCReplaceExpressionScanner>>#scanForTokenX1
> SmaCCReplaceExpressionVisitor
> SmaCCReplaceExpressionVisitor>>#visitCodeReplace:
> SmaCCReplaceExpressionVisitor>>#visitCompositeReplace:
> SmaCCReplaceExpressionVisitor>>#visitNodeReplace:
> SmaCCReplaceExpressionVisitor>>#visitReplace:
> SmaCCReplaceExpressionVisitor>>#visitStringReplace:
> SmaCCRewriteRuleFileParser
> SmaCCRewriteRuleFileParser>>#cacheId
> SmaCCRewriteRuleFileParser>>#definitionComment
> SmaCCRewriteRuleFileParser>>#fileExtension
> SmaCCRewriteRuleFileParser>>#fileExtensionType
> SmaCCRewriteRuleFileParser>>#parseFile:
> SmaCCRewriteRuleFileParser>>#scannerClass
> SmaCCRewriteRuleFileParser>>#startingStateForFile
> SmaCCRewriteRuleFileParser>>#filename:
> SmaCCRewriteRuleFileParser>>#lookupClass:
> SmaCCRewriteRuleFileParser>>#reduceActionForComment2:
> SmaCCRewriteRuleFileParser>>#reduceActionForFile1:
> SmaCCRewriteRuleFileParser>>#reduceActionForImport1:
> SmaCCRewriteRuleFileParser>>#reduceActionForMatch1:
> SmaCCRewriteRuleFileParser>>#reduceActionForMatch2:
> SmaCCRewriteRuleFileParser>>#reduceActionForMatch3:
> SmaCCRewriteRuleFileParser>>#reduceActionForMatch4:
> SmaCCRewriteRuleFileParser>>#reduceActionForParserClass1:
> SmaCCRewriteRuleFileParser>>#reduceActionForRule1:
> SmaCCRewriteRuleFileParser>>#reduceActionForRule2:
> SmaCCRewriteRuleFileParser>>#reduceActionForRule3:
> SmaCCRewriteRuleFileParser>>#reduceActionForRules1:
> SmaCCRewriteRuleFileParser>>#reduceActionForRules2:
> SmaCCRewriteRuleFileParser>>#reduceActionForRules3:
> SmaCCRewriteRuleFileParser>>#reduceActionForRules4:
> SmaCCRewriteRuleFileParser>>#reduceActionForStartSmalltalkExpression1:
> SmaCCRewriteRuleFileParser>>#reduceActionForStartStringExpression1:
> SmaCCRewriteRuleFileParser>>#reduceActionForTransformation1:
> SmaCCRewriteRuleFileParser>>#reduceActionForTransformation2:
> SmaCCRewriteRuleFileParser>>#reduceActionForVariable1:
> SmaCCRewriteRuleFileParser>>#reduceActionForVariable2:
> SmaCCRewriteRuleFileParser>>#reduceActionForVariableList1:
> SmaCCRewriteRuleFileParser>>#reduceActionForVariableList2:
> SmaCCRewriteRuleFileParser>>#reduceTable
> SmaCCRewriteRuleFileParser>>#scanSmalltalkExpression
> SmaCCRewriteRuleFileParser>>#scanStringExpression
> SmaCCRewriteRuleFileParser>>#symbolNames
> SmaCCRewriteRuleFileParser>>#transitionTable
> SmaCCRewriteRuleFileParser>>#tryAllTokens
> SmaCCRewriteRuleFileScanner
> SmaCCRewriteRuleFileScanner>>#initializeKeywordMap
> SmaCCRewriteRuleFileScanner>>#rewriter
> SmaCCRewriteRuleFileScanner>>#rewriter:
> SmaCCRewriteRuleFileScanner>>#emptySymbolTokenId
> SmaCCRewriteRuleFileScanner>>#errorTokenId
> SmaCCRewriteRuleFileScanner>>#fixExpression:
> SmaCCRewriteRuleFileScanner>>#isValidSmalltalk:
> SmaCCRewriteRuleFileScanner>>#scan1
> SmaCCRewriteRuleFileScanner>>#scan2
> SmaCCRewriteRuleFileScanner>>#scan3
> SmaCCRewriteRuleFileScanner>>#scan4
> SmaCCRewriteRuleFileScanner>>#scanForToken
> SmaCCRewriteRuleFileScanner>>#scanForTokenX1
> SmaCCRewriteRuleFileScanner>>#scanForTokenX2
> SmaCCRewriteRuleFileScanner>>#scanForTokenX3
> SmaCCRewriteRuleFileScanner>>#scanForTokenX4
> SmaCCRewriteRuleFileScanner>>#scanForTokenX5
> SmaCCRewriteRuleFileScanner>>#scanForTokenX6
> SmaCCRewriteRuleFileScanner>>#scanForTokenX7
> SmaCCRewriteRuleFileScanner>>#scanSmalltalkExpression
> SmaCCRewriteRuleFileScanner>>#scanStringExpression
> SmaCCRewriteRuleFileScanner>>#tokenActions
> SmaCCStringReplaceExpression
> SmaCCStringReplaceExpression>>#acceptVisitor:
> SmaCCStringReplaceExpression>>#evaluateInContext:
> SmaCCStringReplaceExpression>>#string
> SmaCCStringReplaceExpression>>#string:
> SmaCCStringReplaceExpression>>#tokenVariables
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>
Nov. 10, 2017