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 atest?
by Richard Sargent
Exactly!
And don't let the words I write convince you I am immune to the same
failings. Far from it! But, I try. :-)
On Fri, Nov 10, 2017 at 10:49 AM, Andrew Glynn <aglynn42(a)gmail.com> wrote:
> Love this:
>
>
>
> â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.â
>
>
>
> Or, sometimes, âlazy stupidityâ (particularly in my case). And in many
> others âdonât really know what Iâm doing, really, so I copied/pasted a
> bunch of code off random websites until it âsorta/kindaâ worked.â
>
>
>
> The worst is that Iâve had a number of team leads and architects on
> projects for whom the last is the most accurate.
>
>
>
> Andrew
>
Nov. 10, 2017
Re: [Pharo-users] Why does the test runner show red when I correct atest?
by Andrew Glynn
Love this:
â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.â
Or, sometimes, âlazy stupidityâ (particularly in my case). And in many others âdonât really know what Iâm doing, really, so I copied/pasted a bunch of code off random websites until it âsorta/kindaâ worked.â
The worst is that Iâve had a number of team leads and architects on projects for whom the last is the most accurate.
Andrew
Nov. 10, 2017
Re: [Pharo-users] Why does the test runner show red when I correct a test?
by Kjell Godo
On Fri, Nov 10, 2017 at 08:12 Richard Sargent <
richard.sargent(a)gemtalksystems.com> wrote:
> 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.
>
+1
>
> 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(a)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-green-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
Re: [Pharo-users] QCMagritte on Github
by Andrew Glynn
YAML is what it says, lol.
I still prefer using SGML and outputting whatever markup I need, although I have to use US army software (that only works on Windows) to do it since Adobe gouges for FrameMaker.
Probably a long lasting hangover from working for IBM years ago. Sure was a headache, so a hangover isnât that surprising.
Looking for the latest version of that software for a new Win 10 install I came across one of the best quotes on Windows, especially considering the source, though the quote mustâve been written about an old version.
âWith luck, this will start Windows, and a dialogue box will appear and tell you the default drive into which IADS will be installed (C:).
If Windows doesn't start up, you could always try launching Windows manually.â
Andrew
From: Stephane Ducasse
Sent: Friday, November 10, 2017 1:21 PM
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] QCMagritte on Github
For your information.
We got some problem with travis (what a bad idea to have a syntax like
yaml - our industry is looping , even xml is better).
we spent more than 30 min trying with Guille and Andrew to use bash in
a script section (while this is working in some guille project)
it does not in other just because yaml does not know who to find the
end of a line....
Terrible!
Stef
On Wed, Nov 8, 2017 at 8:15 AM, stephan <stephan(a)stack.nl> wrote:
> On 27-10-17 12:39, laurent laffont wrote:
>>
>> Hi,
>>
>> my team starts to use QCMagritte. For our needs we have imported
>> SmalltalkHub repository to Github here:
>> https://github.com/Afibre/QCMagritte
>>
>> I don't know if you (Diego, Stephan, Tobias) plan to use Github
>> instead of SmalltalkHub. At least Github allows branches & pull
>> request.
>
>
> Definitely, and I'm still struggling a bit with Iceberg. I would definitely
> favor a setup where the whole open source part is build on each commit using
> travis and images are put on (e.g.) bitbucket.
> The current jenkins builds are waiting for Diego to finish some changes, and
> he is a bit distracted with plans for a new house.
>
> Tobias told me he's also interested, so I assume he'll provide a modified
> baseline for other platforms.
>
> At a certain point we might want to fold all of QCMagritte back into
> Magritte, but that is a discussion for later I think.
>
> Stephan
>
>
Nov. 10, 2017
Re: [Pharo-users] Adding an Iceberg repository at startup
by Mariano Martinez Peck
Thanks guys. I ended up doing this:
StartupPreferencesLoader default executeAtomicItems: {
StartupAction
name: '02 Iceberg'
code: [
| repo |
IceCredentialsProvider default sshCredentials
username: 'git';
publicKey: '/Users/mariano/.ssh/id_rsa_github.pub';
privateKey: '/Users/mariano/.ssh/id_rsa_github';
keyPassphrase: 'YYY'.
IceCredentialsProvider default plaintextCredentials
username: 'marianopeck(a)gmail.com';
password: 'XXX'.
Iceberg enableMetacelloIntegration: true.
IceRepository
shareRepositoriesBetweenImages: true;
sharedRepositoriesLocationString: '/Users/mariano/Pharo/git'.
Iceberg showSystemRepositories: false.
repo := IceRepositoryCreator new
location:
'/Users/mariano/pharo61/pharo-local/iceberg/marianopeck/OSSubprocess'
asFileReference;
subdirectory: 'repository';
createRepository.
repo register.
"more registrations here"
]
runOnce: true.
}.
On Fri, Nov 10, 2017 at 10:11 AM, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
> You can create repositories programatically.
>
> repo := IceRepositoryCreator new
> location: '/home/user/.../';
> subdirectory: 'codeSubdirectory';
> createRepository.
> repo register.
>
>
> On Fri, Nov 10, 2017 at 1:11 PM, Mariano Martinez Peck <
> marianopeck(a)gmail.com> wrote:
>
>> I would also like that :)
>>
>> On Fri, Nov 10, 2017 at 6:45 AM, Prof. Andrew P. Black <black(a)cs.pdx.edu>
>> wrote:
>>
>>> I would like to have the git repositories that Iâm working from
>>> automatically added to the list of known repositories in Iceberg at startup
>>> time. In other words, I don;t want to have to do a bunch of âAdd local
>>> repositoryâ commands before I can start work.
>>>
>>> What magic can I put in my settings.st file to make this happen?
>>>
>>> Andrew
>>>
>>>
>>>
>>
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>>
>
>
--
Mariano
http://marianopeck.wordpress.com
Nov. 10, 2017
Re: [Pharo-users] Another example of invoking a REST/JSON web service - resolving User-Agent strings
by Stephane Ducasse
Hi sven
I love this. With Guille we are thinking that it would be cool to have blog
entries on Pharo how to do.
And this post could be the first one.
Stef
On Fri, Nov 10, 2017 at 4:43 PM, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
> 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] QCMagritte on Github
by Stephane Ducasse
For your information.
We got some problem with travis (what a bad idea to have a syntax like
yaml - our industry is looping , even xml is better).
we spent more than 30 min trying with Guille and Andrew to use bash in
a script section (while this is working in some guille project)
it does not in other just because yaml does not know who to find the
end of a line....
Terrible!
Stef
On Wed, Nov 8, 2017 at 8:15 AM, stephan <stephan(a)stack.nl> wrote:
> On 27-10-17 12:39, laurent laffont wrote:
>>
>> Hi,
>>
>> my team starts to use QCMagritte. For our needs we have imported
>> SmalltalkHub repository to Github here:
>> https://github.com/Afibre/QCMagritte
>>
>> I don't know if you (Diego, Stephan, Tobias) plan to use Github
>> instead of SmalltalkHub. At least Github allows branches & pull
>> request.
>
>
> Definitely, and I'm still struggling a bit with Iceberg. I would definitely
> favor a setup where the whole open source part is build on each commit using
> travis and images are put on (e.g.) bitbucket.
> The current jenkins builds are waiting for Diego to finish some changes, and
> he is a bit distracted with plans for a new house.
>
> Tobias told me he's also interested, so I assume he'll provide a modified
> baseline for other platforms.
>
> At a certain point we might want to fold all of QCMagritte back into
> Magritte, but that is a discussion for later I think.
>
> Stephan
>
>
Nov. 10, 2017
Re: [Pharo-users] perspective request for thoseearningalivingfromSmalltalk
by Andrew Glynn
Yea, I tried a really early version and it slipped my mind to ever get back to it â I did use NewtonScript a bit â I was one of the few that liked the Newton, probably because I hate talking on the phone, lol. It was pretty good on the last release of the Newton. I still have it somewhere but I put it in a box in my last move and havenât come across it again. I like the iPhone ok, but I rarely answer calls, I use it as anything but a phone.
Planning to run up a version if I can get one that will run on Solaris 11, or at least I can rebuild the VM for it â I have a couple of T2000âs and a couple of T5120âs â 64 threads and 64GB RAM should be plenty ð. Right now a bit short of time for just playing though.
Andrew Glynn
Sent from Mail for Windows 10
From: Prof. Andrew P. Black
Sent: Friday, November 10, 2017 11:57 AM
To: Any question about pharo is welcome
Subject: Re: [Pharo-users] perspective request for thoseearningalivingfromSmalltalk
> 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] Unable to load SmaCC on pharo6 (or pharo5)
by Stephane Ducasse
Hi thierry
we are working and soon we will have a much simpler installation and
everything :)
Now just commit and I will check and fix :)
Stef
On Fri, Nov 10, 2017 at 6:47 AM, Thierry Goubier
<thierry.goubier(a)gmail.com> wrote:
> Le 09/11/2017 à 21:02, Stephane Ducasse a écrit :
>>
>> Yes thierry :) your turn now :)
>
>
> That's will be harder than I expected. I have issues in the LaTeX setup used
> by the booklet.
>
> Thierry
>
>
>>
>> Stef
>>
>> On Thu, Nov 9, 2017 at 8:41 PM, Thierry Goubier
>> <thierry.goubier(a)gmail.com> wrote:
>>>
>>> Le 09/11/2017 à 20:15, Federico.Balaguer a écrit :
>>>>
>>>>
>>>> I am following this tutorial
>>>>
>>>>
>>>>
>>>> http://files.pharo.org/books-pdfs/booklet-Smacc/2017-05-05-Smacc-Spiral.pdf
>>>>
>>>> I typed the first example and when I try to compile either LR(1) or
>>>> LALR(1)
>>>> there is a pop-up saying that both clases where not specified. I also
>>>> tried
>>>> adding the classes for the scanner and parser manually but I got the
>>>> result.
>>>
>>>
>>>
>>> Yes. I changed the GUI and that means I need to update the booklet.
>>>
>>> This part:
>>>
>>> ⢠Edit the definition the pane below the compile LR(1) buttons.
>>> ⢠Once you are done:
>>> â Click on the Scanner class and type ExpressionScanner.
>>> â Click on the Parser class and type ExpressionParser.
>>> ⢠press either Compiler LR(1) or Compiled LALR(1) buttons.
>>>
>>> Should now be:
>>>
>>> ⢠Edit the definition the pane below the compile LR(1) buttons.
>>> ⢠Once you are done:
>>> â Type ExpressionParser and return in the text field left of Parser:.
>>> ⢠press either Compiler LR(1) or Compiled LALR(1) buttons.
>>>
>>>> There are a couple other things in the tutorial at the very start that
>>>> didn't add up. I can send an annotated pdf if that is of any help
>>>
>>>
>>>
>>> Yes, that would be very helpfull!
>>>
>>> Thanks,
>>>
>>> Thierry
>>>
>>>
>>>>
>>>> Thanks!!
>>>>
>>>> Federico
>>>>
>>>>
>>>>
>>>> --
>>>> 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 Stephane Ducasse
Ok let know.
Guille worked the complete week on pillar (mainly archetype and the
outputer part) and made **giant** steps.
He removed most of the need for using make and we will do another
cleaning first but first
release Pharo 7.0.0 and its documentation.
After we will remove magritte.
Stef
On Fri, Nov 10, 2017 at 11:33 AM, 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 .....)
>
Nov. 10, 2017