Re: [Pharo-users] Updating singletons

2019-01-03 Thread Cyril Ferlicot D. via Pharo-users
--- Begin Message ---
Hello,

Fetching, loading and post loads should leave a trace during the
execution in the Transcript.

For pre/post load it should have something like:

Evaluated -> baseline [BaselineOfMyProject] >> selector

This is the primary source of informations I use to debug baselines.

-- 
Cyril Ferlicot
https://ferlicot.fr



signature.asc
Description: OpenPGP digital signature
--- End Message ---


Re: [Pharo-users] Updating singletons

2019-01-03 Thread Konrad Hinsen via Pharo-users
--- Begin Message ---
Ben,

> You might use a Baseline #postLoadDoIt:
> https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md

Thanks, that looks like exactly what I need... except that it doesn't
seem to work. My postload method is not run when a new version of the
code is loaded into an image. Nor when I load my project into a fresh
image.

Which makes me wonder more generally how one can debug baselines. The
mechanism that uses them is very opaque: you write some code as a kind
of plugin to some framework, but it is not clear at all how this code is
used.

> Consider that a person pulling your changes cannot know if you have
> upgraded the library versions of any dependencies,
> so always updating via a Baseline might be a reasonable expectation.

Indeed, baselines make a lot of sense in principle.

Cheers,
  Konrad

--- End Message ---


Re: [Pharo-users] Is it possible to follow an object through a computation?

2019-01-03 Thread Steven Costiou via Pharo-users
--- Begin Message ---
Hi, 

if you are using Pharo 7 I have some work on object-centric debugging
that could do that, using Reflectivity. 

For example, with object-centric metalinks you could do the following: 

##get your object (here are two instances of a trivial class which only
has a "name" inst var) 

obj1 := MyClass new.
obj2 := MyClass new. 

##define a "halt" metalink: 

link := MetaLink new 
metaObject: Halt; 
selector: #now;
control: #before.

##install the metalink on the  instance variable "name" of the  first
object using the new Reflectivity API 

obj1 link: link toSlotNamed: #name. 

##then the system only halts when you use a method accessing the "name"
slot of this object, and not for other instances 

obj1 name: 'first name'. <-- halt
obj2 name: 'second name' <-- no halt 

If you look at Object and Class classes, you will find a more detailed
API to install metalinks on different structural entities and to scope
them to objects. For example you can ask to halt only when a instance
variable is read, or only when something is written in it (in the
example above it does both). 

These metalinks are only available for Pharo 7 and must be loaded from
https://github.com/StevenCostiou/Reflectivity-dev and you must override
the current Reflectivity code (click "load" and not "merge"). Hopefully
that will be integrated and merged in Pharo 7 or 8 soon. 

There is also that https://github.com/ClotildeToullec/Collectors/wiki
which provides a history tool that stores all objects that went into an
instance variable of an object (or even a temp var or a given
expression). It uses the Reflectivity API mentionned above. However for
now it is needed to provide a condition to scope the capture of objects
to a specific instance (but it works well). This tool also gives you the
stack for each modification of an instance variable. Objects are stored
in memory though, so it can kill your image on too large program
executions (that part is currently being investigated...). 

I do not have time right now to get into more details, but if you try
any of it and have questions please ask. 

Steven. 

  --- End Message ---


[Pharo-users] [Pharo MOOC] Object/Class Diagram generation

2019-01-03 Thread sergio ruiz via Pharo-users
--- Begin Message ---
Hey, all.

I was just wondering if anyone knew how the Pharo MOOC was creating their
Object/Class Diagrams like so:


Thanks!

peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
--- End Message ---


Re: [Pharo-users] [Moose-dev] glamorous toolkit: v0.4.0

2019-01-03 Thread Sean P. DeNigris
Pharo Smalltalk Users mailing list wrote
> My holy grail is a document that describes both software and
> computations

Yes!!! Capturing mindshare in the data analysis field would be *huge* for
Pharo/GT because there are a lot of people who are new and view
languages/environments as means to an end, and hence seem to be much less
poisoned against blue plane ideas by years of Stockholm syndrome with
obsolete but common technologies.



-
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Updating singletons

2019-01-03 Thread Steffen Märcker
Have you considered to yield (an) proxy object(s) instead of the actual 
Singleton in uniqueInstance? This way it suffices to update the proxy with each 
update of the code.

