Pharo-dev
By thread
pharo-dev@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
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
October 2016
- 611 messages
Re: [Pharo-dev] How do recover change with epicea?
by stepharo
super cool
I love such mail :)
Le 2/10/16 à 00:39, Martin Dias a écrit :
> I'm back!
>
>
> Thanks for your feedback. I also didn't like the names... I was
> experimenting with new names that communicate better tools' meaning.
> In the middle of this experimentation I had release 8.0.2 with bug
> fixes, and those experimental names became public. Then, in this
> thread I understood that what was missing is explaining (or improving)
> the logs (ombu files) model... not finding super tool names.
>
>
> The new version of Epicea is waiting for integration:
>
> https://pharo.fogbugz.com/f/cases/19165/Integrate-Epicea-8-0-3
>
>
>
> This version has the tool names proposed by Norbert and agreed by
> Stef, reported as:
>
> https://pharo.fogbugz.com/f/cases/19163/Improve-Epicea-tool-names
>
>
> and has a CustomHelp with the high-level documentation as proposed by
> Sven, reported in:
>
> https://pharo.fogbugz.com/f/cases/19164/Add-help-to-Epicea-project
>
>
> I also added "fly by help" in some buttons and didn't had an
> explanation yet. Stef, I didn't investigate if menu entries can have
> fly by help.
>
>
> The next Epicea version should have some improvement on this issue:
>
> https://pharo.fogbugz.com/f/cases/edit/19125/Epicea-Log-writing-is-very-slow
>
>
>
>
> Cheers
> Martin
>
>
> On Thu, Sep 22, 2016 at 2:25 PM, stepharo <stepharo(a)free.fr
> <mailto:stepharo@free.fr>> wrote:
>
> :)
>
> I'm trying to remember if we have fly by help on menu item because
> this descriptions would fit nicely there.
>
> Martin the names proposed by Norbert are cool.
>
>
> Stef
>
>
> Le 21/9/16 à 13:00, Sven Van Caekenberghe a écrit :
>
> Thank you for this clear explanation, Martin. People will
> always have trouble using any tool/UI if they do not
> understand the underlying model. It helped me. Needless to
> say, such high level documentation needs to go somewhere.
>
> On 21 Sep 2016, at 06:50, Martin Dias
> <tinchodias(a)gmail.com <mailto:tinchodias@gmail.com>> wrote:
>
> Hi Stef, âNo idea why Epicea didn't log your changes.
>
> About "monitor vs. log set"... the two new entries in
> World Menu > Tools > Epicea... I'd like user opinions to
> improve naming and UI. I can tell some things introduced
> in the latest integration.
>
> - The Log Set
> As you know, Epicea Monitor logs code changes (and some
> IDE events such as MC load/save and refactorings). Such
> data is placed in .ombu files in a local directory. Each
> time a Pharo image opens, Epicea Monitor logs code changes
> into a new ombu file. Those ombu files in the local
> directory is what is currently called "Log Set".
>
> - The Monitor UI shows the code changes since Epicea
> started to log.
> ===> This means it shows changes placed in potentially
> several ombu files.
>
> - The Log Set UI shows:
> -- all the logs in the local directory on the left panel, and
> -- the content of the selected log in the right panel.
> ===> This UI visually connects the logs to help user to
> understand how the ombu files are related. Note that the
> code changes displayed on the right panel belong to only
> one log (different than in the Monitor UI, that might show
> changes in several logs).
>
> Cheers,
> Martin
>
> On Tue, Sep 20, 2016 at 4:57 PM, stepharo
> <stepharo(a)free.fr <mailto:stepharo@free.fr>> wrote:
> even better
>
> Smalltalk tools changeList browseRecentLog
>
> does not show any changes :)
>
> So I redownloaded the latest version of tried
>
> - changes something
>
> - exist without saving
>
> - reopening the image
>
> And I could not reproduce the bug.... Shit.
>
> So I lost my time.
>
> Stef
>
>
>
>
>
> Hi
>
> i introduced a loop (yes totally stupid) in menu morph icon :)
> so I had to quit my image.
> I thought that epicea would show me all the changes and I
> could not find how to do it.
> I do not know how to invoke the old recover lost
> changes... so so far I lost 40 min of dev :(
>
> I have no idea what is monitor vs log set in Epicea.
> And log set is just with the changes I'm doing :( not the
> ones I lost :(
>
> In cutting alpha image it would be good to make sure that
> we cannot lose our work :(
> Stef
>
>
>
>
>
>
> <epiceaLogSet.jpg>
>
>
>
>
>
Oct. 2, 2016
Re: [Pharo-dev] New to Pharo; a bunch of questions.
by stepharo
You see Pharo as a file syntax too.
You did all that because you do not like you use the code browser but
you should try it.
because coding in the playground for now does not really scales.
Le 1/10/16 à 22:39, CodeDmitry a écrit :
> Ok I got the proof of concept down, but I can't get it all to run at once
> since Pharo realizes that the class does not exist(at the time of running),
> even though it will exist by the time it gets to that line.
>
> Is there a way to modify the following Transcript code make the following
> code run "at once". Ignoring the fact that classes are not created at time
> of writing?
>
> ([
> SimpleSwitchMorph subclass: #LOCell
> instanceVariableNames: 'mouseAction'
> classVariableNames: ''
> package: 'PBE-LightsOut'
> ] value).
>
> ([
> BorderedMorph subclass: #LOGame
> instanceVariableNames: 'cells'
> classVariableNames: ''
> package: 'PBE-LightsOut'
> ] value).
>
> ([
> LOCell compile:
> 'mouseAction: a', (String cr),
> ' ^ mouseAction := a'.
> ] value).
>
> ([
> LOCell compile:
> 'mouseUp: e', (String cr),
> ' mouseAction value'
> ] value).
>
> ([
> LOCell compile:
> 'initialize', (String cr),
> ' super initialize.', (String cr),
> ' self label: ''''.', (String cr),
> ' self borderWidth: 2.', (String cr),
> ' bounds := (0@0) corner: (16@16).', (String cr),
> ' offColor := Color paleYellow.', (String cr),
> ' onColor := Color paleBlue darker.', (String cr),
> ' self useSquareCorners.', (String cr),
> ' self turnOff.'
> ] value).
>
> ([
> LOGame compile:
> 'cellsPerSide', (String cr),
> ' ^10'
> ] value).
>
> ([
> LOGame compile:
> 'toggleNeighboursOfCellAt: i at: j', (String cr),
> ' (i > 1) ifTrue: [', (String cr),
> ' (cells at: i - 1 at: j) toggleState.', (String cr),
> ' ].', (String cr),
> (String cr),
> ' (i < self cellsPerSide) ifTrue: [', (String cr),
> ' (cells at: i + 1 at: j) toggleState.', (String cr),
> ' ].', (String cr),
> (String cr),
> ' (j > 1) ifTrue: [', (String cr),
> ' (cells at: i at: j - 1) toggleState.', (String cr),
> ' ].', (String cr),
> (String cr),
> ' (j < self cellsPerSide) ifTrue: [', (String cr),
> ' (cells at: i at: j + 1) toggleState.', (String cr),
> ' ].'
> ] value).
>
> ([
> LOGame compile:
> 'newCellAt: i at: j', (String cr),
> ' | c origin | ', (String cr),
> (String cr),
> ' c := LOCell new.', (String cr),
> ' origin := self innerBounds origin.', (String cr),
> (String cr),
> ' self addMorph: c.', (String cr),
> ' ', (String cr),
> ' c position: ([', (String cr),
> ' | x_index y_index c_width c_height |', (String cr),
> (String cr),
> ' x_index := i - 1.', (String cr),
> ' y_index := j - 1.', (String cr),
> ' c_width := c width.', (String cr),
> ' c_height := c height.', (String cr),
> ' ', (String cr),
> ' (x_index * c_width)@(y_index * c_height) + origin', (String
> cr),
> ' ] value).', (String cr),
> (String cr),
> ' c mouseAction: [', (String cr),
> ' self toggleNeighboursOfCellAt: i at: j.', (String cr),
> ' ].', (String cr),
> ' ^ c.', (String cr)
> ] value).
>
> ([
> LOGame compile:
> 'initialize', (String cr),
> ' | sampleCell width height n |', (String cr),
> (String cr),
> ' super initialize.', (String cr),
> ' n := self cellsPerSide.', (String cr),
> (String cr),
> ' sampleCell := LOCell new.', (String cr),
> ' width := sampleCell width.', (String cr),
> ' height := sampleCell height.', (String cr),
> (String cr),
> ' self bounds: ', (String cr),
> ' ((5@5) extent:', (String cr),
> ' (width * n)@(height * n) + ', (String cr),
> ' (2 * (self borderWidth))).', (String cr),
> (String cr),
> ' cells := Matrix new: n tabulate: [:i :j |', (String cr),
> ' self newCellAt: i at: j.', (String cr),
> ' ].'
> ] value).
>
>
>
>
> --
> View this message in context: http://forum.world.st/New-to-Pharo-a-bunch-of-questions-tp4917701p4917707.h…
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>
>
Oct. 2, 2016
Re: [Pharo-dev] New to Pharo; a bunch of questions.
by stepharo
But why do you want that? Why do you want to code everything in the
playground?
Le 1/10/16 à 21:58, CodeDmitry a écrit :
> Thanks Peter! I admit I couldnt really dynamically add methods to a class at
> runtime since I was doing it as follows:
>
> ([
> (LOCell class) methodDict
> at: #mouseAction
> put: ((LOCell class) compile:
> mouseAction: a
> ^ mouseAction := a
> ).
> ] value).
>
> Which caused constant harassment by Pharo until I typed:
>
> (LOCell class) removeAllKeys.
>
> or
>
> (LOCell class) removeKey: #mouseAction.
>
> I'll try your method in a bit to see if it works better.
But you are using black magic incantation instead of using the class browser
So do not complain if you shoot in your feet in the future.
I would not code like that because you will just get frustrated and you
will
think pharo is bad while we are all using hyper fast and safe and we
keep black magic
for the place we want it.
Stef
>
>
>
>
>
> --
> View this message in context: http://forum.world.st/New-to-Pharo-a-bunch-of-questions-tp4917701p4917706.h…
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>
>
Oct. 2, 2016
Re: [Pharo-dev] How do recover change with epicea?
by Martin Dias
I'm back!
Thanks for your feedback. I also didn't like the names... I was
experimenting with new names that communicate better tools' meaning. In the
middle of this experimentation I had release 8.0.2 with bug fixes, and
those experimental names became public. Then, in this thread I understood
that what was missing is explaining (or improving) the logs (ombu files)
model... not finding super tool names.
The new version of Epicea is waiting for integration:
https://pharo.fogbugz.com/f/cases/19165/Integrate-Epicea-8-0-3
This version has the tool names proposed by Norbert and agreed by Stef,
reported as:
https://pharo.fogbugz.com/f/cases/19163/Improve-Epicea-tool-names
and has a CustomHelp with the high-level documentation as proposed by Sven,
reported in:
https://pharo.fogbugz.com/f/cases/19164/Add-help-to-Epicea-project
I also added "fly by help" in some buttons and didn't had an explanation
yet. Stef, I didn't investigate if menu entries can have fly by help.
The next Epicea version should have some improvement on this issue:
https://pharo.fogbugz.com/f/cases/edit/19125/Epicea-Log-writing-is-very-slow
Cheers
Martin
On Thu, Sep 22, 2016 at 2:25 PM, stepharo <stepharo(a)free.fr> wrote:
> :)
>
> I'm trying to remember if we have fly by help on menu item because this
> descriptions would fit nicely there.
>
> Martin the names proposed by Norbert are cool.
>
>
> Stef
>
>
> Le 21/9/16 à 13:00, Sven Van Caekenberghe a écrit :
>
> Thank you for this clear explanation, Martin. People will always have
>> trouble using any tool/UI if they do not understand the underlying model.
>> It helped me. Needless to say, such high level documentation needs to go
>> somewhere.
>>
>> On 21 Sep 2016, at 06:50, Martin Dias <tinchodias(a)gmail.com> wrote:
>>>
>>> Hi Stef, âNo idea why Epicea didn't log your changes.
>>>
>>> About "monitor vs. log set"... the two new entries in World Menu > Tools
>>> > Epicea... I'd like user opinions to improve naming and UI. I can tell
>>> some things introduced in the latest integration.
>>>
>>> - The Log Set
>>> As you know, Epicea Monitor logs code changes (and some IDE events such
>>> as MC load/save and refactorings). Such data is placed in .ombu files in a
>>> local directory. Each time a Pharo image opens, Epicea Monitor logs code
>>> changes into a new ombu file. Those ombu files in the local directory is
>>> what is currently called "Log Set".
>>>
>>> - The Monitor UI shows the code changes since Epicea started to log.
>>> ===> This means it shows changes placed in potentially several ombu
>>> files.
>>>
>>> - The Log Set UI shows:
>>> -- all the logs in the local directory on the left panel, and
>>> -- the content of the selected log in the right panel.
>>> ===> This UI visually connects the logs to help user to understand how
>>> the ombu files are related. Note that the code changes displayed on the
>>> right panel belong to only one log (different than in the Monitor UI, that
>>> might show changes in several logs).
>>>
>>> Cheers,
>>> Martin
>>>
>>> On Tue, Sep 20, 2016 at 4:57 PM, stepharo <stepharo(a)free.fr> wrote:
>>> even better
>>>
>>> Smalltalk tools changeList browseRecentLog
>>>
>>> does not show any changes :)
>>>
>>> So I redownloaded the latest version of tried
>>>
>>> - changes something
>>>
>>> - exist without saving
>>>
>>> - reopening the image
>>>
>>> And I could not reproduce the bug.... Shit.
>>>
>>> So I lost my time.
>>>
>>> Stef
>>>
>>>
>>>
>>>
>>>
>>> Hi
>>>
>>> i introduced a loop (yes totally stupid) in menu morph icon :)
>>> so I had to quit my image.
>>> I thought that epicea would show me all the changes and I could not find
>>> how to do it.
>>> I do not know how to invoke the old recover lost changes... so so far I
>>> lost 40 min of dev :(
>>>
>>> I have no idea what is monitor vs log set in Epicea.
>>> And log set is just with the changes I'm doing :( not the ones I lost :(
>>>
>>> In cutting alpha image it would be good to make sure that we cannot lose
>>> our work :(
>>> Stef
>>>
>>>
>>>
>>>
>>>
>>>
>>> <epiceaLogSet.jpg>
>>>
>>
>>
>
>
Oct. 1, 2016
Re: [Pharo-dev] New to Pharo; a bunch of questions.
by CodeDmitry
Complete proof of concept(all I needed was Smalltalk classNamed: x) to
reflect the class at runtime so that the playground script doesn't get
confused since the classes don't exist before script is evaluated.
([
"create the classes."
([
SimpleSwitchMorph subclass: #LOCell
instanceVariableNames: 'mouseAction'
classVariableNames: ''
package: 'PBE-LightsOut'.
BorderedMorph subclass: #LOGame
instanceVariableNames: 'cells'
classVariableNames: ''
package: 'PBE-LightsOut'.
] value).
"create LOCell methods."
([:this |
this compile:
'mouseAction: a', (String cr),
' ^ mouseAction := a'.
this compile:
'mouseUp: e', (String cr),
' mouseAction value'.
this compile:
'initialize', (String cr),
' super initialize.', (String cr),
' self label: ''''.', (String cr),
' self borderWidth: 2.', (String cr),
' bounds := (0@0) corner: (16@16).', (String cr),
' offColor := Color paleYellow.', (String cr),
' onColor := Color paleBlue darker.', (String cr),
' self useSquareCorners.', (String cr),
' self turnOff.'.
] value: (Smalltalk classNamed: 'LOCell')).
([:this |
this compile:
'cellsPerSide', (String cr),
' ^10'.
this compile:
'toggleNeighboursOfCellAt: i at: j', (String cr),
' (i > 1) ifTrue: [', (String cr),
' (cells at: i - 1 at: j) toggleState.', (String cr),
' ].', (String cr),
(String cr),
' (i < self cellsPerSide) ifTrue: [', (String cr),
' (cells at: i + 1 at: j) toggleState.', (String cr),
' ].', (String cr),
(String cr),
' (j > 1) ifTrue: [', (String cr),
' (cells at: i at: j - 1) toggleState.', (String cr),
' ].', (String cr),
(String cr),
' (j < self cellsPerSide) ifTrue: [', (String cr),
' (cells at: i at: j + 1) toggleState.', (String cr),
' ].'.
this compile:
'newCellAt: i at: j', (String cr),
' | c origin | ', (String cr),
(String cr),
' c := LOCell new.', (String cr),
' origin := self innerBounds origin.', (String cr),
(String cr),
' self addMorph: c.', (String cr),
' ', (String cr),
' c position: ([', (String cr),
' | x_index y_index c_width c_height |', (String cr),
(String cr),
' x_index := i - 1.', (String cr),
' y_index := j - 1.', (String cr),
' c_width := c width.', (String cr),
' c_height := c height.', (String cr),
' ', (String cr),
' (x_index * c_width)@(y_index * c_height) + origin',
(String cr),
' ] value).', (String cr),
(String cr),
' c mouseAction: [', (String cr),
' self toggleNeighboursOfCellAt: i at: j.', (String cr),
' ].', (String cr),
' ^ c.', (String cr).
this compile:
'initialize', (String cr),
' | sampleCell width height n |', (String cr),
(String cr),
' super initialize.', (String cr),
' n := self cellsPerSide.', (String cr),
(String cr),
' sampleCell := LOCell new.', (String cr),
' width := sampleCell width.', (String cr),
' height := sampleCell height.', (String cr),
(String cr),
' self bounds: ', (String cr),
' ((5@5) extent:', (String cr),
' (width * n)@(height * n) + ', (String cr),
' (2 * (self borderWidth))).', (String cr),
(String cr),
' cells := Matrix new: n tabulate: [:i :j |', (String cr),
' self newCellAt: i at: j.', (String cr),
' ].'.
] value: (Smalltalk classNamed: 'LOGame')).
] value).
--
View this message in context: http://forum.world.st/New-to-Pharo-a-bunch-of-questions-tp4917701p4917710.h…
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Oct. 1, 2016
Re: [Pharo-dev] New to Pharo; a bunch of questions.
by CodeDmitry
Ok I got the proof of concept down, but I can't get it all to run at once
since Pharo realizes that the class does not exist(at the time of running),
even though it will exist by the time it gets to that line.
Is there a way to modify the following Transcript code make the following
code run "at once". Ignoring the fact that classes are not created at time
of writing?
([
SimpleSwitchMorph subclass: #LOCell
instanceVariableNames: 'mouseAction'
classVariableNames: ''
package: 'PBE-LightsOut'
] value).
([
BorderedMorph subclass: #LOGame
instanceVariableNames: 'cells'
classVariableNames: ''
package: 'PBE-LightsOut'
] value).
([
LOCell compile:
'mouseAction: a', (String cr),
' ^ mouseAction := a'.
] value).
([
LOCell compile:
'mouseUp: e', (String cr),
' mouseAction value'
] value).
([
LOCell compile:
'initialize', (String cr),
' super initialize.', (String cr),
' self label: ''''.', (String cr),
' self borderWidth: 2.', (String cr),
' bounds := (0@0) corner: (16@16).', (String cr),
' offColor := Color paleYellow.', (String cr),
' onColor := Color paleBlue darker.', (String cr),
' self useSquareCorners.', (String cr),
' self turnOff.'
] value).
([
LOGame compile:
'cellsPerSide', (String cr),
' ^10'
] value).
([
LOGame compile:
'toggleNeighboursOfCellAt: i at: j', (String cr),
' (i > 1) ifTrue: [', (String cr),
' (cells at: i - 1 at: j) toggleState.', (String cr),
' ].', (String cr),
(String cr),
' (i < self cellsPerSide) ifTrue: [', (String cr),
' (cells at: i + 1 at: j) toggleState.', (String cr),
' ].', (String cr),
(String cr),
' (j > 1) ifTrue: [', (String cr),
' (cells at: i at: j - 1) toggleState.', (String cr),
' ].', (String cr),
(String cr),
' (j < self cellsPerSide) ifTrue: [', (String cr),
' (cells at: i at: j + 1) toggleState.', (String cr),
' ].'
] value).
([
LOGame compile:
'newCellAt: i at: j', (String cr),
' | c origin | ', (String cr),
(String cr),
' c := LOCell new.', (String cr),
' origin := self innerBounds origin.', (String cr),
(String cr),
' self addMorph: c.', (String cr),
' ', (String cr),
' c position: ([', (String cr),
' | x_index y_index c_width c_height |', (String cr),
(String cr),
' x_index := i - 1.', (String cr),
' y_index := j - 1.', (String cr),
' c_width := c width.', (String cr),
' c_height := c height.', (String cr),
' ', (String cr),
' (x_index * c_width)@(y_index * c_height) + origin', (String
cr),
' ] value).', (String cr),
(String cr),
' c mouseAction: [', (String cr),
' self toggleNeighboursOfCellAt: i at: j.', (String cr),
' ].', (String cr),
' ^ c.', (String cr)
] value).
([
LOGame compile:
'initialize', (String cr),
' | sampleCell width height n |', (String cr),
(String cr),
' super initialize.', (String cr),
' n := self cellsPerSide.', (String cr),
(String cr),
' sampleCell := LOCell new.', (String cr),
' width := sampleCell width.', (String cr),
' height := sampleCell height.', (String cr),
(String cr),
' self bounds: ', (String cr),
' ((5@5) extent:', (String cr),
' (width * n)@(height * n) + ', (String cr),
' (2 * (self borderWidth))).', (String cr),
(String cr),
' cells := Matrix new: n tabulate: [:i :j |', (String cr),
' self newCellAt: i at: j.', (String cr),
' ].'
] value).
--
View this message in context: http://forum.world.st/New-to-Pharo-a-bunch-of-questions-tp4917701p4917707.h…
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Oct. 1, 2016
Re: [Pharo-dev] New to Pharo; a bunch of questions.
by CodeDmitry
Thanks Peter! I admit I couldnt really dynamically add methods to a class at
runtime since I was doing it as follows:
([
(LOCell class) methodDict
at: #mouseAction
put: ((LOCell class) compile:
mouseAction: a
^ mouseAction := a
).
] value).
Which caused constant harassment by Pharo until I typed:
(LOCell class) removeAllKeys.
or
(LOCell class) removeKey: #mouseAction.
I'll try your method in a bit to see if it works better.
--
View this message in context: http://forum.world.st/New-to-Pharo-a-bunch-of-questions-tp4917701p4917706.h…
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Oct. 1, 2016
Re: [Pharo-dev] New to Pharo; a bunch of questions.
by Peter Uhnak
Couple more answers.
On Sat, Oct 01, 2016 at 09:29:51AM -0700, CodeDmitry wrote:
> 3. Is it possible to prevent Pharo from screwing up indenting of my class
> definitions when I save?(It keeps replacing leading spaces with a tab). If
> so how?
Yes and no, you can specify indent string in "Code Browsing > BlueInk Pretty Printing",
however when you press "tab" it will still insert tab. This setting only applies to autoformatting. (ctrl+shift+f).
As for class definition, the implementation is in ClassDescription>>definition, where you can see things like
aStream cr; tab; nextPutAll: 'instanceVariableNames: ';
store: self instanceVariablesString.
so you would need to change >aStream cr; tab< into >aStream cr; nextPutAll: 'your indentation spaces'<
Or you can do that en masse...
newCode := (ClassDescription>>#definition) sourceCode copyReplaceAll: 'tab;' with: ''' '';'.
ClassDescription compile: newCode.
And add that code into a StartupScript or somewhere.
>
> 4. How can I create a Pharo package from Playground using code?
RPackage organizer createPackageNamed: 'Hello'.
>
> I suspect 4 and 5 are possible because Pharo allows dynamic
> insertion/removal of methods from classes using the class method dictionary
> and runtime compile.
As a bonus in answer to "3." you can also see how to dynamically compile a method. :)
Peter
Oct. 1, 2016
Re: [Pharo-dev] New to Pharo; a bunch of questions.
by CodeDmitry
I don't like tabs because I always have my code have 4 space indenting, so
when I add 2 spaces to Pharo's spacing to 4, it
(1) when I backspace 3 times, it effectively removes the 2 spaces and then
the tab, then when I press backspace for the fourth time, it puts me back
on last line rather than removing the fourth "character", and it throws me
off a bit.
(2) it removes the spaces I added, and puts tabs instead.
People deal with complexity through patterns, and allowing them to choose
what patterns work for them greatly reduces astonishment and improves code
quality since code behaves the way the programmer expects rather than how
the environment thinks the programmer should expect it to behave. I can get
used to it but it's always going to bother me and throw me off in other
environments when I do(context switching).
Thanks so much for that comment about classes. I realize now that that
expression not only to just be a simple expression (Object subclass: x1
instanceVariableNames: x2 classVariableNames: x3 package: x4), something I
haven't realized; but it also creates the package if the package does not
exist. I can now write Pharo-environment setup scripts that I can run in
playground to set up the whole pharo environment(which I can give to others
instead of image/sources/changes files.
--
View this message in context: http://forum.world.st/New-to-Pharo-a-bunch-of-questions-tp4917701p4917703.h…
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Oct. 1, 2016
Re: [Pharo-dev] New to Pharo; a bunch of questions.
by Nicolai Hess
Hi and welcome!
2016-10-01 18:29 GMT+02:00 CodeDmitry <dimamakhnin(a)gmail.com>:
> I have a course at my university where I have to use Pharo for assignments.
>
> I have a few questions about the Pharo environment.
>
> 1. Is it possible to turn off Pharo's "'" and "()" matching? If so how?
>
In Settings Browser (World menu -> System -> Settings)
Code Browser - > Code Completion -> Smart Characters
>
> 2. Is it possible to use system fonts in Pharo? If so how?
>
Again, Sytem Browser
Appearance -> Standard Fonts -> Select an entry , this will open the font
chooser. In the font chooser presse "update" and it will load the available
system fonts.
>
> 3. Is it possible to prevent Pharo from screwing up indenting of my class
> definitions when I save?(It keeps replacing leading spaces with a tab). If
> so how?
>
No, I don't think so. It just prints the class definition, not based on
your input but just the definition. What is the problem with this, why do
you need spaces instead of tabs?
>
> 4. How can I create a Pharo package from Playground using code?
>
> 5. How can I create a Pharo class from Playground using code?
>
The code for creating a class is just the same as the class definition you
see in the system browser
Object subclass: #NameOfYourNewClass
instanceVariableNames: ''
classVariableNames: ''
package: ''
You can evaluate this code in a playground and it will create this class
> I suspect 4 and 5 are possible because Pharo allows dynamic
> insertion/removal of methods from classes using the class method dictionary
> and runtime compile.
>
> Thanks ahead of time!
>
>
Feel free to ask more questions :)
And take a look at the pharo books -> http://files.pharo.org/books/
>
>
>
> --
> View this message in context: http://forum.world.st/New-to-
> Pharo-a-bunch-of-questions-tp4917701.html
> Sent from the Pharo Smalltalk Developers mailing list archive at
> Nabble.com.
>
>
Oct. 1, 2016