Am 3. Januar 2019 15:36:27 MEZ schrieb Ben Coman :
>On Thu, 3 Jan 2019 at 20:01, Konrad Hinsen via Pharo-users <
>pharo-users@lists.pharo.org> wrote:
>
>> Dear Pharo experts,
>>
>> I am wondering if there is a good way to deal with singleton objects
>> whose value needs to be updated following changes in the code that
>> initializes it.
>>
>> Following the model of many examples in Pharo itself, I have defined
>a
>> singleton class with a uniqueInstance method for accessing (and
>creating
>> if necessary) the single instance, and a method "reset" marked as a
>> script to set the uniqueInstance back to nil when required, i.e.
>after
>> source code changes make the prior value inappropriate.
>>
>> This works very well, as long as I don't forget to do the reset,
>which
>> has already caused me a few hours of debugging time. Worse, suppose
>> someone else is using my project in progress, pulling changes from my
>> GitHub repo once per week. That person cannot know if the latest
>changes
>> require a singleton reset. More importantly, users shouldn't have to
>> know about such internal details at all.
>>
>> So is there a way to do the reset automatically whenever a new
>version
>> of my package is loaded into an image?
>>
>> Thanks in advance,
>>   Konrad.
>>
>
>You might use a Baseline #postLoadDoIt:
>https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md
>
>
>Consider that a person pulling your changes cannot know if you have
>upgraded the library versions of any dependencies,
>so always updating via a Baseline might be a reasonable expectation.
>
>But that doesn't help you while developing within the one image.
>
>cheers -ben


Re: [Pharo-users] Updating singletons

2019-01-03 Thread Ben Coman
On Thu, 3 Jan 2019 at 20:01, Konrad Hinsen via Pharo-users <
pharo-users@lists.pharo.org> wrote:

> Dear Pharo experts,
>
> I am wondering if there is a good way to deal with singleton objects
> whose value needs to be updated following changes in the code that
> initializes it.
>
> Following the model of many examples in Pharo itself, I have defined a
> singleton class with a uniqueInstance method for accessing (and creating
> if necessary) the single instance, and a method "reset" marked as a
> script to set the uniqueInstance back to nil when required, i.e. after
> source code changes make the prior value inappropriate.
>
> This works very well, as long as I don't forget to do the reset, which
> has already caused me a few hours of debugging time. Worse, suppose
> someone else is using my project in progress, pulling changes from my
> GitHub repo once per week. That person cannot know if the latest changes
> require a singleton reset. More importantly, users shouldn't have to
> know about such internal details at all.
>
> So is there a way to do the reset automatically whenever a new version
> of my package is loaded into an image?
>
> Thanks in advance,
>   Konrad.
>

You might use a Baseline #postLoadDoIt:
https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md


Consider that a person pulling your changes cannot know if you have
upgraded the library versions of any dependencies,
so always updating via a Baseline might be a reasonable expectation.

But that doesn't help you while developing within the one image.

cheers -ben


[Pharo-users] Updating singletons

2019-01-03 Thread Konrad Hinsen via Pharo-users
--- Begin Message ---
Dear Pharo experts,

I am wondering if there is a good way to deal with singleton objects
whose value needs to be updated following changes in the code that
initializes it.

Following the model of many examples in Pharo itself, I have defined a
singleton class with a uniqueInstance method for accessing (and creating
if necessary) the single instance, and a method "reset" marked as a
script to set the uniqueInstance back to nil when required, i.e. after
source code changes make the prior value inappropriate.

This works very well, as long as I don't forget to do the reset, which
has already caused me a few hours of debugging time. Worse, suppose
someone else is using my project in progress, pulling changes from my
GitHub repo once per week. That person cannot know if the latest changes
require a singleton reset. More importantly, users shouldn't have to
know about such internal details at all.

So is there a way to do the reset automatically whenever a new version
of my package is loaded into an image?

Thanks in advance,
  Konrad.

--- End Message ---


Re: [Pharo-users] Linux ARM v6 libgit2 libssh2 libsdl2

2019-01-03 Thread Esteban Lorenzano
Not really, but there is no reason why we cannot follow the approach we are 
taking for win64 (downloading third party dependencies) also for arm.

Esteban

> On 3 Jan 2019, at 08:39, Alistair Grant  wrote:
> 
> Hi All,
> 
> Downloading and installing the Pharo 7 vmLatest on a Raspberry Pi
> succeeds, but is missing libgit2, libssh2 & libsdl2.  The build
> scripts suggest this is intentional due to excessive build times,
> which is quite believable.
> 
> Is there a place where the libraries can be downloaded from and
> dropped in to the VM directory?
> 
> Thanks,
> Alistair
>