[Pharo-users] Re: How to halt on Test errors?

2024-01-09 Thread Denis Kudriashov
Hi David.

Try to modify the method #runTestCase:results: to use "testCase suite
debug" instead of #run: and you will switch to the debug mode.
Then you can try to implement new command this way (copy
ClyRunTestsFromClassesCommand as ClyDebugTestsFromClassesCommand and
override some methods)

пн, 8 янв. 2024 г. в 13:25, Davide Varvello via Pharo-users
:
>
> Hi Guillermo,
> There is no debug mode on test classes (see screenshot), it is at method 
> level and unfortunately the error does not occur when I run the single test 
> method, but when I ran the whole test class.
>
> How can I run the debugger at test class level?
>
> Cheers
>
> Davide
>
>
>
>
> On Monday, January 8, 2024 at 10:07:37 AM GMT+1, Guillermo Polito 
>  wrote:
>
>
> Hi Davide,
>
> I don’t think something specific to your needs exists, but you can easily 
> build your own.
> There is already for example `haltIfTest` that will halt if you’re in the 
> dynamic extent of a test.
>
> If you’re dealing with concurrency issues, I don’t understand how the 
> `haltIfError` is actually helping you.
> Just running the test in debug mode is not enough? => it should open a 
> debugger when it finds an error, right?
>
> G
>
> El 8 ene. 2024, a las 09:54, Davide Varvello via Pharo-users 
>  escribió:
>
> No ideas?
>
> Cheers
> Davide
>
>
> On Thursday, January 4, 2024 at 03:42:17 PM GMT+1, Davide Varvello via 
> Pharo-users  wrote:
>
>
> Hi Noury,
>
> You are right and reading your answer I understand I wasn't crystal clear.
>
> I have a test scenario where sometimes a race condition occurs, so I'm not 
> expecting any error. Which is why I'd prefer something built-in Pharo: a sort 
> of "haltIfError" or "haltOnError" built-in command.
> Is there anything like that in Pharo?
>
> TIA
>
> Davide
>
> On Thursday, January 4, 2024 at 01:24:59 PM GMT+1, Noury Bouraqadi 
>  wrote:
>
>
> Hi Davide,
>
> Why not use one of the following:
>
> self should: ["message that might signal an error"] raise: Error "Replace 
> Error with the exception you want to catch"
>
> self shouldnt:  ["message that might signal an error"] raise: Error "Replace 
> Error with the exception you want to catch"
>
>
> On Jan 3 2024, at 4:55 pm, Davide Varvello via Pharo-users 
>  wrote:
>
> Hi Guys,
>
> Sometimes I'd like to stop my test suite when an error occurs.
>
> My raw approach is to put a self halt in the TestResult>>addError: and look 
> at the debugger, but I'm wondering if there is a more suitable way.
>
> Can you help me, please?
>
> TIA
> Davide
>
>


Re: [Pharo-users] Fuel - FLSerializer tests are not working (pharo 8)

2020-08-03 Thread Denis Kudriashov
It can be a known issue with MacOS, the way how an operating system assigns
a working directory for applications.
For example starting an app using double click from Finder will use a root
directory as a working copy.

Davide how did you start the Pharo? Can you try to run it from the command
line? In that case the current working directory of the terminal will be
assigned to the started application.




пн, 3 авг. 2020 г. в 19:16, Stéphane Ducasse :

> I took a Pharo8 image and
>
> Metacello new
>repository: 'github://theseion/Fuel:3.0.2/repository';
>baseline: 'Fuel';
>load.
>
> and run the tests and all the tests are green on my machine.
>
> 595 ran, 576 passed, 1 skipped, 19 expected failures, 0 failures, 0
> errors, 0 passed unexpected
>
>
> S.
>


Re: [Pharo-users] Class hierarchy diagram

2020-05-31 Thread Denis Kudriashov
Hi Sanjay

вс, 31 мая 2020 г. в 16:35, Sanjay Minni :

> The view in the pane is limited only the current selected class.


You can select multiple classes and switch to hierarchy (Hier. radio). It
will show the "composite hierarchy" of selected classes.


> A diagram of
> the overall structure is very useful to understand the system or weed out
> stray issues.
>

We will have a real diagram with Roassal mini integrated. But I don't know
what is the the current status.
Now you need to load it manually. I think it includes the browser
integration. But I do not have any instructions for you.


>
> Dolphin smalltalk has a Class hierarchy view. I am looking for something
> similar.
>
> 
>
>
>
> Kasper Osterbye wrote
> > I believe the browser can do that out of the box. Look below the four
> > panes, above the code, and there is a hierarchical view option.
> >
> >> Den 31. maj 2020 kl. 16.30 skrev Sanjay Minni 
>
> > sm@
>
> > :
> >>
> >> Is there any way to display the Class Hierarchy as a Diagram or a
> >> indented
> >> list. Even for all the classes in a package will do.
> >>
> >>
> >>
> >> -
> >> cheers,
> >> Sanjay
> >> --
> >> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> >>
>
>
>
>
>
> -
> cheers,
> Sanjay
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] [ANN] Pharo 8.0 Released!

2020-01-21 Thread Denis Kudriashov
Congrats, guys. Can't wait Pharo 9 release :).



пн, 20 янв. 2020 г. в 13:24, Esteban Lorenzano :

> Dear World and dynamic language lovers:
> The time has come for Pharo 8.0 <https://pharo.org/>!
> Pharo is a pure object-oriented programming language and a powerful
> environment, focused on simplicity and immediate feedback.
>
> Here are the key highlights of this release:
>
>- The 64-bit version has become the recommended version for Windows as
>it was for Unix and OSX.
>- Iceberg, the git client for Pharo, reached its version 1.6.5 with
>several improvements and bugfixes.
>- Calypso, Pharo’s system browser has new and better refactoring
>integrations and AST-based suggestions for class definitions.
>- The unified foreign function interface (UnifiedFFI) has been
>improved with more support for literal objects, better type coercions, and
>more documentation.
>-
>
>Several speed improvements in code searches and compilation.
>
> In addition, this version includes several previews of new tools such as
> the Spec2 GUI framework with native widget integration and the new DrTests
> test analysis tool and opens the door for the upcoming headless VMs for
> servers and non-blocking FFI.
> These are just the more prominent highlights, but the details are just as
> important. We have closed a massive amount of issues: 2805 issues!
> A comprehensive changelog can be found at
> https://github.com/pharo-project/pharo-changelogs/blob/master/Pharo80ChangeLogs.md
> <https://github.com/pharo-project/pharo-changelogs/blob/master/Pharo60ChangeLogs.md>
> ).
> While the technical improvements are significant, still the most
> impressive fact is that the new code that got in the main Pharo 8.0 image
> was contributed by more than 100 people.
> Pharo is more than code. It is an exciting project involving energetic
> people. We thank all the contributors to this release:
> Serge Stinckwich, Myroslava Romaniuk, Hilaire Fernandes, Alexandre Bergel,
> David Bajger, Sean DeNigris, Theodore Moen, Dayne Guerra Calle, Juraj
> Kubelka, Max Leske, Santiago Jose Dandois, Alistair Grant, Sabine Mana,
> Chia Yu, Stephan Eggermont, Milton Mamani, Pavel Krivanek, Ben Coman,
> Marcus Denker, Pierre Misse, Christophe Demarey, Allex Oliveira, Andreina
> Cota, Theo Rogliano, Clément Dutriez, Quentin Ducasse, Cyril Ferlicot,
> Cameron Bierwagen, Marek Niepieklo, Clotilde Toullec, Esteban Lorenzano,
> Vincent Blondeau, Danil Osipchuk, Eiichiro Ito, Noury Bouraqadi, Oleksandr
> Zaytsev, Jason Riggs, Alain Plantec, Kasper Osterbye, Leonardo Cecchi, Chi
> Huynh, Santiago Bragagnolo, Antonio Pierro, Pablo Tesone, Tim Mackinnon,
> Wesley Duerksen, Wilfred Hughes, John Brant, Evelyn Cusi Lopez, Manuel
> Leuenberger, Thomas Dupriez, Norbert Hartl, Torsten Bergmann, Gabriel Omar
> Cotelli, Carlo Teixeira, Guille Polito, Torsten Bergman, Damien Pollet,
> Holger Hans Peter Freyther, Julio Ripoll, Carolina Hernandez Phillips,
> Julien Delplanque, Hugo Lasnier, James Foster, Will Hensel, Erik Stel, Sven
> Van Caekenberghe, Martín Dias, Tomohiro Oda, Konrad Hinsen, Sébastien
> Roccaserra, Stéphane Ducasse, Denis Kudriashov, Ellis Harris, Steven Costiou
> (If you contributed with Pharo 8.0 development in any way and we missed
> your name, please send us a mail and we will add you).
> Enjoy!
> The Pharo Team
> Try Pharo: http://pharo.org/download <https://pharo.org/download>
>
> Learn Pharo: http://pharo.org/documentation
> <https://pharo.org/documentation>
>
>
> If you cannot see this, follow this link:
> http://pharo.org/news/pharo8.0-released
>


Re: [Pharo-users] Test method auto-generation in Calypso

2019-10-04 Thread Denis Kudriashov
Hi Hernan.
Sorry for late response (noticed mail just now).

First try to implement just another browser tab which will show you
covering test or allow to create one.
Check for example how extra tab with test setup is done.

Then there is a feature in the tab manager to show multiple tabs at same
time. On the MacOS it is done by cmd+click on the tab header.

Maybe it will be enough for your idea.

Best regards,
Denis

ср, 25 сент. 2019 г., 5:07 Hernán Morales Durand :

> Hi,
>
> I have this idea of typing a method in a Browser and have another code
> area in the same browser where the method test is "automagically
> generated".
>
> This is, divide the current method pane in two: One for the method being
> written itself, and another for its test, where at least the method
> selector could be autogenerated by writing test
>
> Of course being able to jump to the method test would be super nice! (and
> with a keyboard shortcut). This reminds myself to write the method now
> instead of forget it forever.
>
> Any hints to make this happen in Calypso?
>
> Cheers,
>
> Hernán
>
>


Re: [Pharo-users] how to open a system browser on a environment?

2019-08-30 Thread Denis Kudriashov
Hi Bernardo.

RBEnvironment is not supported in Calypso. But you can scope browser to the
set of packages:

ClyFullBrowser openWithState: [:browser |
   browser switchToPackageScopeOf: {Announcer package. Array
package}]


It will keep given scope in following navigation from opened browser.  for
example try open senders from the browser and then spawn full browser from
one of items.

пт, 30 авг. 2019 г. в 01:02, Bernardo Ezequiel Contreras <
vonbecm...@gmail.com>:

> thanks, but nop. (i downloaded drgeo and tested that expression)
> i want to open the system browser with my project's packages, only that.
> thanks again.
>
>
> On Thu, Aug 29, 2019 at 9:16 AM Hilaire  wrote:
>
>> On DrGeo based on P7, I do this:
>>
>> Smalltalk tools browser openOnClass: DrGeoSketch
>>
>> Hope it help.
>>
>> Hilaire
>>
>> --
>> Dr. Geo
>> http://drgeo.eu
>>
>>
>>
>>
>
> --
> Bernardo E.C.
>
> Sent from a cheap desktop computer in South America.
>


Re: [Pharo-users] TestCases and forked processes in TestResource don't play well

2019-06-14 Thread Denis Kudriashov
Hi Eric

чт, 13 июн. 2019 г., 20:31 Erik Stel :

> Hi Denis,
>
> Thanks for the fast response.
>
> When you say proper fix, do you mean a general fix for all TestResources or
> do you mean the fix for my situation?
>

I mean a general fix for test resources.


> I can't oversee (yet) what the effect will be of halt/debug code inside the
> web application (TestResource) which is the subject of the TestCase.
> Normally this gets caught and handled specifically. And proper termination
> of those forked processes from the TestResource will need to be handled
> specifically (similar to the TestExecutionEnvironment :-) in the resource
> #tearDown. Will try it out.
>
> Cheers,
> Erik
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] TestCases and forked processes in TestResource don't play well

2019-06-12 Thread Denis Kudriashov
I think proper fix for this logic would be to disable test environment
during startup of resources

ср, 12 июн. 2019 г. в 21:11, Denis Kudriashov :

> Hi Eric.
>
> You can override #runCaseManaged on your test case:
>
> MyTestCase>>runCaseManaged
>self runCase
>
> It will disable all clever logic.
>
> ср, 12 июн. 2019 г. в 20:55, Erik Stel :
>
>> Hi,
>>
>> I'm developing a web application using (amongst others) WebSockets. To
>> prevent test methods from becoming too big and slow I created a TestCase
>> with a TestResource containing my web application instance. After the
>> first
>> test method is run, the WebSocket is closed unexpectedly and
>> automagically.
>> It turns out that all forked processes are terminated when a TestCase has
>> executed a test method. What would be the proper way to prevent these
>> forked
>> processes from terminating after a single test method? Or am I missing
>> something/doing something wrong?
>>
>> TestExecutionEnvironment>>#checkForkedProcesses is responsible for
>> terminating any (non failed) processes. It is executed after
>> TestExecutionEnvironment>>#runTestCaseSafelly: [sic: this should be
>> #runTestCaseSafely:]. A possible solution might be to check whether the
>> Context in which a forked process was created has the #setUp method of a
>> TestResource of the TestCase (you still with me ;-) in its Context chain.
>> If
>> that is the case, the process is probably forked for a reason. This forked
>> process does have to be terminated when all TestCases have finished of
>> course (when the TestResource does #tearDown).
>>
>> IFF the forked processes should be kept alive during the execution of all
>> TestCase methods, does the suggested solution above seem logical or are
>> there any (better) alternatives?
>>
>> Regards,
>> Erik
>>
>>
>>
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>>


Re: [Pharo-users] TestCases and forked processes in TestResource don't play well

2019-06-12 Thread Denis Kudriashov
Hi Eric.

You can override #runCaseManaged on your test case:

MyTestCase>>runCaseManaged
   self runCase

It will disable all clever logic.

ср, 12 июн. 2019 г. в 20:55, Erik Stel :

> Hi,
>
> I'm developing a web application using (amongst others) WebSockets. To
> prevent test methods from becoming too big and slow I created a TestCase
> with a TestResource containing my web application instance. After the first
> test method is run, the WebSocket is closed unexpectedly and automagically.
> It turns out that all forked processes are terminated when a TestCase has
> executed a test method. What would be the proper way to prevent these
> forked
> processes from terminating after a single test method? Or am I missing
> something/doing something wrong?
>
> TestExecutionEnvironment>>#checkForkedProcesses is responsible for
> terminating any (non failed) processes. It is executed after
> TestExecutionEnvironment>>#runTestCaseSafelly: [sic: this should be
> #runTestCaseSafely:]. A possible solution might be to check whether the
> Context in which a forked process was created has the #setUp method of a
> TestResource of the TestCase (you still with me ;-) in its Context chain.
> If
> that is the case, the process is probably forked for a reason. This forked
> process does have to be terminated when all TestCases have finished of
> course (when the TestResource does #tearDown).
>
> IFF the forked processes should be kept alive during the execution of all
> TestCase methods, does the suggested solution above seem logical or are
> there any (better) alternatives?
>
> Regards,
> Erik
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] TelePharo / Seamless Bitmaps are all 0s

2019-05-16 Thread Denis Kudriashov
Hi Alistair

ср, 15 мая 2019 г. в 10:11, Alistair Grant :

> Hi Denis,
>
> On Wed, 15 May 2019 at 10:16, Denis Kudriashov 
> wrote:
> >
> > Hi Alistair
> >
> > I will look when have a time.
> > But you can try to write a test for bitmap serialization/materialization
> in TostSerializationTests (if I remember correctly the name).
> > It will show if bitmap transport requires extra logic.
>
> If I remove Bitmap>>travelGuide (so that it inherits the default
> OrdinaryObjectTravelGuide instead of an empty travel guide) everything
> seems to work OK.
>
> This seems reasonable to me as a Bitmap's format is basically the same
> as an Array, which doesn't seem to require any special processing.
>

Not really. Bitmap is specifically array of integers. So it does not make
sense to traverse it as a complex structure considering that all its items
are real objects. it could be quite expensive.
Bitmap represents an image (form) and I think it is logical to trait it as
a whole structure, like bytearray or string. And EmptyObjectTravelGuide
marks such kind of objects to be not traversable.

So the issue was with missing implementation of Bitmap serialization.
TostSerializer requires that any integral object implements couple of
"primitive methods". And it was not done for Bitmap.

I fixed serializer and released all dependent projects. So try update
TelePharo.


>
> I can add a simple test and submit a PR (in a few days time) if the
> change sounds OK to you.
>
> Thanks,
> Alistair
>
>
> > ср, 15 мая 2019 г., 8:49 Alistair Grant :
> >>
> >> Hi Denis,
> >>
> >> If I print:
> >>
> >> remotePharo evaluate: [ Array withAll: #(42 42 42) ] "==> #(42 42 42)"
> >>
> >> which is obviously correct, but:
> >>
> >> remotePharo evaluate: [ Bitmap withAll: #(42 42 42) ]
> >>
> >> gives me a bitmap with all zeroes (running it locally does the expected
> thing).
> >>
> >> I can see that the bitmap is being created correctly on the server,
> >> but by the time it gets back the values have been lost (all converted
> >> to 0s).  If I change the Bitmap>>seamlessDefaultTransferStrategy for
> >> the Bitmap to #defaultByReference I can correctly access the values
> >> (just for debugging, by reference isn't practical for the real
> >> system).
> >>
> >> Any hints on where to look?
> >>
> >> Thanks again,
> >> Alistair
> >>
>
>


Re: [Pharo-users] TelePharo / Seamless Bitmaps are all 0s

2019-05-15 Thread Denis Kudriashov
Hi Alistair

I will look when have a time.
But you can try to write a test for bitmap serialization/materialization in
TostSerializationTests (if I remember correctly the name).
It will show if bitmap transport requires extra logic.

ср, 15 мая 2019 г., 8:49 Alistair Grant :

> Hi Denis,
>
> If I print:
>
> remotePharo evaluate: [ Array withAll: #(42 42 42) ] "==> #(42 42 42)"
>
> which is obviously correct, but:
>
> remotePharo evaluate: [ Bitmap withAll: #(42 42 42) ]
>
> gives me a bitmap with all zeroes (running it locally does the expected
> thing).
>
> I can see that the bitmap is being created correctly on the server,
> but by the time it gets back the values have been lost (all converted
> to 0s).  If I change the Bitmap>>seamlessDefaultTransferStrategy for
> the Bitmap to #defaultByReference I can correctly access the values
> (just for debugging, by reference isn't practical for the real
> system).
>
> Any hints on where to look?
>
> Thanks again,
> Alistair
>
>


Re: [Pharo-users] TelePharo breaks Calypso tabs

2019-05-14 Thread Denis Kudriashov
Hi Alistair.

We forgot update telepharo baseline for fixed calypso version.

For now just load latest calypso from master on top of telepharo

вт, 14 мая 2019 г., 7:54 Alistair Grant :

> Hi Dennis & Everyone,
>
> I'm just starting to play with TelePharo - it's really impressive.
>
> However loading either the server or client in Pharo 7 or Pharo 8
> breaks Calypso so that I can no longer click on tabs to move between
> the Comment, Class Definition or methods.
>
> Is this a known issue?  And is there a fix or workaround?
>
>
> In both Pharo 7 & 8 TelePharo was loaded with:
>
> Metacello new
>   baseline: 'TelePharo';
>   repository: 'github://pharo-ide/TelePharo';
>   load: 'Server'.
>
>
> Metacello new
>   baseline: 'TelePharo';
>   repository: 'github://pharo-ide/TelePharo';
>   load: 'Client'.
>
> in separate clean images downloaded 14 May 2019.
>
> OS: Ubuntu 16.04.
>
>
> Thanks!
> Alistair
>
>


Re: [Pharo-users] Test skip isn't working?

2019-03-18 Thread Denis Kudriashov
I think it is a feature. When you click icon on a single test you
explicitly raise a wish to run it.

пн, 18 мар. 2019 г., 1:26 Vitor Medina Cruz :

> Skip only works when I run tests from class. If I click the test button
> from the method skipped it don't work, maybe an error in calypso?
>
> On Sun, Mar 17, 2019 at 3:13 PM Vitor Medina Cruz 
> wrote:
>
>> Hello,
>>
>> someTest
>> self skip: 'some message'.
>>
>> rest of the test
>>
>> Rest of the test is being executed. There is a different woy of skipping
>> tests?
>>
>> Thanks,
>> Vitor.
>>
>


Re: [Pharo-users] Calypso openOnGroup?

2019-03-15 Thread Denis Kudriashov
Hello Hernan.

Try following example:

ClyFullBrowser openWithState: [:browser |
browser selectClass: Announcer atMethodTag: #initialization ]


вт, 12 мар. 2019 г. в 02:43, Hernán Morales Durand :

> Hi,
>
> Is there any way to open a browser on a method group in Claypso?
>
> This was possible in Nautilus:
>
> Smalltalk tools browser
> openOnCategory: #compiling
> ofClass: Class
>
> Cheers,
>
> Hernán
>
>


Re: [Pharo-users] TelePharo in Tonel

2019-03-15 Thread Denis Kudriashov
Hi Torsten.

It requires finally merging branch with network discovery tool. Otherwise
it would be a pain to do it after conversion.

The branch provides a Radar tool to discover available images in the
network. Generally it works but it needs real live testing. Some logic of
server connection was refactored to achieve it and it needs real tests.

Also it adds new dependency to SSDP library which is currently managed by
smalltalkhub. It would be nice to move it into github. But it needs to be
in sync with the author (Henrik Johansen).

вт, 12 мар. 2019 г., 20:20 Torsten Bergmann :

> Hi Denis,
>
> would it be possible to convert TelePharo to Tonel?
>
>https://github.com/pharo-ide/TelePharo
>
> Currently one gets load problem on Windows due to long file names and
> Tonel would
> solve that.
>
> Thanks
> T.
>


Re: [Pharo-users] What does the Package and Sub-Package comment do?

2019-02-25 Thread Denis Kudriashov
Hi Tim.

Behaviour is similar to Pharo 6. When class is selected the comment belongs
to the class. If not then it belongs to the package.
There is no such thing as a tag comment.

I thought the default comment text is clear enough to avoid confusion. But
probably it's not as you wrote this mail.
So it is a room for improvements.

Package comment is managed as a comment of ts manifest class. When you
first time add it the manifest class is created.





25 февр. 2019 г. 15:09 пользователь "Tim Mackinnon" 
написал:

Anyone have any thoughts on this? Not sure whether to report a bug or not.



> On 22 Feb 2019, at 14:48, Tim Mackinnon  wrote:
>
> Hi - I notice that you can sort of put comments on packages - but I’m not
sure if this is working or if its supposed to work?
>
> When I type something it seems to create and extra Manifest tag, and then
the comment that I type seems to be the same for the package and all of its
sub tags?
>
> Is this a work in progress? Should Calypso even show a comment for the
tags (or is it read only for them - as its the parent).
>
> I’m just not clear on what it does, and whether I can programmatically
add stuff to it or not? (I was thinking for exercism to store exercise
information there - but maybe I will stick to the test class comment)
>
> Tim


Re: [Pharo-users] How do you easily re-categorise methods in Calypso?

2019-02-20 Thread Denis Kudriashov
Hi Tim.

It needs to be improved.
I simply reused the choose dialog from add protocol command because the
change protocol dialog was the part of Nautilus.

вт, 19 февр. 2019 г., 15:06 Tim Mackinnon tim@testit.works:

> Hi - I’m scratching my head over how to easily re-caegorise methods in
> calypso? I’ve overridden some methods in subclasses and picked up the wrong
> category (which the critic is slapping me for).
>
> But when I click on the method - I can’t drag it to the new category, so
> if I click on the pencil in the status line (or the current category name -
> not sure why they are independently clickable?) - it shows me a rather
> unhelpful list of protocols. I’m not sure where this list comes from as it
> doesn’t seem to include any of the protocols that are already in the class?
> (and those which I want to use?). So I have to start typing “acces” and can
> click on accessing…
>
> Am I missing a simple trick - or is this an area that needs some work?
>


Re: [Pharo-users] Calypso documentation? Or understanding menu building

2019-02-18 Thread Denis Kudriashov
Hi Tim.

пн, 18 февр. 2019 г. в 14:48, Tim Mackinnon :

> Hi Dennis - I’ve been reading the book you mentioned and looking through
> the code as well as your examples and I feel a bit more comfortable with
> what’s going on - however I am stumped about how you do an OR context (vs.
> an AND context).
>
> I would like my menu item to appear for either a selected RPackage OR a
> ClyTaggedClassGroup - I thought I had it with:
>
> RPackage asCalypsoItemContext, ClyTaggedClassGroup  asCalypsoItemContext
> (to get a composite context) but then I realised that the composite is an
> AND.
>
> Is there some way to create an OR context, or do I simply have to create
> multiple commands?
>

You simply need two annotations. One for context of RPackage and another
for context of tag.


>
> Tim
>
>
> On 12 Feb 2019, at 19:32, Denis Kudriashov  wrote:
>
> Hi Tim
>
> вт, 12 февр. 2019 г. в 13:42, Tim Mackinnon :
>
>> Is there any documentation on Calypso   application contexts? I am trying
>> to add a menu item to a package tag (the bit underneath a package - which I
>> often call a sub-package).
>>
>
> Only class comments are available for Calypso. Also there are a Commander
> booklet
> <https://github.com/SquareBracketAssociates/Booklet-Infrastructure>which
> describes contexts and ClassAnnotation github readme
> <https://github.com/pharo-ide/ClassAnnotation> (together with class
> comments).
>
>
>>
>> I’ve specified:
>>
>> ^CmdContextMenuActivation
>> byItemOf: ClyQueryMenuGroup for: RPackage
>> asCalypsoItemContext
>>
>>
> The #for: argument of command activations is a context where command
> should be available. Context describes condition where given command (its
> activation strategy) should be visible for users.
> In your example "RPackage asCalypsoItemContext" is an instance of
> ClyBrowserItemContext which matches any selected package in the browser
> (when a kind of RPackage is selected).
> And that's why you do not see it on selected tag because the tag is not a
> package.
>
> But that puts my menu on the package and not the tag
>
> - and if I use the inspect extra menu in calypso, I get what looks to be
>> something that could help me determine what I want but I’m struggling to
>> understand what ClyTaggedClassGroup does, and what a context is all about.
>>
>
> Inspect command opens inspector of actually selected object which is an
> instance of ClyTaggedClassGroup in that case (try inspect selected method
> and you will get a CompiledMethod).
> Children of package in browser are instances of ClyClassGroup and
> subclasses. So they are not raw tags. If you need a command for a tag you
> should add a command for ClyTaggedClassGroup items:
>
> ^CmdContextMenuActivation
> byItemOf: ClyQueryMenuGroup for: ClyTaggedClassGroup
> asCalypsoItemContext
>
> Look for example at SycPromotePackageFromTagCommand
> class>>#fullBrowserMenuActivation which is defined this way.
>
> There are other kind of contexts which can be used in command annotations.
> For example if you want a command for selected method only in full browser
> then you should use ClyMethodContextOfFullBrowser:
>
> ^CmdContextMenuActivation byItemOf: ClyQueryMenuGroup for:
> ClyMethodContextOfFullBrowser
>
>
> it can be confusing that simple class is used in this case. But underhood
> it is converted to the instance of context where command should be
> available.
>
>
>>
>> Has anyone else played around with this at all?
>>
>> Ideally I want to have a menu appear on all the tags underneath a
>> particular package - and possibly including that package (or maybe not - I
>> haven’t decided as I want to try it in the wild).
>>
>> While I’m at it - I have quite understood how to create submenu’s either
>> - as I’d like to have several commands all as sub items of a menu item
>> “Exercism”.
>>
>
> Look at commander booklet. It includes example.
>
>
>>
>> Tim
>>
>>
>>
>>
>


Re: [Pharo-users] [PharoRemote] View remote Transcript

2019-02-18 Thread Denis Kudriashov
Hi Serge.

if it is related to TelePharo then you can register local transcript in
remote image. Evaluate following code in playground:

localTranscript := Transcript.
remotePharo evaluate: [ Smalltalk globals at: #Transcript put:
localTranscript ].


It will be not optimized solution because every message to transcript will
send remote request to client. But it should work.
Also all messages will go to main Transcript in you client image which is
probably not desired. So the better solution requires real implementation
of remote transcript.


пн, 18 февр. 2019 г. в 15:33, sergio ruiz :

> Hi, all..
>
> Is it possible to use PharoRemote to watch the remote site’s Transcript?
>
> 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
>


Re: [Pharo-users] [TelePharo] Error in remote playground..

2019-02-18 Thread Denis Kudriashov
Yes

18 февр. 2019 г. 14:37 пользователь "sergio ruiz" 
написал:

Awesome! is this the one i should be using?

https://github.com/pharo-ide/TelePharo

Thanks!

On February 17, 2019 at 3:06:18 PM, Denis Kudriashov (dionisi...@gmail.com)
wrote:

I released new version of TelePharo adopted for Pharo 7. So now it should
work out of the box



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


Re: [Pharo-users] [TelePharo] Error in remote playground..

2019-02-17 Thread Denis Kudriashov
Hi Sergio.

I released new version of TelePharo adopted for Pharo 7. So now it should
work out of the box

вт, 12 февр. 2019 г. в 21:24, Denis Kudriashov :

> I think it would be enough to do on client side
>
> 12 февр. 2019 г. 21:23 пользователь "Denis Kudriashov" <
> dionisi...@gmail.com> написал:
>
> Checkout dev branch using iceberg
>
> 12 февр. 2019 г. 21:10 пользователь "sergio ruiz" 
> написал:
>
> I am not sure I follow..
>
> Do you mean grab the source from github using Iceberg?
>
> Thanks!
>
> On February 12, 2019 at 4:03:25 PM, Denis Kudriashov (dionisi...@gmail.com)
> wrote:
>
> Ah, it needs new release.
> Try load dev versions of telepharo and seamless from Iceberg
>
> 
>
> 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
>
>
>
>


Re: [Pharo-users] How do I find the RPackageTag of a class?

2019-02-16 Thread Denis Kudriashov
Hi Tim.

aPackage classTagForClass: aClass

Calypso shows more kind of children than just a package tags. And it can be
extended. That's the reason why you don't have raw packageTag there.

Also in Pharo 6 new API was introduced to handle tags of classes and
methods in similar way
https://pharo.manuscript.com/f/cases/19341/New-class-and-method-tags-API.



чт, 14 февр. 2019 г. в 13:40, Tim Mackinnon :

> Actually - I’ve realised that Calypso can give me the tag name from its
> context - (aToolContext lastSelectedClassGroup).
>
> However it does highlight a very strange package/tag design. Are you not
> supposed to be easily able to derive RPacakgeTags?
>
> Tim
>
> > On 14 Feb 2019, at 13:19, Tim Mackinnon  wrote:
> >
> > I’m trying to understand how RPackage and RPackageTag work in Pharo7? It
> seems different than Pharo6 at least with Nautilus (vs Calypso) - as
> previously the Nautilus UI gave me the RPacakgeTag, and I could just work
> with that. Calypso doesn’t seem to give me the tag object, but if I have a
> known class and I want to know its RPackageTag I can’t see how you do it?
> It all seems rather messy….
> >
> > I can ask a class for its category - which just gives me a symbol of the
> form “mypackage-tagname”, and if I ask a class for its package, it will
> give me an RPackage(myPackage) - but that RPackage has a set of
> RPackageTags which just use the tagname (so not prefixed with
> "mypackage-“)? So am I really supposed to split the category name on “-“
> myself, and then select the correct RPackageTag?
> >
> > If I look at the RPackageTag tests - they all seem to use hard coded
> values and so don’t really show you how you deal with the question above?
> >
> > It really seems quite messy?
> >
> > I naively thought that if I wanted a browser extension to deal with a
> selected package tag - and file out some classes in that tag (for exercism)
> - I could easily get the RPackageTag from any class and then use it?
> >
> > Tim
>
>
>


Re: [Pharo-users] Quality assistant

2019-02-15 Thread Denis Kudriashov
Hi Hilaire

Use following script to disable it:

ClyCriticBrowserPlugin disable


пт, 15 февр. 2019 г. в 19:56, Hilaire :

> So, no option to turn it off I guess?
>
> Hilaire
>
> Le 14/02/2019 à 12:03, Hilaire a écrit :
> > How to turn off the quality assitant in the calypso browser?
> >
> > I don't find anymore the option in the settings browser.
>
> --
> Dr. Geo
> http://drgeo.eu
>
>
>
>


Re: [Pharo-users] [TelePharo] Error in remote playground..

2019-02-12 Thread Denis Kudriashov
I think it would be enough to do on client side

12 февр. 2019 г. 21:23 пользователь "Denis Kudriashov" 
написал:

Checkout dev branch using iceberg

12 февр. 2019 г. 21:10 пользователь "sergio ruiz" 
написал:

I am not sure I follow..

Do you mean grab the source from github using Iceberg?

Thanks!

On February 12, 2019 at 4:03:25 PM, Denis Kudriashov (dionisi...@gmail.com)
wrote:

Ah, it needs new release.
Try load dev versions of telepharo and seamless from Iceberg



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


Re: [Pharo-users] [TelePharo] Error in remote playground..

2019-02-12 Thread Denis Kudriashov
Checkout dev branch using iceberg

12 февр. 2019 г. 21:10 пользователь "sergio ruiz" 
написал:

I am not sure I follow..

Do you mean grab the source from github using Iceberg?

Thanks!

On February 12, 2019 at 4:03:25 PM, Denis Kudriashov (dionisi...@gmail.com)
wrote:

Ah, it needs new release.
Try load dev versions of telepharo and seamless from Iceberg



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


Re: [Pharo-users] [TelePharo] Error in remote playground..

2019-02-12 Thread Denis Kudriashov
Ah, it needs new release.
Try load dev versions of telepharo and seamless from Iceberg

12 февр. 2019 г. 20:45 пользователь "sergio ruiz" 
написал:

Hey, all..

I am now able to connect to my remote image, but I am having one more issue.

When opening a remote playground and trying to manipulate objects, i am
getting:


ideas?

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


Re: [Pharo-users] Calypso documentation? Or understanding menu building

2019-02-12 Thread Denis Kudriashov
Hi Tim

вт, 12 февр. 2019 г. в 13:42, Tim Mackinnon :

> Is there any documentation on Calypso   application contexts? I am trying
> to add a menu item to a package tag (the bit underneath a package - which I
> often call a sub-package).
>

Only class comments are available for Calypso. Also there are a Commander
booklet which
describes contexts and ClassAnnotation github readme
 (together with class
comments).


>
> I’ve specified:
>
> ^CmdContextMenuActivation
> byItemOf: ClyQueryMenuGroup for: RPackage
> asCalypsoItemContext
>
>
The #for: argument of command activations is a context where command should
be available. Context describes condition where given command (its
activation strategy) should be visible for users.
In your example "RPackage asCalypsoItemContext" is an instance of
ClyBrowserItemContext which matches any selected package in the browser
(when a kind of RPackage is selected).
And that's why you do not see it on selected tag because the tag is not a
package.

But that puts my menu on the package and not the tag

- and if I use the inspect extra menu in calypso, I get what looks to be
> something that could help me determine what I want but I’m struggling to
> understand what ClyTaggedClassGroup does, and what a context is all about.
>

Inspect command opens inspector of actually selected object which is an
instance of ClyTaggedClassGroup in that case (try inspect selected method
and you will get a CompiledMethod).
Children of package in browser are instances of ClyClassGroup and
subclasses. So they are not raw tags. If you need a command for a tag you
should add a command for ClyTaggedClassGroup items:

^CmdContextMenuActivation
byItemOf: ClyQueryMenuGroup for: ClyTaggedClassGroup
asCalypsoItemContext

Look for example at SycPromotePackageFromTagCommand
class>>#fullBrowserMenuActivation which is defined this way.

There are other kind of contexts which can be used in command annotations.
For example if you want a command for selected method only in full browser
then you should use ClyMethodContextOfFullBrowser:

^CmdContextMenuActivation byItemOf: ClyQueryMenuGroup for:
ClyMethodContextOfFullBrowser


it can be confusing that simple class is used in this case. But underhood
it is converted to the instance of context where command should be
available.


>
> Has anyone else played around with this at all?
>
> Ideally I want to have a menu appear on all the tags underneath a
> particular package - and possibly including that package (or maybe not - I
> haven’t decided as I want to try it in the wild).
>
> While I’m at it - I have quite understood how to create submenu’s either -
> as I’d like to have several commands all as sub items of a menu item
> “Exercism”.
>

Look at commander booklet. It includes example.


>
> Tim
>
>
>
>


Re: [Pharo-users] Loading TelePharo on Pharo 7

2019-02-12 Thread Denis Kudriashov
Following script will load TelePharo without error:

Metacello new
  baseline: 'TelePharo';
  repository: 'github://pharo-ide/TelePharo';
  onUpgrade: [:ex | ex useIncoming];
  onConflictUseIncoming;
  load.



пн, 11 февр. 2019 г. в 09:11, Denis Kudriashov :

> Hi Serge.
>
> You need to add option to metacello script onConflict: or onUpgrade: with
> block [:warn | warn useIncoming].
> I do not have computer now to give you exact code.
>
> Problem that telepharo depends on old version of Calypso but image
> includes the latest one. It needs to be fixed. I will look at it.
>
> And we should fix install scripts in readme page. It still references my
> repo but it was moved to pharo-ide org
>
> 9 февр. 2019 г. 8:05 PM пользователь "sergio ruiz" 
> написал:
>
> Hi, all..
>
> I am looking to install TelePharo on my 7.01 image using the setup found
> at :
>
> https://github.com/pharo-ide/TelePharo
>
> like
>
> Metacello new
>   baseline: 'TelePharo';
>   repository: 'github://dionisiydk/TelePharo';
>   load: 'Server’.
>
> and running into the following error. Any ideas?
>
> Thanks!
>
> MetacelloAllowConflictingProjectUpgrade>>defaultAction
> UndefinedObject>>handleSignal:
> Context>>handleSignal:
> Context>>handleSignal:
> MetacelloAllowConflictingProjectUpgrade(Exception)>>pass
> [ ^ exception pass ] in MetacelloScriptEngine>>handleConflict: in Block: [ ^ 
> exception pass ]
> Dictionary>>at:ifAbsent:
> MetacelloScriptEngine>>handleConflict:
> MetacelloAllowConflictingProjectUpgrade>>handleResolutionFor:
> [ :ex | "option handlers need to be outermost set of handlers ... last line 
> of defense before users are involved" ex handleResolutionFor: self ] in [ [ 
> actionBlock
> on:
> MetacelloLookupProjectSpec , MetacelloLookupProjectSpecForLoad
> , MetacelloProjectSpecLoadedNotification
> , MetacelloScriptEnsureProjectLoadedForDevelopment
> , MetacelloLookupBaselineSpecForEnsureLoad
> do:
> [ :ex | "lookup and registration handlers need to be innermost set of 
> handlers ...they may throw option notifications" ex handleResolutionFor: self 
> ] ]
> on:
> MetacelloAllowProjectDowngrade , MetacelloAllowProjectUpgrade
> , MetacelloAllowConflictingProjectUpgrade
> do:
> [ :ex | "option handlers need to be outermost set of handlers ... 
> last line of defense before users are involved" ex handleResolutionFor: self 
> ] ] in [ [ [ actionBlock
> on:
> MetacelloLookupProjectSpec , MetacelloLookupProjectSpecForLoad
> , MetacelloProjectSpecLoadedNotification
> , MetacelloScriptEnsureProjectLoadedForDevelopment
> , MetacelloLookupBaselineSpecForEnsureLoad
> do:
> [ :ex | "lookup and registration handlers need to be innermost set of 
> handlers ...they may throw option notifications" ex handleResolutionFor: self 
> ] ]
> on:
> MetacelloAllowProjectDowngrade , MetacelloAllowProjectUpgrade
> , MetacelloAllowConflictingProjectUpgrade
> do:
> [ :ex | "option handlers need to be outermost set of handlers ... 
> last line of defense before users are involved" ex handleResolutionFor: self 
> ] ]
> on: MetacelloAllowLockedProjectChange
> do:
> [ :ex | "MetacelloAllowLockedProjectChange need to be outermost 
> handler ... since it is signaled from second line of handlers" ex 
> handleResolutionFor: self ] ] in 
> MetacelloScriptEngine>>handleNotificationsForAction: in Block: [ :ex | 
> "option handlers need to be outermost set ...etc...
> BlockClosure>>cull:
> Context>>evaluateSignal:
> Context>>handleSignal:
> MetacelloAllowConflictingProjectUpgrade(Exception)>>signal
> [ :existing :new |
> (existing hasLoadConflicts: new)
> ifTrue: [ ((existing canUpgradeTo: new)
> ifTrue: [ MetacelloAllowProjectUpgrade new ]
> ifFalse: [ (existing canDowngradeTo: new)
> ifTrue: [ MetacelloAllowProjectDowngrade new ]
> ifFalse: [ MetacelloAllowConflictingProjectUpgrade new ] 
> ])
> existingProjectRegistration: existing;
> newProjectRegistration: new;
> signal ]
> ifFalse: [ new ] ] in MetacelloScriptEngine>>lookupProjectSpecFor: in 
> Block: [ :existing :new | ...
> [ :existing | ^ presentBlock value: existing value: newRegistration ] in 
> MetacelloProjectRegistration 
> class>>registrationForProjectSpec:ifAbsent:ifPresent: in Block: [ :existing | 
> ^ pres

Re: [Pharo-users] Loading TelePharo on Pharo 7

2019-02-11 Thread Denis Kudriashov
Hi Serge.

You need to add option to metacello script onConflict: or onUpgrade: with
block [:warn | warn useIncoming].
I do not have computer now to give you exact code.

Problem that telepharo depends on old version of Calypso but image includes
the latest one. It needs to be fixed. I will look at it.

And we should fix install scripts in readme page. It still references my
repo but it was moved to pharo-ide org

9 февр. 2019 г. 8:05 PM пользователь "sergio ruiz" 
написал:

Hi, all..

I am looking to install TelePharo on my 7.01 image using the setup found at
:

https://github.com/pharo-ide/TelePharo

like

Metacello new
  baseline: 'TelePharo';
  repository: 'github://dionisiydk/TelePharo';
  load: 'Server’.

and running into the following error. Any ideas?

Thanks!

MetacelloAllowConflictingProjectUpgrade>>defaultAction
UndefinedObject>>handleSignal:
Context>>handleSignal:
Context>>handleSignal:
MetacelloAllowConflictingProjectUpgrade(Exception)>>pass
[ ^ exception pass ] in MetacelloScriptEngine>>handleConflict: in
Block: [ ^ exception pass ]
Dictionary>>at:ifAbsent:
MetacelloScriptEngine>>handleConflict:
MetacelloAllowConflictingProjectUpgrade>>handleResolutionFor:
[ :ex | "option handlers need to be outermost set of handlers ... last
line of defense before users are involved" ex handleResolutionFor:
self ] in [ [ actionBlock
on:
MetacelloLookupProjectSpec , MetacelloLookupProjectSpecForLoad
, MetacelloProjectSpecLoadedNotification
, MetacelloScriptEnsureProjectLoadedForDevelopment
, MetacelloLookupBaselineSpecForEnsureLoad
do:
[ :ex | "lookup and registration handlers need to be innermost
set of handlers ...they may throw option notifications" ex
handleResolutionFor: self ] ]
on:
MetacelloAllowProjectDowngrade , MetacelloAllowProjectUpgrade
, MetacelloAllowConflictingProjectUpgrade
do:
[ :ex | "option handlers need to be outermost set of handlers
... last line of defense before users are involved" ex
handleResolutionFor: self ] ] in [ [ [ actionBlock
on:
MetacelloLookupProjectSpec , MetacelloLookupProjectSpecForLoad
, MetacelloProjectSpecLoadedNotification
, MetacelloScriptEnsureProjectLoadedForDevelopment
, MetacelloLookupBaselineSpecForEnsureLoad
do:
[ :ex | "lookup and registration handlers need to be innermost
set of handlers ...they may throw option notifications" ex
handleResolutionFor: self ] ]
on:
MetacelloAllowProjectDowngrade , MetacelloAllowProjectUpgrade
, MetacelloAllowConflictingProjectUpgrade
do:
[ :ex | "option handlers need to be outermost set of handlers
... last line of defense before users are involved" ex
handleResolutionFor: self ] ]
on: MetacelloAllowLockedProjectChange
do:
[ :ex | "MetacelloAllowLockedProjectChange need to be
outermost handler ... since it is signaled from second line of
handlers" ex handleResolutionFor: self ] ] in
MetacelloScriptEngine>>handleNotificationsForAction: in Block: [ :ex |
"option handlers need to be outermost set ...etc...
BlockClosure>>cull:
Context>>evaluateSignal:
Context>>handleSignal:
MetacelloAllowConflictingProjectUpgrade(Exception)>>signal
[ :existing :new |
(existing hasLoadConflicts: new)
ifTrue: [ ((existing canUpgradeTo: new)
ifTrue: [ MetacelloAllowProjectUpgrade new ]
ifFalse: [ (existing canDowngradeTo: new)
ifTrue: [ MetacelloAllowProjectDowngrade new ]
ifFalse: [ MetacelloAllowConflictingProjectUpgrade new ] ])
existingProjectRegistration: existing;
newProjectRegistration: new;
signal ]
ifFalse: [ new ] ] in MetacelloScriptEngine>>lookupProjectSpecFor:
in Block: [ :existing :new | ...
[ :existing | ^ presentBlock value: existing value: newRegistration ]
in MetacelloProjectRegistration
class>>registrationForProjectSpec:ifAbsent:ifPresent: in Block: [
:existing | ^ presentBlock value: existing value...etc...
[ :existing | ^ presentBlock value: existing ] in
MetacelloProjectRegistry>>registrationFor:ifPresent:ifAbsent: in
Block: [ :existing | ^ presentBlock value: existing ]
BlockClosure>>cull:
Dictionary>>at:ifPresent:
MetacelloProjectRegistry>>registrationFor:ifPresent:ifAbsent:
MetacelloProjectRegistration
class>>registrationForProjectSpec:ifAbsent:ifPresent:
MetacelloScriptEngine>>lookupProjectSpecFor:
MetacelloScriptEngine>>handleLookupProjectSpec:
MetacelloLookupProjectSpec>>handleResolutionFor:
[ :ex | "lookup and registration handlers need to be innermost set of
handlers ...they may throw option notifications" ex
handleResolutionFor: self ] in [ actionBlock
on:
MetacelloLookupProjectSpec , MetacelloLookupProjectSpecForLoad
, MetacelloProjectSpecLoadedNotification
, MetacelloScriptEnsureProjectLoadedForDevelopment
, MetacelloLookupBaselineSpecForEnsureLoad
do:

Re: [Pharo-users] Slots doc

2019-02-06 Thread Denis Kudriashov
Would be nice to have a command in browser to show users of selected slot

6 февр. 2019 г. 11:32 пользователь "Vitor Medina Cruz" 
написал:

I couldn't find examples of Slot usage. Is there any ackage I can load that
use it so that I can look as an example?

On Mon, Feb 4, 2019 at 6:17 PM webwarrior  wrote:

> Vitor Medina Cruz wrote
> > Thanks, I had already read this paper, which got me interested in the
> > concept of slots :) . Is it a prototype in Pharo or is ready to use? it
> > will become as an official part of it?
> >
> >
> > On Sun, Feb 3, 2019 at 10:13 AM Ben Coman 
>
> > btc@
>
> >  wrote:
> >
> >>
> >>
> >> On Sun, 3 Feb 2019 at 17:50, Todd Blanchard via Pharo-users <
> >>
>
> > pharo-users@.pharo
>
> >> wrote:
> >>
> >>> Seems like an opportunity...I have no idea what the addition of slots
> >>> does but I would like to learn.
> >>>
> >>> On Feb 3, 2019, at 1:33 AM, ducasse 
>
> > stepharo@
>
> >  wrote:
> >>>
> >>> Hello,
> >>>
> >>> Where I can find documentation for slots?
> >>>
> >>> I am trying to access the pharo books site but it is unreachable from
> my
> >>> network right now, I got a connection time out (It works from my 3G
> >>> though
> >>> (??) ), but if I remember correctly the is no slot description in any
> >>> book.
> >>>
> >>> Regards,
> >>> Vitor
> >>>
> >>>
> >>> Hello victor
> >>>
> >>> There is no documentation about slots that I know. I’m sorry.
> >>> Marcus may want to write one in the future.
> >>>
> >>> Stef
> >>>
> >>>
> >> I believe its an implementation of this paper...
> >>
> >>
> https://rmod.inria.fr/archives/papers/Verw11a-OOSPLA11-FlexibleObjectLayouts.pdf
> >>
> >>
> >> cheers -ben
> >>
>
> Slots are already part of Pharo and are totally useable.
> Some example slots are buggy though.
>
> Explore Slot and subclasses, their class comments and methods.
>
> One thing to note is if you change #emitStore: or #emitValue: methods in
> your slot class, you need to trigger change in classes that use it.
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] Non-greedy RegEx?

2019-02-05 Thread Denis Kudriashov
We can also update pharo version from original VW repositoriy if the
current license is appropriate. I think it covers missing parts.

5 февр. 2019 г. 7:34 пользователь "Esteban Lorenzano" 
написал:

Hi,

Yes, Pharo regex implementation is very naive.
We will be moving to a PCRE binding to match outside world standards but we
have not had the time to work on it :(


Esteban


> On 5 Feb 2019, at 00:27, Manuel Leuenberger 
wrote:
>
> Hi,
>
> I just noticed that the Pharo regexes do not understand non-greedy
matches. A regex engine to be PCRE is kind of essential, not having '.*?'
to be a parseable and working regex is a bummer. Are there any more
powerful regex engines around for Pharo? I could not find any.
>
> Cheers,
> Manuel
>
>


Re: [Pharo-users] package extensions in Pharo 7.

2019-02-05 Thread Denis Kudriashov
Hi Paul.

вс, 3 февр. 2019 г., 19:57 PAUL DEBRUICKER pdebr...@gmail.com:

> Hi -
>
>
> Is there a way to create the protocol, then convert it to an extension,
> without adding a method to it between the time I create the protocol and
> convert it to an extension?


No.
In Calypso there is no such thing as extension protocol. There is explicit
packaging of methods. When you create method you can toggle extension
checkbox in status bar and select a package where method should be created.
Same procedure can be applied on existing method.

I tried to avoid star convention when I designed Calypso. I think it is a
ugly hack because package is not a protocol. But seems it is badly accepted
by people. So it could be reverted at some point. But I believe it is
better to improve/fix things which does not work well with current
approach.

Seems like it if the protocol is empty when I convert it to an extension it
> gets deleted rather than converted.


It needs to be improved to avoid such confusion


> Would anyone be interested in having the thing that parses protocol names
> automatically create extension protocols from names that start with *
> instead of rejecting them immediately?
>
>
> IS the new extension stuff cross platform compatible right now or do I
> have to do anything else to port these methods & protocols to Squeak and
> GemStone?
>

 Calypso only touches UI. Nothing is changed on how extension sources are
stored in files. It's stil based on star protocols. So it is compatible


>
> Thanks
>
>
> Paul
>


Re: [Pharo-users] [VIDEO TUTORIAL] How to use external code editors to code in Pharo

2019-01-25 Thread Denis Kudriashov
Hi.

Now settings browser includes all Commander based shortcuts which is all
calypso and Iceberg shortcuts in current image.

In addition there is a special spotter menu in Calypso to find any
available command (not only shortcut based).

пт, 25 янв. 2019 г., 15:45 Tim Mackinnon tim@testit.works:

>
>
> On 25 Jan 2019, at 13:36, Esteban Maringolo  wrote:
>
> I think this feature is so convenient that it should not only be
> visible, but have a menu item of its own.
>
>
> It did originally have a menu entry - however when PR’d I agreed with
> Denis to take it out as it kind of cluttered the context menu.
>
> The old Nautilus had a keystrokes menu that listed them all for you - but
> I think we have lost that in Calypso? There are some that appear in the
> settings, but I’m not sure its all of them.
>
> Tim
>


Re: [Pharo-users] #select was sent to nil

2019-01-15 Thread Denis Kudriashov
Hi Andrei.
The error is related to absent package of selected method.
Calypso assumes that method always has a package because otherwise many
other things will not work.
Even if this case will be protected by ifNotNil check it looks like a
broken system state.

Can you check following script?

SystemNavigation default allMethodsSelect: [ :each | each package isNil ]



вт, 15 янв. 2019 г. в 16:08, Andrei Chis :

> I also get every few clicks the error below.
>
> [image: Screen Shot 2019-01-15 at 17.00.41.png]
>
> On Tue, Jan 15, 2019 at 4:59 PM Andrei Chis 
> wrote:
>
>> I think I get the same error in a GToolkit image that I build today on
>> top of
>> Pharo-7.0.0+rc1.build.121.sha.0640e0d300e69541033fb1c4270c9b0d7d401b01 (64
>> Bit).
>>
>> [image: Screen Shot 2019-01-15 at 16.52.51.png]
>>
>> In `ClyIcebergShowMethodVersionCommand>>canBeExecutedInContext:`
>> executing `aToolContext lastSelectedMethod package` returns nil. So I get a
>> compiled method having the package as nil.
>>
>> The error seems to happen more randomly, but after selecting 3-4 methods
>> from a package where I did a commit using iceberg it mostly appears.
>>
>>
>>
>> UndefinedObject(Object)>>doesNotUnderstand: #name
>> [ :each | each includesPackageNamed: aPackage name ] in IceRepository
>> class>>registeredRepositoryIncludingPackage: in Block: [ :each | each
>> includesPackageNamed: aPackage name...etc...
>> [ :each |
>> (aBlock value: each)
>> ifTrue: [ ^ foundBlock cull: each ] ] in
>> OrderedCollection(Collection)>>detect:ifFound:ifNone: in Block: [ :each |
>> ...
>> OrderedCollection>>do:
>> OrderedCollection(Collection)>>detect:ifFound:ifNone:
>> OrderedCollection(Collection)>>detect:ifNone:
>> IceRepository class>>registeredRepositoryIncludingPackage:
>> ClyIcebergShowMethodVersionCommand class>>canBeExecutedInContext:
>> ClyMethodContextOfFullBrowser(CmdToolContext)>>allowsExecutionOf:
>>
>> ClyBrowserTabCommandActivation(CmdCommandActivationStrategy)>>isActiveInContext:
>> CmdCommandActivator>>canExecuteCommand
>> CmdCommandActivator>>buildBrowserTabActions
>> CmdCommandMenuItem>>buildBrowserTabActions
>> [ :each | each buildBrowserTabActions ] in
>> CmdRootMenuGroup(CmdMenuGroup)>>buildBrowserTabActions in Block: [ :each |
>> each buildBrowserTabActions ]
>> [ :each | col addAll: (aBlock value: each) ] in
>> SortedCollection(Collection)>>flatCollect:as: in Block: [ :each | col
>> addAll: (aBlock value: each) ]
>> SortedCollection(OrderedCollection)>>do:
>> SortedCollection(Collection)>>flatCollect:as:
>> SortedCollection>>flatCollect:
>> CmdRootMenuGroup(CmdMenuGroup)>>buildBrowserTabActions
>> CmdMenu>>buildBrowserTabActions
>> ClyMethodCodeEditorToolMorph(ClyBrowserToolMorph)>>createTab
>> ClyTabManager>>addTool:
>> [ :each | self addTool: each ] in ClyTabManager>>updateTabsWith: in
>> Block: [ :each | self addTool: each ]
>> OrderedCollection>>do:
>> ClyTabManager>>updateTabsWith:
>> [ newTools := OrderedCollection new.
>> browser
>> navigationContextsDo: [ :each | self buildToolsOn: newTools for: each ].
>> needsNewSelection := self requiresNewDesiredSelection.
>> selectedTools := self selectedTools.
>> currentTools := tools copy.
>> self updateTabsWith: newTools.
>> tools ~= currentTools | needsNewSelection
>> ifTrue: [ self restoreSelectedTools: selectedTools ] ] in
>> ClyTabManager>>updateTools in Block: [ newTools := OrderedCollection new
>> BlockClosure>>ensure:
>> ClyTabManager>>updateToolsBy:
>> ClyTabManager>>updateTools
>> ClyFullBrowser(ClyBrowserMorph)>>rebuildAllTools
>>
>>
>> On Tue, Jan 15, 2019 at 10:23 AM Denis Kudriashov 
>> wrote:
>>
>>> Hi Hilaire.
>>>
>>> Can you reproduce it?
>>>
>>> пн, 14 янв. 2019 г. в 23:24, Hilaire via Pharo-users <
>>> pharo-users@lists.pharo.org>:
>>>
>>>> Hi,
>>>>
>>>> After installing drgeo and save some modification on tonel repo. I got
>>>> this persisting error on calypso whatever the button I click on the
>>>> browser ui.
>>>>
>>>> Hilaire
>>>>
>>>> --
>>>> Dr. Geo
>>>> http://drgeo.eu
>>>>
>>>>


Re: [Pharo-users] #select was sent to nil

2019-01-15 Thread Denis Kudriashov
Hi Hilaire.

Can you reproduce it?

пн, 14 янв. 2019 г. в 23:24, Hilaire via Pharo-users <
pharo-users@lists.pharo.org>:

> Hi,
>
> After installing drgeo and save some modification on tonel repo. I got
> this persisting error on calypso whatever the button I click on the
> browser ui.
>
> Hilaire
>
> --
> Dr. Geo
> http://drgeo.eu
>
>


Re: [Pharo-users] Move methods to other class in P7/Calypso

2018-12-27 Thread Denis Kudriashov
Hi.

Use Drag for this.
And create issue to add this operation into context menu if needed.

ср, 26 дек. 2018 г. в 14:14, Esteban Maringolo :

> What the canonical way of moving a set of methods from one class to
> another?
>
> I couldn't find it in the contextual menu or in the refactorings.
>
> Regards,
>
> Esteban A. Maringolo
>
>


Re: [Pharo-users] Alternative to NautilusMethodSelected in Calypso

2018-12-05 Thread Denis Kudriashov
Hi Gustavo.

There is no such events in Calypso. But you can subscribe on raw table
selection changes like:

browser classView table onAnnouncement: FTSelectionChanged do: [:ann |

browser classSelection actualObjects "==> real class objects"]

You will need create subclass of ClyBrowserPlugin. And add this logic into
#browser: method.



вт, 4 дек. 2018 г. в 17:47, Gustavo Santos :

> Hello,
>
> I'm trying to upgrade MacroRecorder to Pharo7.
> I used NautilusClassSelected and NautilusMethodSelected announcements to
> apply a macro in a given class or method right after the developer clicks
> on the browser. Something like
>
> AbstractNautilusPlugin subclass: #MRNautilusPlugin ...
>
> registerTo: aModel
>   aModel announcer weak
> when: NautilusClassSelected  send: #entitySelected: to: self;
> when: NautilusMethodSelected send: #entitySelected: to: self.
>
> How can I do the same with Calypso?
>
> Cheers,
> --
> Gustavo Santos
> http://gustavojss.github.io/
>


Re: [Pharo-users] Problems with Firmata & Arduino UNO Clone

2018-11-27 Thread Denis Kudriashov
Hi William.

I think Serial port does not work in MacOS VM.

пн, 26 нояб. 2018 г. в 21:59, William L. Cleveland :

> I have been unsuccessful in using an Arduino board with Pharo 6.1(32bit)
> and the Firmata package.
>
>
>
> The board is an Arduino Uno clone (ELEGOO UNO R3). The board appears to
> work fine with the Arduino IDE, which was tested with the BLINK program.
> The Standard Firmata Library appears to have been successfully uploaded to
> the board using the Arduino IDE.
>
>
>
> COM ports have been closed using
>
> SerialPort allInstancesDo: [:port|port close].
>
> On Windows 10, SerialPort inspect shows that ports are closed. However,
> firmata := Firmata onPort: ‘COM3’ baudRate: 576000 failed due to failure to
> open COM3. The serial port name was obtained from the Arduino IDE Tools
> menu. The board choice was “Arduino Uno”.
>
>
>
>
>
> In MacOS 10.11.6, the same code generated a Cannot open comport message.
>
>
>
> Independently of Firmata, the following line of code SerialPort
> allInstancesDo: [:port| port close] generated the following error message:
> “Instance of BlockClosure did not understand #SerialPort. The same code
> worked fine in Windows.
>
>
>
> I am wondering if the SerialPort code in Pharo6.1 is sufficiently robust
> for a nonexpert programmer like myself, who only occasionally writes code
> for his own use. Previously, I wrote an application for a robotics project
> in 2008 using VisualWorks and the DLL tool, which was quite
> successful. No more coding until just recently, when I started using
> Python.  Would like to go back to Smalltalk if it is sufficiently robust.
>
>
>
> Any help would be appreciated.
>
>
> Lou Cleveland
>


Re: [Pharo-users] adding instance variables (data) to the Object class

2018-09-07 Thread Denis Kudriashov
Talents with statefull traits will help you

пт, 7 сент. 2018 г., 9:08 Marcus Denker :

>
>
> On 6 Sep 2018, at 23:35, Petr Fischer via Pharo-users <
> pharo-users@lists.pharo.org> wrote:
>
>
> *From: *Petr Fischer 
> *Subject: **adding instance variables (data) to the Object class*
> *Date: *6 September 2018 at 23:35:26 CEST
> *To: *pharo-users@lists.pharo.org
>
>
> Hello! Weird question: why I can't add instance variables to the Object
> class (for example "oid" or something else)? Is it due to some internal
> (and different) VM "class layouts"?
>
> Or - can I inject my own information to all existing objects (any class)?
>
>
> Behavior is a subclass of Object, too. So that means that you would add a
> ivar to all the classes, but for the VM an object can only be a class that
> has three ivars, and those
> are accessed by offset. So if you add an ivar, you shift the offset —>
> problem.
>
> As for “I want to add object specific state”: it would be nice to add an
> easy to use (and efficient) mechanism to do it.
>
> Marcus
>


Re: [Pharo-users] How best to cope with 2 editor/browser frameworks - Calypso and RubSmalltalkEditor

2018-08-21 Thread Denis Kudriashov
Hi Tim.

Currently commands are loaded after rubric. So RubSmalltalkEditor can't use
them directly.

2018-08-21 13:03 GMT+01:00 Tim Mackinnon :

> AH - this makes sense then that SystemCommands is in its own Repo then
> (although all these tiny repos get quite difficult the track so you can
> understand where/how to contribute).
>
> This leads to another question - if I stick my commands for extend
> selection and jump to keyword in SystemCommands - is the load order such
> that RubSmalltalkEditor can safely access those commands (I know that for
> Calypso its ok, but can I reference those commands in the older
> RubSmalltalkEditor). Otherwise I will need to put the guts of my commands
> in the RubSmalltalkCodeMode which is shared by al editors (but it feels a
> bit too generic place for textMorph navigation stuff).
>
> Tim
>
>
>
> On 21 Aug 2018, at 05:48, Esteban Lorenzano  wrote:
>
> Hi,
>
> On 20 Aug 2018, at 00:39, Denis Kudriashov  wrote:
>
>
> 2018-08-19 23:12 GMT+01:00 Tim Mackinnon :
>
>> Thanks Denis - I guess for now I can put the methods in
>> RubSmalltalkEditor so that the playground can operate and then my Calypso
>> plugins can also reference that code too (if class methods).
>>
>> Is the idea that playground will become part of Calypso too?
>>
>
> No.
> What we can try to achieve is to reused Commander everywhere. So these
> SystemCommands will be reused by different tools.
>
>
> Yes, this is what we are targeting, to have a centralised command library
> that manages all system commands (so we do not need to duplicate code all
> around).
> With enough time to implement, all tools will use same command mechanism.
>
> Esteban
>
>
>
>> If so, I can add the methods I need as an extension (although I guess
>> this won’t work as the keyboard mapping for playground in one method and
>> not extensible like Calypso which uses pragmas).
>>
>> I’ll do something as a pr and we can figure it out.
>>
>> It’s worth saying, that for my Calypso plugins I’ve had to abuse your
>> mechanism a bit as the simple #execute mechanism doesn’t give me access  to
>> the text morph to control the cursor. I was able to do it though via the
>> prompting mechanism (I just don’t show any ui prompt).
>>
>> Tim
>>
>> Sent from my iPhone
>>
>> On 19 Aug 2018, at 14:28, Denis Kudriashov  wrote:
>>
>> Hi.
>>
>> I dont't know answer to your question. But for the note:
>> Calypso was needed to override existing way to spawn implementors/senders
>> and so on. So I added subclass of RubSmalltalkEditor - ClyTextEditor which
>> overrides required methods.
>> So if you will put new methods into the RubSmalltalkEditor then Calypso
>> will be able to use them.
>>
>> 2018-08-19 16:55 GMT+01:00 Tim Mackinnon :
>>
>>> Hi I’m trying to work out the best way to cope with the fact that we are
>>> in a hybrid place where the Playground is using an RubSmalltalkEditor but
>>> Calypso has its own mechanisms for editing code.
>>>
>>> I have commands that should/can work in both the playground as well as
>>> code method editor (in Calypso).
>>>
>>> Previously my code lived in RubSmalltalkEditor and Nautilus was using
>>> that too - but now I’m not sure where to put some reusable methods that use
>>> RBParser and the AST to find the best place to position your cursor.
>>>
>>> I can make a class method on RubSmalltalkEditor and Calypso commands
>>> could reference that (but that feels wrong somehow). I could make some
>>> extension methods on RBParser and both places reference that - but then who
>>> should own the extension method (as I think RubSmalltalkEditor is lower
>>> level and Calypso is then loaded on top).
>>>
>>> Anyone have some good suggestions?
>>>
>>> Tim
>>>
>>
>>
>
>
>


Re: [Pharo-users] How best to cope with 2 editor/browser frameworks - Calypso and RubSmalltalkEditor

2018-08-19 Thread Denis Kudriashov
2018-08-19 23:12 GMT+01:00 Tim Mackinnon :

> Thanks Denis - I guess for now I can put the methods in RubSmalltalkEditor
> so that the playground can operate and then my Calypso plugins can also
> reference that code too (if class methods).
>
> Is the idea that playground will become part of Calypso too?
>

No.
What we can try to achieve is to reused Commander everywhere. So these
SystemCommands will be reused by different tools.


> If so, I can add the methods I need as an extension (although I guess this
> won’t work as the keyboard mapping for playground in one method and not
> extensible like Calypso which uses pragmas).
>
> I’ll do something as a pr and we can figure it out.
>
> It’s worth saying, that for my Calypso plugins I’ve had to abuse your
> mechanism a bit as the simple #execute mechanism doesn’t give me access  to
> the text morph to control the cursor. I was able to do it though via the
> prompting mechanism (I just don’t show any ui prompt).
>
> Tim
>
> Sent from my iPhone
>
> On 19 Aug 2018, at 14:28, Denis Kudriashov  wrote:
>
> Hi.
>
> I dont't know answer to your question. But for the note:
> Calypso was needed to override existing way to spawn implementors/senders
> and so on. So I added subclass of RubSmalltalkEditor - ClyTextEditor which
> overrides required methods.
> So if you will put new methods into the RubSmalltalkEditor then Calypso
> will be able to use them.
>
> 2018-08-19 16:55 GMT+01:00 Tim Mackinnon :
>
>> Hi I’m trying to work out the best way to cope with the fact that we are
>> in a hybrid place where the Playground is using an RubSmalltalkEditor but
>> Calypso has its own mechanisms for editing code.
>>
>> I have commands that should/can work in both the playground as well as
>> code method editor (in Calypso).
>>
>> Previously my code lived in RubSmalltalkEditor and Nautilus was using
>> that too - but now I’m not sure where to put some reusable methods that use
>> RBParser and the AST to find the best place to position your cursor.
>>
>> I can make a class method on RubSmalltalkEditor and Calypso commands
>> could reference that (but that feels wrong somehow). I could make some
>> extension methods on RBParser and both places reference that - but then who
>> should own the extension method (as I think RubSmalltalkEditor is lower
>> level and Calypso is then loaded on top).
>>
>> Anyone have some good suggestions?
>>
>> Tim
>>
>
>


Re: [Pharo-users] How best to cope with 2 editor/browser frameworks - Calypso and RubSmalltalkEditor

2018-08-19 Thread Denis Kudriashov
2018-08-19 23:12 GMT+01:00 Tim Mackinnon :

> Thanks Denis - I guess for now I can put the methods in RubSmalltalkEditor
> so that the playground can operate and then my Calypso plugins can also
> reference that code too (if class methods).
>
> Is the idea that playground will become part of Calypso too? If so, I can
> add the methods I need as an extension (although I guess this won’t work as
> the keyboard mapping for playground in one method and not extensible like
> Calypso which uses pragmas).
>
> I’ll do something as a pr and we can figure it out.
>
> It’s worth saying, that for my Calypso plugins I’ve had to abuse your
> mechanism a bit as the simple #execute mechanism doesn’t give me access  to
> the text morph to control the cursor. I was able to do it though via the
> prompting mechanism (I just don’t show any ui prompt).
>

I think in that case your commands can have inst var textMorph because they
work with it, they modify its state (cursor). Idea behind commands that
they should be self contained objects. You should be able create them in
workspace, initialize them with required state without any notion of
context and #execute them. Context is only clue to access commands from
application.

So try to retrieve state in prepare method like:

prepareFullExecutionInContext: aToolContext

textMorph := aToolContext tool textMorph


(chain is not good but it is what exists for now).

It also possible that I misunderstood your problem :)


> Tim
>
> Sent from my iPhone
>
> On 19 Aug 2018, at 14:28, Denis Kudriashov  wrote:
>
> Hi.
>
> I dont't know answer to your question. But for the note:
> Calypso was needed to override existing way to spawn implementors/senders
> and so on. So I added subclass of RubSmalltalkEditor - ClyTextEditor which
> overrides required methods.
> So if you will put new methods into the RubSmalltalkEditor then Calypso
> will be able to use them.
>
> 2018-08-19 16:55 GMT+01:00 Tim Mackinnon :
>
>> Hi I’m trying to work out the best way to cope with the fact that we are
>> in a hybrid place where the Playground is using an RubSmalltalkEditor but
>> Calypso has its own mechanisms for editing code.
>>
>> I have commands that should/can work in both the playground as well as
>> code method editor (in Calypso).
>>
>> Previously my code lived in RubSmalltalkEditor and Nautilus was using
>> that too - but now I’m not sure where to put some reusable methods that use
>> RBParser and the AST to find the best place to position your cursor.
>>
>> I can make a class method on RubSmalltalkEditor and Calypso commands
>> could reference that (but that feels wrong somehow). I could make some
>> extension methods on RBParser and both places reference that - but then who
>> should own the extension method (as I think RubSmalltalkEditor is lower
>> level and Calypso is then loaded on top).
>>
>> Anyone have some good suggestions?
>>
>> Tim
>>
>
>


Re: [Pharo-users] Where (as in Git project) should Calypso browser source code commands live?

2018-08-19 Thread Denis Kudriashov
it is separate repo https://github.com/pharo-ide/SystemCommands

2018-08-19 23:12 GMT+01:00 Tim Mackinnon :

> Thanks for chipping in Denis - I guess what’s weird about this set of
> commands is that they are a bit editor specific as they all move your
> cursor or text selection to specific places (the other commands are much
> more generic).
>
> Still, I think it makes sense to put them in a sub-package like
> SystemCommands-SourceNaviagationCommands.
>
> But I guess my real question is, what project owns these commands? When I
> make changes, neither the Pharo nor Calypso projects show anything to
> commit ?
>
> Tim
>
> Sent from my iPhone
>
>
>
> Sent from my iPhone
> On 19 Aug 2018, at 14:41, Denis Kudriashov  wrote:
>
> Hi Tim.
>
> The idea was to have reusable commands to work with system objects
> (method, classes and packages). It is clear that those commands should not
> depends on browser and should be accessible from other tools. This is the
> reason why they are packaged separately (SystemCommands
> <https://github.com/pharo-ide/SystemCommands>).
>
> According to your question I would add your commands to
> SystemCommands-SourceCodeCommands package because they are bound to
> source code, not just to text editor.
>
> 2018-08-19 16:12 GMT+01:00 Tim Mackinnon :
>
>> Hi - I’ve had a few changes lined up to try and help P7 be a little more
>> IntelliJ like. But I’m not sure what package my small extensions should
>> live in?
>>
>> I used SycRenameTempCommand as an example - but it lives in a package
>> called "SystemCommands-SourceCodeCommands” - however I can’t see where
>> that package  is git versioned as when I browse the Pharo working copy, it
>> doesn’t appear. Is this some low level piece that hasn’t been moved into
>> git yet?
>>
>> My commands are - ExtendSelection (a keypress to intelligently widen the
>> selection of selected code to aid refactoring or moving code around), and
>> JumpToNextKeyword - a keystroke to intelligently jump you to where you can
>> enter a code completed keyboard or block variable etc.
>>
>> This got me thinking - about where these should live - are they in the
>> Calypso project - and would l do a PR there - or are they in Pharo and I
>> create a PR there?
>>
>> Suggestions?
>>
>> Tim
>>
>
>


Re: [Pharo-users] Where (as in Git project) should Calypso browser source code commands live?

2018-08-19 Thread Denis Kudriashov
Hi Tim.

The idea was to have reusable commands to work with system objects (method,
classes and packages). It is clear that those commands should not depends
on browser and should be accessible from other tools. This is the reason
why they are packaged separately (SystemCommands
).

According to your question I would add your commands to
SystemCommands-SourceCodeCommands
package because they are bound to source code, not just to text editor.

2018-08-19 16:12 GMT+01:00 Tim Mackinnon :

> Hi - I’ve had a few changes lined up to try and help P7 be a little more
> IntelliJ like. But I’m not sure what package my small extensions should
> live in?
>
> I used SycRenameTempCommand as an example - but it lives in a package
> called "SystemCommands-SourceCodeCommands” - however I can’t see where
> that package  is git versioned as when I browse the Pharo working copy, it
> doesn’t appear. Is this some low level piece that hasn’t been moved into
> git yet?
>
> My commands are - ExtendSelection (a keypress to intelligently widen the
> selection of selected code to aid refactoring or moving code around), and
> JumpToNextKeyword - a keystroke to intelligently jump you to where you can
> enter a code completed keyboard or block variable etc.
>
> This got me thinking - about where these should live - are they in the
> Calypso project - and would l do a PR there - or are they in Pharo and I
> create a PR there?
>
> Suggestions?
>
> Tim
>


Re: [Pharo-users] How best to cope with 2 editor/browser frameworks - Calypso and RubSmalltalkEditor

2018-08-19 Thread Denis Kudriashov
Hi.

I dont't know answer to your question. But for the note:
Calypso was needed to override existing way to spawn implementors/senders
and so on. So I added subclass of RubSmalltalkEditor - ClyTextEditor which
overrides required methods.
So if you will put new methods into the RubSmalltalkEditor then Calypso
will be able to use them.

2018-08-19 16:55 GMT+01:00 Tim Mackinnon :

> Hi I’m trying to work out the best way to cope with the fact that we are
> in a hybrid place where the Playground is using an RubSmalltalkEditor but
> Calypso has its own mechanisms for editing code.
>
> I have commands that should/can work in both the playground as well as
> code method editor (in Calypso).
>
> Previously my code lived in RubSmalltalkEditor and Nautilus was using that
> too - but now I’m not sure where to put some reusable methods that use
> RBParser and the AST to find the best place to position your cursor.
>
> I can make a class method on RubSmalltalkEditor and Calypso commands could
> reference that (but that feels wrong somehow). I could make some extension
> methods on RBParser and both places reference that - but then who should
> own the extension method (as I think RubSmalltalkEditor is lower level and
> Calypso is then loaded on top).
>
> Anyone have some good suggestions?
>
> Tim
>


Re: [Pharo-users] Pharo 7 file streams guideline

2018-07-23 Thread Denis Kudriashov
Hi.

I wonder does not stdout and stdin are always about text input/output?
I never saw examples when somebody explicitly write raw bytes into these
streams.

If I am right then it is better to introduce binaryStdout and binaryStdin
messages. And make stdout and stdin use most common encoding by default.
How it is done in Java?


2018-07-23 19:19 GMT+01:00 Alistair Grant :

> Hi Pavel & Sven,
>
> Thanks for writing this, it is a great quick reference.
>
>
> On Mon, 23 Jul 2018 at 12:08, Sven Van Caekenberghe  wrote:
> >
> >
> >
> > > On 23 Jul 2018, at 11:13, Ben Coman  wrote:
> > >
> > > I like all the new code examples until  "Write a UTF-8 text to STDOUT"
> > > and I wonder "Stdio stdout  writeStreamDo: [ :stream | stream
> > > nextPutAll: 'a ≠ b' ]"  would better fit the pattern of the other new
> > > code.
> > > (presuming "Stdio stdout" returns a FileReference, oherwise maybe
> > > "Stdio stdoutRef" or "Stdio stdout asFileReference")
> >
> > Stdio stdout and friends just return a binary stream, hence they need
> wrapping for encoding.
> >
> > Maybe
> >
> >   Stdio stdoutAsText
> >
> > might be an idea, but this is so uncommon that I am not sure this is a
> good idea.
>
> I've written this code enough times that I'd like to see it included. :-)
>
> Maybe
>
> Stdout utf8Stdout
>
> (following the pattern of ByteArray>>utf8Decoded, String>>utf8Encoded)
>
> ?
>
> Thanks again,
> Alistair
>
>


Re: [Pharo-users] [ann] gt documenter

2018-06-17 Thread Denis Kudriashov
Hi Tudor.

This is super impressive.
What's next? Do you plan to implement IDE for writing documents,
navigation, refactorings? (senders, renames should find all places in
documents)

2018-06-13 21:57 GMT+01:00 Tudor Girba :

> Hi,
>
> We are happy to announce a new leap of GToolkit Documenter, the tool for
> manipulating live documents directly in the development environment:
> https://github.com/feenkcom/gtoolkit-documenter
>
> Documenter is part of the second generation GToolkit project, it is based
> on Bloc and works with the latest Pillar. It is mainly developed by Juraj
> Kubelka.
>
> Attached you can see a preview of how documents look like:
>
>
>
> At its core it offers a live editor for manipulating Pillar documents. The
> interaction happens seamlessly directly in the text editor, and it can be
> combined with different types of previews to serve several classes of use
> cases:
> • code documentation
> • tutorials
> • interactive data notebook
>
>
> Code documentation
> 
> Documenter complements the GToolkit Examples engine to redefine
> code documentation. When practicing example-driven development, examples
> get written as part of the typical development. Once examples exist, they
> can be quickly put together in a document to form documentation. For
> example, the linked picture shows the comment of a class containing a
> visual explanation:
> https://twitter.com/feenkcom/status/973899862482866176
>
> You can see a live example of documentation by inspecting the following
> snippet:
> GtDocumenter editorForText: BrToggleExamples comment.
>
>
> Tutorials:
> 
> Documenter offers a new experience of writing tutorials for Pharo by
> enabling the creation and embedding of Epicea change sessions directly in
> the document. For example, take a look at the following animation:
> https://twitter.com/feenkcom/status/75333972541440
>
> The document shows a method on top, and a change preview at the
> bottom showing both the code and the associated diff to the state from the
> image. Applying the change updates both the change view (no more diff), and
> method preview. This speeds up significantly the process of going through a
> tutorial. Furthermore, given that now the document shows the diff to the
> current image, the reader can safely explore alternative scenario and come
> back to the tutorial at any time without losing the overview.
>
> The size of the preview can also be adjusted live:
> https://twitter.com/feenkcom/status/1001152789874167808
> https://twitter.com/feenkcom/status/1001407762285375490
>
> You can see a live tutorial by inspecting:
> IceRepository repositoriesLocation / 'feenkcom'/ 'gtoolkit-examples' /
> 'doc' / 'tutorial' / 'examples-tutorial.pillar’.
>
>
> Interactive data notebook:
> 
> A Documenter document can also be used as an interactive notebook.
> Internally it essentially acts as a playground:
> • it supports defining variables in code snippets, and
> • the execution of code shows an embedded inspector.
>
> For example:
> https://twitter.com/feenkcom/status/996310432225820672
> https://twitter.com/feenkcom/status/1002851190475026432
>
> An example, can be seen by inspecting:
> IceRepository repositoriesLocation / 'feenkcom'/ 'gtoolkit' / 'doc' /
> 'gtoolkit' / 'gtoolkit.pillar'.
>
>
> As always, please do let us know what you think.
>
> Enjoy,
> The feenk team
>
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "If you can't say why something is relevant,
> it probably isn't."
>
>


Re: [Pharo-users] Macros?

2018-05-26 Thread Denis Kudriashov
2018-05-26 9:33 GMT+03:00 Clément Bera <bera.clem...@gmail.com>:

>
>
> On Sat, May 26, 2018 at 8:07 AM, Denis Kudriashov <dionisi...@gmail.com>
> wrote:
>
>> Hi
>>
>> 2018-05-26 8:46 GMT+03:00 Clément Bera <bera.clem...@gmail.com>:
>>
>>> Just mentioning another use-case:
>>>
>>> getDatabaseInstance
>>> ^ (Production CifTrue: [Database] CifFalse: [MockDatabase]) new
>>>
>>
>> I think following code will work:
>>
>> getDatabaseInstance
>>  ^ (Production ifTrue: [Database] ifFalse: [MockDatabase])
>> asMethodConstant new
>>
>>
>>
> Arf, obviously you try to work around the example. You can have anything
> in the block, not necessarily a constant.
>
> foo
>^ Condition  CifTrue: [self bar] CifFalse: [self baz]
>
> And I want the condition to be replaced by the contents of one block or
> the other, not just by a constant.
>

Yes, I see. It's different


>
>>>
>>>
>>> Since I use conditional compilation more often than just precompiling
>>> constants.
>>>
>>> I don't see an equivalent of asMethodConstant AST manipulation at
>>> runtime strategy in the image for this case right now but it's probably a
>>> couple lines of code with Reflectivity.
>>>
>>> On Sat, May 26, 2018 at 7:28 AM, Clément Bera <bera.clem...@gmail.com>
>>> wrote:
>>>
>>>>
>>>>
>>>> On Fri, May 25, 2018 at 10:44 PM, Esteban Lorenzano <
>>>> esteba...@gmail.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> On 25 May 2018, at 17:30, Clément Bera <bera.clem...@gmail.com> wrote:
>>>>>
>>>>> What about a preprocessor like the Java preprocessors ? The Truffle
>>>>> project relies heavily on that for high performance Java and it's quite
>>>>> nice. It's difficult to do that in Smalltalk right now.
>>>>>
>>>>> I think if you want to do what are asking for you just need to write a
>>>>> bytecode compiler extension.
>>>>>
>>>>> I did something similar in the past to have precomputed constants
>>>>> through AST manipulation at compilation time. You can find it here with
>>>>> examples: http://smalltalkhub.com/#!/~ClementBera/NeoCompiler. Once
>>>>> the code is loaded you need to recompile the examples (NeoCompilerExample
>>>>> withAllSubclassesDo: #compileAll.). With it you can write code such
>>>>> as:
>>>>> [ Smalltalk vm class ] Cvalue
>>>>> And depending if the compiler allowsPrecompilation or not, the
>>>>> bytecode compiler generates:
>>>>> Smalltalk vm class
>>>>> Or just a push literal with the precomputed value (the class
>>>>> VirtualMachine).
>>>>>
>>>>>
>>>>> this is not what #asMethodConstant provides?
>>>>>
>>>>
>>>> Can you turn asMethodConstant On and Off so you have the constant in
>>>> production and not a development time ? Typically at development time I
>>>> change the constants generated a lot and I don't want to waste time
>>>> recompiling all the time.
>>>>
>>>> But yeah, my project is from 2014. I guess instead of preprocessing you
>>>> could do everything at runtime with AST manipulation/recompilation like
>>>> in asMethodConstant.
>>>>
>>>> The main point of preprocessing IMO is to control performance, it's
>>>> just easier for me to just look at the generated bytecode and change the
>>>> preprocessor until it gets what I want, it's not always easy to run code
>>>> that will change your method at runtime quickly so you can look at the
>>>> bytecode generated.
>>>>
>>>> Anyway, I am not convinced at all something like that should be in the
>>>> base image.
>>>>
>>>>
>>>>>
>>>>> Esteban
>>>>>
>>>>> In the end I decided not to use this, but you can use it and extend it
>>>>> to support more than just constants (any AST manipulation is possible).
>>>>> Just checked it works in Pharo 6.
>>>>>
>>>>> On Fri, May 25, 2018 at 4:26 PM, Stephan Eggermont <step...@stack.nl>
>>>>> wrote:
>>>>>
>>>>>> Debiller 777 <ozovozovozo...@gmail.com>
>>>>>> wrote:
>>>>>> > Well, I've already asked about adding new literals to pharo or
>>>>>> Smalltalk in
>>>>>> > general, however this time I have a better idea:
>>>>>> > macros. Can they be added? Because if I understand correctly they
>>>>>> may be
>>>>>> > the only way to do that.
>>>>>>
>>>>>> Why do you think they would be a good idea? We have powerful
>>>>>> meta-programming facilities that are well understood and somewhat
>>>>>> supported
>>>>>> by tooling. How do we get value out of macros?
>>>>>>
>>>>>> Stephan
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Clément Béra
>>>>> https://clementbera.github.io/
>>>>> https://clementbera.wordpress.com/
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Clément Béra
>>>> https://clementbera.github.io/
>>>> https://clementbera.wordpress.com/
>>>>
>>>
>>>
>>>
>>> --
>>> Clément Béra
>>> https://clementbera.github.io/
>>> https://clementbera.wordpress.com/
>>>
>>
>>
>
>
> --
> Clément Béra
> https://clementbera.github.io/
> https://clementbera.wordpress.com/
>


Re: [Pharo-users] Macros?

2018-05-26 Thread Denis Kudriashov
Hi

2018-05-26 8:46 GMT+03:00 Clément Bera :

> Just mentioning another use-case:
>
> getDatabaseInstance
> ^ (Production CifTrue: [Database] CifFalse: [MockDatabase]) new
>

I think following code will work:

getDatabaseInstance
 ^ (Production ifTrue: [Database] ifFalse: [MockDatabase])
asMethodConstant new



>
>
> Since I use conditional compilation more often than just precompiling
> constants.
>
> I don't see an equivalent of asMethodConstant AST manipulation at runtime
> strategy in the image for this case right now but it's probably a couple
> lines of code with Reflectivity.
>
> On Sat, May 26, 2018 at 7:28 AM, Clément Bera 
> wrote:
>
>>
>>
>> On Fri, May 25, 2018 at 10:44 PM, Esteban Lorenzano 
>> wrote:
>>
>>>
>>>
>>> On 25 May 2018, at 17:30, Clément Bera  wrote:
>>>
>>> What about a preprocessor like the Java preprocessors ? The Truffle
>>> project relies heavily on that for high performance Java and it's quite
>>> nice. It's difficult to do that in Smalltalk right now.
>>>
>>> I think if you want to do what are asking for you just need to write a
>>> bytecode compiler extension.
>>>
>>> I did something similar in the past to have precomputed constants
>>> through AST manipulation at compilation time. You can find it here with
>>> examples: http://smalltalkhub.com/#!/~ClementBera/NeoCompiler. Once the
>>> code is loaded you need to recompile the examples (NeoCompilerExample
>>> withAllSubclassesDo: #compileAll.). With it you can write code such as:
>>> [ Smalltalk vm class ] Cvalue
>>> And depending if the compiler allowsPrecompilation or not, the bytecode
>>> compiler generates:
>>> Smalltalk vm class
>>> Or just a push literal with the precomputed value (the class
>>> VirtualMachine).
>>>
>>>
>>> this is not what #asMethodConstant provides?
>>>
>>
>> Can you turn asMethodConstant On and Off so you have the constant in
>> production and not a development time ? Typically at development time I
>> change the constants generated a lot and I don't want to waste time
>> recompiling all the time.
>>
>> But yeah, my project is from 2014. I guess instead of preprocessing you
>> could do everything at runtime with AST manipulation/recompilation like
>> in asMethodConstant.
>>
>> The main point of preprocessing IMO is to control performance, it's just
>> easier for me to just look at the generated bytecode and change the
>> preprocessor until it gets what I want, it's not always easy to run code
>> that will change your method at runtime quickly so you can look at the
>> bytecode generated.
>>
>> Anyway, I am not convinced at all something like that should be in the
>> base image.
>>
>>
>>>
>>> Esteban
>>>
>>> In the end I decided not to use this, but you can use it and extend it
>>> to support more than just constants (any AST manipulation is possible).
>>> Just checked it works in Pharo 6.
>>>
>>> On Fri, May 25, 2018 at 4:26 PM, Stephan Eggermont 
>>> wrote:
>>>
 Debiller 777 
 wrote:
 > Well, I've already asked about adding new literals to pharo or
 Smalltalk in
 > general, however this time I have a better idea:
 > macros. Can they be added? Because if I understand correctly they may
 be
 > the only way to do that.

 Why do you think they would be a good idea? We have powerful
 meta-programming facilities that are well understood and somewhat
 supported
 by tooling. How do we get value out of macros?

 Stephan




>>>
>>>
>>> --
>>> Clément Béra
>>> https://clementbera.github.io/
>>> https://clementbera.wordpress.com/
>>>
>>>
>>>
>>
>>
>> --
>> Clément Béra
>> https://clementbera.github.io/
>> https://clementbera.wordpress.com/
>>
>
>
>
> --
> Clément Béra
> https://clementbera.github.io/
> https://clementbera.wordpress.com/
>


Re: [Pharo-users] BlueInk Pretty Printer Array Formatting

2018-05-25 Thread Denis Kudriashov
Hi.

I think it should be default behaviour. So open issue, please.
​


Re: [Pharo-users] [Pharo-dev] feenk log

2018-05-25 Thread Denis Kudriashov
Hi Tudor.

Very impressive progress.
I have one question about scrolling support. How it works or is it works
with elements which are based on infinite layout like mentioned grid
widget?
Does grid implemented with PannableElement too?



2018-05-25 14:30 GMT+03:00 Tudor Girba :

> Hi,
>
> We were a bit silent the last couple of months. Quite a bit happened in
> the meantime, so here is a summary (for more fine grained announcements,
> you can follow us on Twitter):
>
> 
> Bloc
> 
>
> - Scrolling. We finally have a good scrolling support:
> https://twitter.com/feenkcom/status/991690465224331264
> This might sound like a trivial feature, but it turns out it is not. We
> had a bug that forced us to rethink the support quite deeply in order to be
> able to debug it. To do this, we now can simulate time in Bloc, which is
> really cool:
> https://twitter.com/feenkcom/status/989797367523233797
> https://twitter.com/feenkcom/status/988753142299938817
> (as a side note, the bug we fought with was the last
>
> - Pannable element is a combination of a scrollable element with a
> scalable element, and it offers the possibility either to zoom in/out +
> scroll, or to fit screen and resize when the parent resizes.
>
> - PDF, SVG, PNG, JPG export (based on the underlying Moz2D support):
> https://twitter.com/feenkcom/status/976580153802358786
> https://twitter.com/feenkcom/status/976578060429484032
>
> - Better curve support:
> https://twitter.com/feenkcom/status/990967109193781249
> https://twitter.com/feenkcom/status/990971530615107584
>
> - Better debugging support for understanding bounds:
> https://twitter.com/feenkcom/status/989138457288167424
>
> 
> Brick
> 
>
> - We now have simple list and columned list widgets. The list is both fast
> and scalable and supports rows of variable heights:
> https://twitter.com/feenkcom/status/984744251920658432
> https://twitter.com/feenkcom/status/984143821192744961
>
> - Basic tab widget:
> https://twitter.com/feenkcom/status/974420432240685062
>
> - Looks: a mechanism for specifying element-specific composition and
> interaction.
>
> 
> GT
> 
>
> - Documenter saw some major improvements. Just a reminder, Documenter is
> the tool that enables live programming and previews directly within Pillar
> documents.
> We now have a capability similar to notebooks like Jupyter:
> https://twitter.com/feenkcom/status/996310432225820672
> We use it extensively to document our code. For example, here is a
> tutorial about playing with looks in Bloc:
> https://twitter.com/feenkcom/status/973899862482866176
> And we can also express whole tutorials based on Epicea:
> https://twitter.com/feenkcom/status/75333972541440
>
> - Diagrammer. We now have better editing support for detailed things such
> as arrow head:
> https://twitter.com/feenkcom/status/976341449267531776
> While Diagrammer is apparently a tool for diagrams, it has a rather
> generic design that can be utilized for all sorts of use cases. For
> example, one side effect is that now all elements can be visually edited:
> https://twitter.com/feenkcom/status/982656456968241152
>
> - Mondrian: Using the new pannable element, we can now zoom in/out and
> scroll, and we can also set element to fit screen. We can also drag
> elements around.
>
> - Inspector: we now have an initial support for multiple views associated
> with an object. The support is similar to the one from the current
> inspector.
>
>
> Have fun,
> The feenk team
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "What is more important: To be happy, or to make happy?"
>
>
>


Re: [Pharo-users] #ast vs. #parseTree

2018-05-04 Thread Denis Kudriashov
2018-05-04 21:10 GMT+03:00 Richard Sargent <
richard.sarg...@gemtalksystems.com>:

> On Fri, May 4, 2018 at 1:04 PM, Denis Kudriashov <dionisi...@gmail.com>
> wrote:
>
>>
>> 2018-05-04 19:45 GMT+03:00 Sean P. DeNigris <s...@clipperadams.com>:
>>
>>> Ramon Leon-5 wrote
>>> > And my point made; I don't even know what that means.
>>>
>>> Ha ha, I googled it and even after seeing the definition still didn't
>>> understand - we must be getting old ;-)
>>>
>>> Regarding the use of acronyms - while I agree with you as a general
>>> principle, I wonder about this case. Since the argument IIUC is that "a
>>> general user won't know the domain well enough to understand the
>>> acronym",
>>> would they understand "abstractSyntaxTree"?!
>>
>>
>> Now I am wonder: is it really correct to call syntax tree as abstract
>> when it is really implemented?
>> AST is very known term but now when I read it word by word I have such
>> questions :).
>>
>
> In computer science, an *abstract syntax tree* (AST), or just *syntax
> tree*, is a *tree* representation of the *abstract syntactic *structure
> of source code written in a programming language.
> [Wikipedia]
>

I know it. But my stupid question is why it's still called abstract while
it is implemented for concrete language?


>
>
>>
>>
>>> That, to me, is as opaque as
>>> the acronym for one not acquainted with the domain, and may buy us
>>> little at
>>> the cost of a good amount of extra typing. Maybe keep the acronym and
>>> add a
>>> good method comment…
>>>
>>>
>>>
>>> -
>>> Cheers,
>>> Sean
>>> --
>>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>>
>>>
>>
>


Re: [Pharo-users] #ast vs. #parseTree

2018-05-04 Thread Denis Kudriashov
2018-05-04 19:45 GMT+03:00 Sean P. DeNigris :

> Ramon Leon-5 wrote
> > And my point made; I don't even know what that means.
>
> Ha ha, I googled it and even after seeing the definition still didn't
> understand - we must be getting old ;-)
>
> Regarding the use of acronyms - while I agree with you as a general
> principle, I wonder about this case. Since the argument IIUC is that "a
> general user won't know the domain well enough to understand the acronym",
> would they understand "abstractSyntaxTree"?!


Now I am wonder: is it really correct to call syntax tree as abstract when
it is really implemented?
AST is very known term but now when I read it word by word I have such
questions :).


> That, to me, is as opaque as
> the acronym for one not acquainted with the domain, and may buy us little
> at
> the cost of a good amount of extra typing. Maybe keep the acronym and add a
> good method comment…
>
>
>
> -
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] Mocketry: what is used of #where ?

2018-05-04 Thread Denis Kudriashov
Hi Herbert.

It is a bit experimental API to allow more descriptive failures. Evaluate
following code:


(2@3) where x should equal: 10

It will give you failure message: Got "2" from (2@3) x but it should equal
"10".
But without #where it would be: Got "2" but it should equal "10".

And it works with long message chains:

(2@3 corner: 10@30) where origin x should equal: 10

It will show: Got "2" from (2@3) corner: (10@30) origin x but it should
equal "10".

I am still not sure is it good approach or not. But that is idea.
Besides It is possible to retrieve such information using magic with
thisContext and reflectivity. But again the question is same: does it
really make sense to do it for assertions?

Best regards,
Denis



2018-05-04 16:28 GMT+03:00 Herbert Vojčík :

> Hello,
>
> When I am writing tests using Mocketry's DSL, I get puzzled about how /
> when to use #where, and how is it different when it's used and when it is
> not?
>
> As far as i tried, I did not find any difference. That is, pasting part of
> one of my tests:
>
> response := znClient
> username: (self uidy: 'Q7') asString, '/TEST' password:
> 'tk';
> timeout: 1; post; response.
> response should be isSuccess.
> response where contentType should equal: ZnMimeType
> applicationJson.
> response where entity should not be: nil.
> (STON fromString: response entity contents) should equal: nil
>
> I get the same result (pass if ok, failure with DNU when thing is not
> present) whether `where` is there or isn't.
>
> Could you explain what is it's purpose and correct usage?
>
> Thanks, Herby
>
>


Re: [Pharo-users] Pharo70 session start and silent failures

2018-05-04 Thread Denis Kudriashov
I had similar problem with SSDP server.
When I tried to stop it during shutdown of image the image didn't closed.
It hangs forever. In some cases I was able to open debugger which pointed
to exactly same place which you mentioned.
My guess was that process termination during shutdown is not safe anymore.
But I had no time to check deeply.



2018-05-03 16:13 GMT+03:00 Holger Freyther :

> I am facing a problem with the new SessionManager>>#snapshot:andQuit:
> code. I have had plenty Pharo70 images that didn't restore anymore as the
> code is waiting for the "wait" semaphore. For sure it is something my code
> is doing but could anyone think of ways to make it more robust and handle
> failures more gracefully? My main concerns are:
>
> * When the failure becomes noticeable it is too late. :(
> * It fails silently. Maybe WorkingSession>>#runStartup: shouldn't rely on
> the UIManager doing the right thing (before the UI was fully initialized?)
> * Debugging is hard, there is no indication of why it broke, and getting
> to the situation of breakage takes a bit of time (installing the
> baseline..).
>
> holger
>
>
>
>


Re: [Pharo-users] #ast vs. #parseTree

2018-05-02 Thread Denis Kudriashov
Hi.

Maybe #parseSourceCode would be better name for #parseTree.

2018-05-02 16:33 GMT+03:00 Marcus Denker :

>
>
> > On 27 Apr 2018, at 21:36, Sean P. DeNigris 
> wrote:
> >
> > Marcus Denker-4 wrote
> >> I will add comments…
> >
> > I got confused by this again and created an issue:
> > https://pharo.manuscript.com/f/cases/21806/Document-
> Difference-between-ast-and-parseTree
> >
> > And then Peter Uhnak reminded me on Discord about this thread. I'm happy
> to
> > add the comments, but not sure I understand the issue well enough. IIUC
> #ast
> > is cached, but #parseTree is not. What I don't understand is the purpose
> of
> > this difference and when one would use one over the other.
>
> the cached #ast is for one interesting for speed (that is, in situations
> where you ask for it often).
>
> The other use-case is if you want to annotate the AST and keep that
> annotation around (till the next
> image save, but you can subscribe to ASTCacheReset and re-install the AST
> in the cache after cleaning.
> (This is used by MetaLinks to make sure they survive image restart).
>
> The last thing that it provides is that we do have a quite powerful
> mapping between bytecode/text/context
> and the AST. Regardless how you navigate, you get the same object.
>
> e.g. even this one works:
>
> [ 1+2 ] sourceNode == thisContext method ast blockNodes first
>
> > For example,
> > when, if ever, would a user want to access a CM's #ast (as opposed to
> > #parseTree) and could modifying it create problems?
> >
>
> Modification is a problem, yes.. code that wants to modify the AST without
> making sure the compiledMethod is in sync later
> should use #parseTree.
>
> Code that does not modify the AST (or makes sure to compile it after
> modification) is free to use #ast.
> or if you want to annotate the AST (which is a modification, after all).
>
> This is not perfect (not at all…) but the simplest solution to get (to
> some extend) what you would have if the system would have
> a real persistent, first class AST…
>
> To be improved. The ASTCache with it’s naive “lets just cache everything
> till the next image save” was done with the idea to see
> when it would show that it is too naive… for that it worked amazingly well
> till now.
>
> Marcus
>


Re: [Pharo-users] Literals

2018-04-28 Thread Denis Kudriashov
Hi.
сб, 28 апр. 2018 г., 1:26 Richard Sargent <
richard.sarg...@gemtalksystems.com>:

> On Fri, Apr 27, 2018 at 3:58 PM, Esteban A. Maringolo <
> emaring...@gmail.com> wrote:
>
>> oh, you were talking about how te VM views the object,
>> I was thinking in terms of how the compiler sees the text.
>>
>> So I'm talking about literals "syntax".
>>
>> Thanks anyway for the "trick" :)
>>
>
> Another common technique is a "once block". Teach Block how to evaluate
> itself once and to use its cached result the next time.
>

We have similar mechanizm in Pharo. Look at
http://dionisiydk.blogspot.fr/2016/07/magic-with-pharo-reflectivity.html


> It's not as fast as a literal, but it is a pretty effective way to have a
> clean implementation with as complex code as one could wish.
> Clear the cache when saving the image or at image start up or ... whenever
> seems good (such as when you change the implementation of what was cached.
>
> e.g.
> [Dictionary new
> at: #a put: self something;
> at: #b put: self somethingElse;
> yourself]
> once
>
>
>
>>
>> On 27/04/2018 16:34, Clément Bera wrote:
>> > The guy who asked the question said: "...when you want to shorten some
>> > object initialization"
>> >
>> > Using ClassVariable is an alternative way to shorten object
>> > initialization, reading a ClassVariable is almost the same performance
>> > as reading a literal, so that looked like a good alternative to me. Both
>> > the ClassVariable and the literal have the same issues (same object so
>> > if you mutate it you have to deal with it).
>> >
>> > But yes, it's not a new literal.
>> >
>> > For new literals, you can extend the compiler or hard patch thing:
>> >
>> > MyClass>>foo
>> > ^ #bar
>> >
>> > (MyClass>>#foo) literalAt: ((MyClass>>#foo) literals indexOf: #bar) put:
>> > Set new.
>> >
>> > MyClass new foo
>> >
>>  a Set ()
>> >
>> > Obviously it depends what you mean by literal, the latter code uses the
>> > literal bytecode instruction, which does not make the pushed object a
>> > literal object...
>>
>>
>> --
>> Esteban A. Maringolo
>>
>>
>


Re: [Pharo-users] SortedCollection>>reverse answers an inconsistent object in Pharo 6

2018-04-25 Thread Denis Kudriashov
2018-04-25 14:26 GMT+02:00 Richard O'Keefe <rao...@gmail.com>:

> (aSortFunction value: x value: y) returns a Boolean;
> (aSortFunction value: x value: x) returns true.
> So you can already set up a SortedCollection using
> a SortFunction.  So yes, that would work.
>

Yes. It was original goal to introduce them.
I created another thread in dev list "SortedCollection based on
SortFunction".


> But there is no reason why #reversed (or my preference,
> #converse) could not work on sortBlocks.
>

It will. But I think it is bad approach. Because any time you will need new
kind of sort operation you will be forced extend BlockClosure.
In general reversed/converse has no meaning for block.

With SortFunction only simple extension #asSortFunction is required.


>
>
> On 25 April 2018 at 23:27, Denis Kudriashov <dionisi...@gmail.com> wrote:
>
>> Hi Richard.
>>
>> I agree with your proposal.
>> But it force me to think that we should completely move to
>> SortFunction's.
>> In that case SortCollection will have sortFunction variable instead of
>> sortBlock. And for your scenario reverse operation will be simple
>> expression: "sortFunction := sortFunction reversed".
>>
>>
>>
>> 2018-04-23 3:09 GMT+02:00 Richard O'Keefe <rao...@gmail.com>:
>>
>>> Test case:
>>>#(1 2 4) asSortedCollection reverse add: 3; yourself
>>> 
>>> The answer *should* be aSortedCollection(4 3 2 1)
>>> but *is* aSortedCollection(4 2 1 3).
>>> This works in Squeak.
>>> The problem is that SortedCollection does not define
>>> #reverse[d] but simply inherits it(them), and the
>>> inherited code pays no attention to the sortBlock.
>>>
>>> I propose adding the following two methods to
>>> SortedCollection:
>>>
>>> reverseInPlace
>>> |a z|
>>> a := firstIndex.
>>> z := lastIndex.
>>> [a < z] whileTrue: [array swap: a with: z. a := a + 1. z := z - 1].
>>> sortBlock := sortBlock
>>> ifNil: [[:x :y | y <= x]]
>>> ifNotNil: [[:x :y | sortBlock value: y value: x]].
>>> ^self
>>>
>>> reversed
>>> ^self copy reverseInPlace
>>>
>>> The ANSI method is #reverse, not #reversed, but Pharo
>>> defines #reverse to call #reversed, and OrderedCollection overrides
>>> #reversed, so SortedCollection *must* override #reversed.
>>>
>>> #reverseInPlace is the name Squeak uses for the other
>>> method.  It also has a definition in SequenceableCollection, which is
>>> not but is
>>> equivalent to
>>>
>>> reverseInPlace
>>> |a z|
>>> a := 1.
>>> z := self size.
>>> [a < z] whileTrue: [self swap: a with: z. a := a + 1. z := z - 1].l
>>> ^self
>>>
>>> r
>>>
>>>
>>
>


Re: [Pharo-users] SortedCollection>>reverse answers an inconsistent object in Pharo 6

2018-04-25 Thread Denis Kudriashov
Hi Richard.

I agree with your proposal.
But it force me to think that we should completely move to SortFunction's.
In that case SortCollection will have sortFunction variable instead of
sortBlock. And for your scenario reverse operation will be simple
expression: "sortFunction := sortFunction reversed".



2018-04-23 3:09 GMT+02:00 Richard O'Keefe :

> Test case:
>#(1 2 4) asSortedCollection reverse add: 3; yourself
> 
> The answer *should* be aSortedCollection(4 3 2 1)
> but *is* aSortedCollection(4 2 1 3).
> This works in Squeak.
> The problem is that SortedCollection does not define
> #reverse[d] but simply inherits it(them), and the
> inherited code pays no attention to the sortBlock.
>
> I propose adding the following two methods to
> SortedCollection:
>
> reverseInPlace
> |a z|
> a := firstIndex.
> z := lastIndex.
> [a < z] whileTrue: [array swap: a with: z. a := a + 1. z := z - 1].
> sortBlock := sortBlock
> ifNil: [[:x :y | y <= x]]
> ifNotNil: [[:x :y | sortBlock value: y value: x]].
> ^self
>
> reversed
> ^self copy reverseInPlace
>
> The ANSI method is #reverse, not #reversed, but Pharo
> defines #reverse to call #reversed, and OrderedCollection overrides
> #reversed, so SortedCollection *must* override #reversed.
>
> #reverseInPlace is the name Squeak uses for the other
> method.  It also has a definition in SequenceableCollection, which is not
> but is
> equivalent to
>
> reverseInPlace
> |a z|
> a := 1.
> z := self size.
> [a < z] whileTrue: [self swap: a with: z. a := a + 1. z := z - 1].l
> ^self
>
> r
>
>


Re: [Pharo-users] Where do we go now ?

2018-04-13 Thread Denis Kudriashov
2018-04-13 13:01 GMT+02:00 Marcus Denker :

>
>
> > On 13 Apr 2018, at 12:40, Sven Van Caekenberghe  wrote:
> >
> >
> >
> >> On 13 Apr 2018, at 12:19, Joe Shirk  wrote:
> >>
> >> I've been a lurk-fan for a long time but this brings up something that
> distressed me. Richard Eng, Smalltalk Renaissance hero loves to say
> Smalltalk's grammar/syntax fits on a postcard.
> >>
> >> But the vocabulary doesn't. There is nothing English-like about the
> always expanding bewildering   library namespaces.
> >>
>
> The package names that just use the “project name” can be problematic… too
> many words. e.g. “Hiedra”? No idea. (there are ideas of how to improve, I
> will not list them here as this should
> not turn into discussion about this issue).
>
>
At some point we should force rule "All packages have comments". And
indication with icon like we do for classes.
With Calypso the package comment is always available. So it would be easy
to find description.

The way we present packages (and their granularity) is not “right”.
> Namespaces are a problem in addition…
>
> So yes: we have a lot of thing to improve!
> .
> >> GT what? Oh a newbie might eventually figure out it means Glamorous
> Toolkit. These are meaningless brands. In this drive to come up with
> creative names for "just objects" that explain nothing at all, Smalltalk is
> becoming like Java or PHP hell.
> >> Just look at those examples through the eyes of a novice. The purity is
> nowhere to be found.
> >> :(
> >
> > You are right, but in 'the real world' it is no longer possible to
> reserve the nice, simple names for just one variant. The prefixes are a
> poor mans namespace mechanism. You have to read over them.
> >
> > Inspector, EyeInspector, GTInspector, ...
> >
> > I rather have cool alternatives and the development of new ideas than
> 'one ring to rule them all' or no/slow progress. Remember that we develop
> in a live system, changing things while testing them, this is often hard.
> Alternative subsystems help a lot.
>
> It should be clear that what we have is what we managed to do, not what we
> dreamed about… I, too, would like to have this clean, nice, small, amazing
> system… but it is not always easy.
>
> There is a lot we can (and will!) improve!
>
> Marcus
>
>
>


Re: [Pharo-users] Where do we go now ?

2018-04-13 Thread Denis Kudriashov
With new Traits we have some issues which we are slowly fixing. Nice thing
that fixes are quite simple and clean and covered by tests. I guess it was
not like that before.
So Pablo did very good job here.

For this concrete case with implementors there is already issue 21652
:
the method allClassesAndTraits includes traits twice.

2018-04-13 11:30 GMT+02:00 Marcus Denker :

>
>
> On 13 Apr 2018, at 11:26, Benoit St-Jean via Pharo-users <
> pharo-users@lists.pharo.org> wrote:
>
>
> *From: *Benoit St-Jean 
> *Subject: **Re: [Pharo-users] Where do we go now ?*
> *Date: *13 April 2018 at 11:26:09 CEST
> *To: *Esteban Lorenzano 
> *Cc: *Any question about pharo is welcome 
> *Reply-To: *Benoit St-Jean 
>
>
> BTW, why put an .exe installer for Windows available when it crashes right
> from the start? It just doesn't work at all.  Period.  For everyone.
>
> And I thought looking for senders of a method was something we mastered a
> long time ago, like starting with Smalltalk-76.  Am I supposed to assume
> that everything, even basic functionalities, are all broken because it's
> labeled "alpha” ?
>
>
> We have already a issue tracker entry with a description of a fix:
>
> https://pharo.fogbugz.com/f/cases/21518/New-Traits-brings-
> wrong-behaviour-to-tagsForMethods
>
> TODO: turn that description into code and make a Pull Request.
>
> Marcus
>
>


Re: [Pharo-users] To be there or not to be there

2018-04-12 Thread Denis Kudriashov
Stef found and I fixed one case which could be related to your problem.
So next release it will be integrated.

Also I added to #extra menu group the item "Update" which will help in such
buggy cases.

2018-04-03 23:06 GMT+02:00 Hilaire :

> Hello,
>
> I have re-organized the packages and classes in DrGeo with Calypso. An now
> I come to a situation where methods seems to be there without been there.
>
> For example DrGeoWindow>>newTable: methods,
>
> - Calypso can browse it and can show its implementor
>
> - Nautilus can browse it and can NOT show its implementor
>
> - and more importantly when exported to tonel file, it is missing !
>
> Who knows what else methods are missing.
>
> See screenshot.
>
> Any idea?
>
> Hilaire
>
> --
> Dr. Geo
> http://drgeo.eu
>
>


Re: [Pharo-users] To be there or not to be there

2018-04-04 Thread Denis Kudriashov
2018-04-04 10:28 GMT+02:00 Hilaire <hila...@drgeo.eu>:

> Hi Denis,
>
> The origin of the problem seems related when renaming a package, the
> category extension (*DrGeoII-Polymorph not renamed as *DrGeoII-UI) seems to
> not been renamed accordingly.
>

How you performed renaming? From package pane menu/shortcut?

When you rename DrGeoII-Polymorph to DrGeoII-UI the last was already exists?


>
> I did all the source code re-organization with Calypso.
>
> Later when I saw the problem, I open the class with Nautilus to see the
> category extension has not been renamed. From there, I renamed the
> extension.
>
> Thanks
>
>
> Le 04/04/2018 à 10:00, Denis Kudriashov a écrit :
>
>> Hi Hilaire.
>>
>> Probably there is some case where Calypso do not react on particular
>> system changes. Internally it maintains the cache which needs to be
>> invalidated.
>> I did a lot of recategorization during my work and I did't saw such
>> problems quite a long time after I fixed last related issue. If you will
>> give me reproducible case I will be able to fix it,
>>
>> If you will encounter it again you can clean the cache manually using:
>>
>> ClyNavigationEnvironment reset.
>>
>>
>> It requires reopening browser.
>>
>> One question: did you perform all modifications from Calypso?
>>
>>
> --
> Dr. Geo
> http://drgeo.eu
>
>
>
>


Re: [Pharo-users] To be there or not to be there

2018-04-04 Thread Denis Kudriashov
Hi Hilaire.

Probably there is some case where Calypso do not react on particular system
changes. Internally it maintains the cache which needs to be invalidated.
I did a lot of recategorization during my work and I did't saw such
problems quite a long time after I fixed last related issue. If you will
give me reproducible case I will be able to fix it,

If you will encounter it again you can clean the cache manually using:

ClyNavigationEnvironment reset.


It requires reopening browser.

One question: did you perform all modifications from Calypso?

Best regards,
Denis

2018-04-03 23:06 GMT+02:00 Hilaire :

> Hello,
>
> I have re-organized the packages and classes in DrGeo with Calypso. An now
> I come to a situation where methods seems to be there without been there.
>
> For example DrGeoWindow>>newTable: methods,
>
> - Calypso can browse it and can show its implementor
>
> - Nautilus can browse it and can NOT show its implementor
>
> - and more importantly when exported to tonel file, it is missing !
>
> Who knows what else methods are missing.
>
> See screenshot.
>
> Any idea?
>
> Hilaire
>
> --
> Dr. Geo
> http://drgeo.eu
>
>


Re: [Pharo-users] Calypso error after clean up

2018-04-03 Thread Denis Kudriashov
Also you can completely disable critiques:

ClyCriticBrowserPlugin disable.ClyCriticEnvironmentPlugin
disable.ClyNavigationEnvironment reset.


And reopen browser.

2018-04-03 17:53 GMT+02:00 Denis Kudriashov <dionisi...@gmail.com>:

> Hi.
>
> Try clean Calypso with "ClyNavigationEnvironment reset" and then reopen
> browser.
> If error will not disappear then problem could be related to the state of
> RPackageOrganizer in your image. Do you see from debugger what is missing
> in the package?
>
> 2018-04-03 16:59 GMT+02:00 Hilaire <hila...@drgeo.eu>:
>
>> Hello,
>>
>> I have this error when opening calypso on a P7 image, likely the critic
>> stuff. The image was tightly cleaned. Likely one package was removed and it
>> should not. Any idea which package family to look at
>>
>> Thanks
>>
>> Hilaire
>>
>> --
>> Dr. Geo
>> http://drgeo.eu
>>
>>
>


Re: [Pharo-users] Calypso error after clean up

2018-04-03 Thread Denis Kudriashov
Hi.

Try clean Calypso with "ClyNavigationEnvironment reset" and then reopen
browser.
If error will not disappear then problem could be related to the state of
RPackageOrganizer in your image. Do you see from debugger what is missing
in the package?

2018-04-03 16:59 GMT+02:00 Hilaire :

> Hello,
>
> I have this error when opening calypso on a P7 image, likely the critic
> stuff. The image was tightly cleaned. Likely one package was removed and it
> should not. Any idea which package family to look at
>
> Thanks
>
> Hilaire
>
> --
> Dr. Geo
> http://drgeo.eu
>
>


Re: [Pharo-users] Calypso and Dark Theme

2018-03-31 Thread Denis Kudriashov
Hi.

It's issue for Pharo 7. It looks fine in Pharo 6,
Problem that in Pharo 7 theme classes were renamed and extension methods
from any external packages are affected by this

2018-03-31 16:56 GMT+02:00 kmo :

> Is anything being done to make Calypso work better with the Pharo Dark
> Theme?
> The dark blue labels against a dark background are unreadable - see
> screenshot.
>
> 
>
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] New Files in Pharo - Migration Guide, How To's and examples

2018-03-20 Thread Denis Kudriashov
2018-03-20 10:15 GMT+01:00 Denis Kudriashov <dionisi...@gmail.com>:

> We can cover this case by extra variable maxBufferSize.
>

Operations like upToEnd will relocate maximum buffer.
#next: related methods can be also improved by it too. We will need extra
method:

ZnBufferedReadStream>>nextBuffer: requiredSize
newBufferSize := requiredSize min: maxBufferSize max: minBufferSize.
buffer size = newBufferSize ifFalse: [
   buffer := self collectionSpecies new: size].
limit := stream readInto: buffer startingAt: 1 count: buffer size.
position := 1


But it will require another variable minBufferSize.

By default it would be equal to given size in method #sizeBuffer:. And
> special users will specify concrete value. FileHandler will use file size
> for this.
> It will also improve buffer size for small files where we do not need big
> buffer.
>
> 2018-03-20 9:57 GMT+01:00 Guillermo Polito <guillermopol...@gmail.com>:
>
>>
>>
>> On Tue, Mar 20, 2018 at 8:57 AM, Sven Van Caekenberghe <s...@stfx.eu>
>> wrote:
>>
>>>
>>>
>>> > On 20 Mar 2018, at 00:19, Sean P. DeNigris <s...@clipperadams.com>
>>> wrote:
>>> >
>>> > Guillermo Polito wrote
>>> >> I've done also some profiling and it does not look like we've lost in
>>> >> performance either (reading and decoding a 35MB file):
>>> >
>>> > Your 1st (new API) example: "0:00:00:01.535"
>>> > Your 2nd (old API) example:"0:00:00:01.732"
>>> > *** but ***
>>> > Your 1st (new API) example using the same consuming selector as
>>> example #1
>>> > (#upToEnd): "0:00:00:07.816" or 4.5x slower
>>>
>>> Yes and no ;-)
>>>
>>> Look at MultiByteFileStream>>#upToEnd where they cheat a bit and do
>>> basically the same as example 1 using #next:
>>>
>>> The Zn #upToEnd implementation does not use size knowledge (as streams
>>> are infinite).
>>>
>>> As a side note: using #size and #position[:] on variable encoded streams
>>> like UTF8 is *very* dangerous and should be avoided. Counting/indexing
>>> bytes in the underlying stream is *not* the same as counting/indexing
>>> decoded characters. It can be the source of subtle bugs.
>>>
>>
>> Sean,
>>
>> Think that the Buffered stream can be reused in the context of sockets
>> too. And there size has no meaning.
>>
>> Basically the cost in there is on growing and copying the internal buffer
>> used to read. This buffer for the 35M file ends up being ~35M, so it has to
>> grow and copy several times...
>> Using #next: will preallocate the good size for the internal buffer.
>>
>> Now, I'd say first that if people want performance they should use the
>> good API :).
>>
>> Maybe the ZnBuffered stream could ask its underlying stream for its
>> #preferredInternalBufferSizeForUpToAll. But that would contaminate all
>> the stream hierarchy... Is it worth it? Dunno...
>>
>>
>>>
>>>
>>> > -
>>> > Cheers,
>>> > Sean
>>> > --
>>> > Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>> >
>>>
>>>
>>>
>>
>>
>> --
>>
>>
>>
>> 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 <+33%206%2052%2070%2066%2013>
>>
>
>


Re: [Pharo-users] New Files in Pharo - Migration Guide, How To's and examples

2018-03-20 Thread Denis Kudriashov
We can cover this case by extra variable maxBufferSize.
By default it would be equal to given size in method #sizeBuffer:. And
special users will specify concrete value. FileHandler will use file size
for this.
It will also improve buffer size for small files where we do not need big
buffer.

2018-03-20 9:57 GMT+01:00 Guillermo Polito :

>
>
> On Tue, Mar 20, 2018 at 8:57 AM, Sven Van Caekenberghe 
> wrote:
>
>>
>>
>> > On 20 Mar 2018, at 00:19, Sean P. DeNigris 
>> wrote:
>> >
>> > Guillermo Polito wrote
>> >> I've done also some profiling and it does not look like we've lost in
>> >> performance either (reading and decoding a 35MB file):
>> >
>> > Your 1st (new API) example: "0:00:00:01.535"
>> > Your 2nd (old API) example:"0:00:00:01.732"
>> > *** but ***
>> > Your 1st (new API) example using the same consuming selector as example
>> #1
>> > (#upToEnd): "0:00:00:07.816" or 4.5x slower
>>
>> Yes and no ;-)
>>
>> Look at MultiByteFileStream>>#upToEnd where they cheat a bit and do
>> basically the same as example 1 using #next:
>>
>> The Zn #upToEnd implementation does not use size knowledge (as streams
>> are infinite).
>>
>> As a side note: using #size and #position[:] on variable encoded streams
>> like UTF8 is *very* dangerous and should be avoided. Counting/indexing
>> bytes in the underlying stream is *not* the same as counting/indexing
>> decoded characters. It can be the source of subtle bugs.
>>
>
> Sean,
>
> Think that the Buffered stream can be reused in the context of sockets
> too. And there size has no meaning.
>
> Basically the cost in there is on growing and copying the internal buffer
> used to read. This buffer for the 35M file ends up being ~35M, so it has to
> grow and copy several times...
> Using #next: will preallocate the good size for the internal buffer.
>
> Now, I'd say first that if people want performance they should use the
> good API :).
>
> Maybe the ZnBuffered stream could ask its underlying stream for its #
> preferredInternalBufferSizeForUpToAll. But that would contaminate all the
> stream hierarchy... Is it worth it? Dunno...
>
>
>>
>>
>> > -
>> > Cheers,
>> > Sean
>> > --
>> > Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>> >
>>
>>
>>
>
>
> --
>
>
>
> 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
> *
>
>
> *Web:* *http://guillep.github.io* 
>
> *Phone: *+33 06 52 70 66 13 <+33%206%2052%2070%2066%2013>
>


Re: [Pharo-users] global exception handler mechanism

2018-02-15 Thread Denis Kudriashov
Hi

2018-02-05 11:00 GMT+01:00 Igor Stasenko :

>
>
> On 5 February 2018 at 10:17, Marcus Denker  wrote:
>
>> Hello,
>>
>> The Sunit-Debugger does a stack search on startup to find the test
>> related exception.
>>
>> It might be good to do it better, especially as the debug process starts
>> from the exception
>> I might be a good idea to actually keep a reference to it.
>>
>> Would there be any downside of Exception>>debug passing a reference to
>> the Debugger?
>>
>> Marcus
>>
>>
>> > On 2 Feb 2018, at 17:19, Peter Uhnák  wrote:
>> >
>> > Hi,
>> >
>> > is there a way to install a global handler for exceptions?
>> >
>> > Right now if I want to log all exceptions, I use approach from
>> ShoreLine and create a PreDebugAction which is activated when any
>> "unhandled" exception occurs.
>> >
>> > That would be good enough, however the Debugger has zero knowledge of
>> the exception that is actually occuring, as Exception>>debug passes on only
>> the title. So if I want to get back to the original exception and maybe log
>> it with beacon, I need to do a lot of stack and context shenanigans:
>> >
>> > MyPreDebugAction>>logException
>> >   MyLogger
>> >   runDuring: [ (debugger session interruptedProcess
>> suspendedContext stack
>> >   detect: [ :context | context receiver
>> isKindOf: Exception ]) receiver emit ]
>> >
>> >
>> > Is there a better way to approach this?
>>
>
> if you own a process (you creating it) , then it is just a piece of cake,
> just make a topmost block
> with #on:do:
> if you don't own a process (suppose you wanna watch already existing one)
> , it can be done by injecting own context at the bottom of stack ,
> well, unless there are exception handler(s) upper, that catch any
> exception(s) before you can see them.
>

I added it in Pharo 6:

aProcess on: Error do: [:err | err logCr]

It works in both cases: when process is not started and when it is already
running.
I used it to intercept errors of forked processes during test run.

It would be cool to add #ensure: in addition.


>
> I think a much better way would be to watch exceptions even before they
> being handled,
> for this, i would override Exception>>#signal
> and add some kind of logging or notification .. well, anything you see fit.
> That's, of course, a kind of dangerous, be careful. Do not attempt to
> throw new exceptions while processing just signaled one, else
> you'll get infinite recursion :)
>
>
> >
>> > Thanks,
>> > Peter
>>
>>
>>
>
>
> --
> Best regards,
> Igor Stasenko.
>


Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-13 Thread Denis Kudriashov
2018-02-13 10:25 GMT+01:00 Marcus Denker <marcus.den...@inria.fr>:

> Sometimes I think we should treat globals more in a “late bound” fashion.
>
> e.g. right now we say that “Undeclared” vars are to be avoided at any cost.
>
> But we could just treat them like we treat messages that are send that do
> not exist.
>
> Forcing “#classNamed: “ for all unknown globals is a bit similar than
> forcing to use “perform:” for
> all unknown selectors.
>
> e.g. why have Smalltalk at: #SomeClass and react to it if you could
> instead reason on the fact that
> a variable is not bound (yet).
>
> SomeGlobal ifUndefined: [  ].
>

I really like this idea. We just need to represent undefined variable value
as special object instead of nil.


>
> This way we would not obscure the fact that we are accessing a global and
> we model explicitly the state
> if it is bound or not.
>
> Would that no be better than hiding it behind an API to look up symbols?
>
> (just some thoughts, needs more thinking before action is possible)
>
> Marcus
>
> On 11 Feb 2018, at 22:12, Richard Sargent <richard.sargent@
> gemtalksystems.com> wrote:
>
> There are two use cases that come immediately to mind. They may be the two
> most important.
>
> "As a Compiler, I need to be able to resolve a Symbol to a known Object."
> "As a Browser, I need to be able to identify the possible resolutions of a
> String to known Objects."
>
>
> I can elaborate on those, but I think they are pretty clear no matter what
> scopes, namespaces, environments, modules, or whatever one uses to organize
> things in the image. (One can even imagine an external registry of names
> that could be searched and yield up suggestions of external packages that
> would be needed.)
>
> On Sun, Feb 11, 2018 at 12:42 PM, Denis Kudriashov <dionisi...@gmail.com>
> wrote:
>
>>
>>
>> 2018-02-11 21:08 GMT+01:00 Stephane Ducasse <stepharo.s...@gmail.com>:
>>
>>> Denis
>>>
>>> we should introduce classNamed: now we can have traits and globals too :(
>>>
>>
>> Yes, we need to think about it.
>>
>>
>>> Idea? may be can still classNamed:
>>>
>>> Stef
>>>
>>>
>>> On Sun, Feb 11, 2018 at 8:55 PM, Denis Kudriashov <dionisi...@gmail.com>
>>> wrote:
>>> >
>>> >
>>> > 2018-02-11 20:36 GMT+01:00 Hernán Morales Durand <
>>> hernan.mora...@gmail.com>:
>>> >>
>>> >> 2018-02-11 16:10 GMT-03:00 Denis Kudriashov <dionisi...@gmail.com>:
>>> >> > Hi Hernan.
>>> >> >
>>> >> > 2018-02-11 19:57 GMT+01:00 Hernán Morales Durand
>>> >> > <hernan.mora...@gmail.com>:
>>> >> >>
>>> >> >> Hi Denis
>>> >> >>
>>> >> >> 2018-02-10 15:18 GMT-03:00 Denis Kudriashov <dionisi...@gmail.com
>>> >:
>>> >> >> >
>>> >> >> > 2018-02-10 20:59 GMT+03:00 Stephane Ducasse
>>> >> >> > <stepharo.s...@gmail.com>:
>>> >> >> >>
>>> >> >> >> Please to not use an unary on Symbol
>>> >> >> >> Dispatch on something.
>>> >> >> >>
>>> >> >> >> self class environment at: #Array
>>> >> >> >> is the best
>>> >> >> >
>>> >> >> >
>>> >> >> > We should not use collection API for reflection calls. It makes
>>> them
>>> >> >> > very
>>> >> >> > difficult to find. Let's use explicit names like:
>>> >> >> >
>>> >> >>
>>> >> >> Sorry I do not see it.
>>> >> >>
>>> >> >> The Collection API is beautiful, why couldn't be used for
>>> reflection?
>>> >> >
>>> >> >
>>> >> > We have around 3000 senders of #at: message in the image. Do you
>>> think
>>> >> > it is
>>> >> > easy to filter reflective calls?
>>> >> >
>>> >>
>>> >> I still don't understand your use case, nor how the #at: is related
>>> >> with the #asClass issue.
>>> >>
>>> >> Do you mean **further** filtering for relflective sends?
>>> >>
>>> >> Does this affects common-usage beyond Browser development?
>>>

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-11 Thread Denis Kudriashov
2018-02-11 21:08 GMT+01:00 Stephane Ducasse <stepharo.s...@gmail.com>:

> Denis
>
> we should introduce classNamed: now we can have traits and globals too :(
>

Yes, we need to think about it.


> Idea? may be can still classNamed:
>
> Stef
>
>
> On Sun, Feb 11, 2018 at 8:55 PM, Denis Kudriashov <dionisi...@gmail.com>
> wrote:
> >
> >
> > 2018-02-11 20:36 GMT+01:00 Hernán Morales Durand <
> hernan.mora...@gmail.com>:
> >>
> >> 2018-02-11 16:10 GMT-03:00 Denis Kudriashov <dionisi...@gmail.com>:
> >> > Hi Hernan.
> >> >
> >> > 2018-02-11 19:57 GMT+01:00 Hernán Morales Durand
> >> > <hernan.mora...@gmail.com>:
> >> >>
> >> >> Hi Denis
> >> >>
> >> >> 2018-02-10 15:18 GMT-03:00 Denis Kudriashov <dionisi...@gmail.com>:
> >> >> >
> >> >> > 2018-02-10 20:59 GMT+03:00 Stephane Ducasse
> >> >> > <stepharo.s...@gmail.com>:
> >> >> >>
> >> >> >> Please to not use an unary on Symbol
> >> >> >> Dispatch on something.
> >> >> >>
> >> >> >> self class environment at: #Array
> >> >> >> is the best
> >> >> >
> >> >> >
> >> >> > We should not use collection API for reflection calls. It makes
> them
> >> >> > very
> >> >> > difficult to find. Let's use explicit names like:
> >> >> >
> >> >>
> >> >> Sorry I do not see it.
> >> >>
> >> >> The Collection API is beautiful, why couldn't be used for reflection?
> >> >
> >> >
> >> > We have around 3000 senders of #at: message in the image. Do you think
> >> > it is
> >> > easy to filter reflective calls?
> >> >
> >>
> >> I still don't understand your use case, nor how the #at: is related
> >> with the #asClass issue.
> >>
> >> Do you mean **further** filtering for relflective sends?
> >>
> >> Does this affects common-usage beyond Browser development?
> >
> >
> > The Stef proposal was that we should never use #asClass in the code. It
> is
> > fine for scripting but not for the domain code by many reasons which were
> > discussed here and at the past.
> >
> > But I only commented the proposed replacement:
> >
> > self class environment at: #Object
> >
> >
> > If you do not like it, it is different story. I just described problem
> with
> > #at: message:
> >
> > We already replaced many #asClass users with this code. And now it is
> quite
> > difficult to find such places. They all hidden inside 3000 senders of
> #at:.
> > If we will use #classNamed: instead of #at: then simple senders query
> will
> > easily detect all reflective calls.
> > (we probably already use it but not in all places).
> >
> >>
> >>
> >> >>
> >> >> I have no trouble finding #asClass senders, implementors, etc.
> >> >>
> >> >> What do you want to find?
> >> >>
> >> >> > self class environment classNamed: #Array
> >> >> >
> >> >>
> >> >> Too much typing :)
> >> >>
> >> >> >
> >> >> > From the other side we all agree that #asClass is super handy
> method.
> >> >> > And we
> >> >> > can fix it to respect sender environment using thisContext. It will
> >> >> > affects
> >> >> > performance but with our super powerful metalinks it can be easily
> >> >> > cached
> >> >> > (#asMethodConst is implemented that way).
> >> >> > So we can make environment completely transparent for users.
> >> >> >
> >> >> > Best regards,
> >> >> > Denis
> >> >> >
> >> >> >>
> >> >> >> For Modules, we made progress and got bitten by many issues and
> >> >> >> teaching
> >> >> >> load.
> >> >> >>
> >> >> >>
> >> >> >> Stef
> >> >> >>
> >> >> >> On Sat, Feb 10, 2018 at 4:50 PM, Clément Bera
> >> >> >> <bera.clem...@gmail.com>
> >> >> >> wrote:
> >> &g

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-11 Thread Denis Kudriashov
2018-02-11 20:36 GMT+01:00 Hernán Morales Durand <hernan.mora...@gmail.com>:

> 2018-02-11 16:10 GMT-03:00 Denis Kudriashov <dionisi...@gmail.com>:
> > Hi Hernan.
> >
> > 2018-02-11 19:57 GMT+01:00 Hernán Morales Durand <
> hernan.mora...@gmail.com>:
> >>
> >> Hi Denis
> >>
> >> 2018-02-10 15:18 GMT-03:00 Denis Kudriashov <dionisi...@gmail.com>:
> >> >
> >> > 2018-02-10 20:59 GMT+03:00 Stephane Ducasse <stepharo.s...@gmail.com
> >:
> >> >>
> >> >> Please to not use an unary on Symbol
> >> >> Dispatch on something.
> >> >>
> >> >> self class environment at: #Array
> >> >> is the best
> >> >
> >> >
> >> > We should not use collection API for reflection calls. It makes them
> >> > very
> >> > difficult to find. Let's use explicit names like:
> >> >
> >>
> >> Sorry I do not see it.
> >>
> >> The Collection API is beautiful, why couldn't be used for reflection?
> >
> >
> > We have around 3000 senders of #at: message in the image. Do you think
> it is
> > easy to filter reflective calls?
> >
>
> I still don't understand your use case, nor how the #at: is related
> with the #asClass issue.
>
> Do you mean **further** filtering for relflective sends?
>
> Does this affects common-usage beyond Browser development?
>

The Stef proposal was that we should never use #asClass in the code. It is
fine for scripting but not for the domain code by many reasons which were
discussed here and at the past.

But I only commented the proposed replacement:

self class environment at: #Object


If you do not like it, it is different story. I just described problem with
#at: message:

We already replaced many #asClass users with this code. And now it is quite
difficult to find such places. They all hidden inside 3000 senders of #at:.
If we will use #classNamed: instead of #at: then simple senders query will
easily detect all reflective calls.
(we probably already use it but not in all places).


>
> >>
> >> I have no trouble finding #asClass senders, implementors, etc.
> >>
> >> What do you want to find?
> >>
> >> > self class environment classNamed: #Array
> >> >
> >>
> >> Too much typing :)
> >>
> >> >
> >> > From the other side we all agree that #asClass is super handy method.
> >> > And we
> >> > can fix it to respect sender environment using thisContext. It will
> >> > affects
> >> > performance but with our super powerful metalinks it can be easily
> >> > cached
> >> > (#asMethodConst is implemented that way).
> >> > So we can make environment completely transparent for users.
> >> >
> >> > Best regards,
> >> > Denis
> >> >
> >> >>
> >> >> For Modules, we made progress and got bitten by many issues and
> >> >> teaching
> >> >> load.
> >> >>
> >> >>
> >> >> Stef
> >> >>
> >> >> On Sat, Feb 10, 2018 at 4:50 PM, Clément Bera <
> bera.clem...@gmail.com>
> >> >> wrote:
> >> >> > On Sat, Feb 10, 2018 at 4:34 PM, Hernán Morales Durand
> >> >> > <hernan.mora...@gmail.com> wrote:
> >> >> >>
> >> >> >> Hi Clément,
> >> >> >>
> >> >> >> First time I read about modules in Pharo.
> >> >> >> What is a module exactly?
> >> >> >>
> >> >> >> What's the problem to solve?
> >> >> >
> >> >> >
> >> >> > It's similar to namespaces with some different, arguably better,
> >> >> > features.
> >> >> >
> >> >> > Honestly I am not the expert on it so I would like some one else to
> >> >> > answer.
> >> >> >
> >> >> > Among other things, it solves the problem of having 2 classes with
> >> >> > the
> >> >> > same
> >> >> > name (avoiding the prefixes we have like in C). But reportedly
> that's
> >> >> > just a
> >> >> > side-effect and not the main problem to solve.
> >> >> >
> >> >> >>
> >> >> >> Cheers,
> >> >> >>
> >> >&g

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-11 Thread Denis Kudriashov
Hi Hernan.

2018-02-11 19:57 GMT+01:00 Hernán Morales Durand <hernan.mora...@gmail.com>:

> Hi Denis
>
> 2018-02-10 15:18 GMT-03:00 Denis Kudriashov <dionisi...@gmail.com>:
> >
> > 2018-02-10 20:59 GMT+03:00 Stephane Ducasse <stepharo.s...@gmail.com>:
> >>
> >> Please to not use an unary on Symbol
> >> Dispatch on something.
> >>
> >> self class environment at: #Array
> >> is the best
> >
> >
> > We should not use collection API for reflection calls. It makes them very
> > difficult to find. Let's use explicit names like:
> >
>
> Sorry I do not see it.
>
> The Collection API is beautiful, why couldn't be used for reflection?
>

We have around 3000 senders of #at: message in the image. Do you think it
is easy to filter reflective calls?


> I have no trouble finding #asClass senders, implementors, etc.
>
> What do you want to find?
>
> > self class environment classNamed: #Array
> >
>
> Too much typing :)
>
> >
> > From the other side we all agree that #asClass is super handy method.
> And we
> > can fix it to respect sender environment using thisContext. It will
> affects
> > performance but with our super powerful metalinks it can be easily cached
> > (#asMethodConst is implemented that way).
> > So we can make environment completely transparent for users.
> >
> > Best regards,
> > Denis
> >
> >>
> >> For Modules, we made progress and got bitten by many issues and teaching
> >> load.
> >>
> >>
> >> Stef
> >>
> >> On Sat, Feb 10, 2018 at 4:50 PM, Clément Bera <bera.clem...@gmail.com>
> >> wrote:
> >> > On Sat, Feb 10, 2018 at 4:34 PM, Hernán Morales Durand
> >> > <hernan.mora...@gmail.com> wrote:
> >> >>
> >> >> Hi Clément,
> >> >>
> >> >> First time I read about modules in Pharo.
> >> >> What is a module exactly?
> >> >>
> >> >> What's the problem to solve?
> >> >
> >> >
> >> > It's similar to namespaces with some different, arguably better,
> >> > features.
> >> >
> >> > Honestly I am not the expert on it so I would like some one else to
> >> > answer.
> >> >
> >> > Among other things, it solves the problem of having 2 classes with the
> >> > same
> >> > name (avoiding the prefixes we have like in C). But reportedly that's
> >> > just a
> >> > side-effect and not the main problem to solve.
> >> >
> >> >>
> >> >> Cheers,
> >> >>
> >> >> Hernán
> >> >>
> >> >> 2018-02-10 9:47 GMT-03:00 Clément Bera <bera.clem...@gmail.com>:
> >> >> > Hi,
> >> >> >
> >> >> > In short, everything that is not namespace/module compatible will
> be
> >> >> > deprecated/changed/removed in the future, so it is not recommended
> to
> >> >> > use
> >> >> > it.
> >> >> >
> >> >> > a.2) #Array asClassInEnvironment: Smalltalk globals
> >> >> > b.1) Smalltalk globals at: #Array
> >> >> > => Ok-ish, note that you may need to change 'Smalltalk globals' the
> >> >> > namespace/module when support for those will be added since Array
> >> >> > will
> >> >> > be in
> >> >> > a module.
> >> >> > Maybe you want instead to use instead:
> >> >> >
> >> >> > c) self class environment at: #Array
> >> >> > => this will work in the future if your code is a class which
> >> >> > environment/namespace/module includes the Array class you would
> >> >> > expect
> >> >> >
> >> >> > a.1) #Array asClass
> >> >> > b.2) Smalltalk at: #Array
> >> >> > b.3) Smalltalk classNamed: #Array
> >> >> > => In which namespace/module are you looking for #Array ? In the
> >> >> > future
> >> >> > this
> >> >> > may be removed, alternatively it will work only for globals but not
> >> >> > globals
> >> >> > inside namespace/module which won't work since Array will be in a
> >> >> > module.
> >> >> >
> >> >> >
> >> >> > On Sat, Feb 10, 2018 at 

Re: [Pharo-users] canonical way to convert Symbol into Class (retrieve class by its name)

2018-02-10 Thread Denis Kudriashov
2018-02-10 20:59 GMT+03:00 Stephane Ducasse :

> Please to not use an unary on Symbol
> Dispatch on something.
>
> self class environment at: #Array
> is the best
>

We should not use collection API for reflection calls. It makes them very
difficult to find. Let's use explicit names like:

self class environment classNamed: #Array


>From the other side we all agree that #asClass is super handy method. And
we can fix it to respect sender environment using thisContext. It will
affects performance but with our super powerful metalinks it can be easily
cached (#asMethodConst is implemented that way).
So we can make environment completely transparent for users.

Best regards,
Denis


> For Modules, we made progress and got bitten by many issues and teaching
> load.
>
>
> Stef
>
> On Sat, Feb 10, 2018 at 4:50 PM, Clément Bera 
> wrote:
> > On Sat, Feb 10, 2018 at 4:34 PM, Hernán Morales Durand
> >  wrote:
> >>
> >> Hi Clément,
> >>
> >> First time I read about modules in Pharo.
> >> What is a module exactly?
> >>
> >> What's the problem to solve?
> >
> >
> > It's similar to namespaces with some different, arguably better,
> features.
> >
> > Honestly I am not the expert on it so I would like some one else to
> answer.
> >
> > Among other things, it solves the problem of having 2 classes with the
> same
> > name (avoiding the prefixes we have like in C). But reportedly that's
> just a
> > side-effect and not the main problem to solve.
> >
> >>
> >> Cheers,
> >>
> >> Hernán
> >>
> >> 2018-02-10 9:47 GMT-03:00 Clément Bera :
> >> > Hi,
> >> >
> >> > In short, everything that is not namespace/module compatible will be
> >> > deprecated/changed/removed in the future, so it is not recommended to
> >> > use
> >> > it.
> >> >
> >> > a.2) #Array asClassInEnvironment: Smalltalk globals
> >> > b.1) Smalltalk globals at: #Array
> >> > => Ok-ish, note that you may need to change 'Smalltalk globals' the
> >> > namespace/module when support for those will be added since Array will
> >> > be in
> >> > a module.
> >> > Maybe you want instead to use instead:
> >> >
> >> > c) self class environment at: #Array
> >> > => this will work in the future if your code is a class which
> >> > environment/namespace/module includes the Array class you would expect
> >> >
> >> > a.1) #Array asClass
> >> > b.2) Smalltalk at: #Array
> >> > b.3) Smalltalk classNamed: #Array
> >> > => In which namespace/module are you looking for #Array ? In the
> future
> >> > this
> >> > may be removed, alternatively it will work only for globals but not
> >> > globals
> >> > inside namespace/module which won't work since Array will be in a
> >> > module.
> >> >
> >> >
> >> > On Sat, Feb 10, 2018 at 12:57 PM, Peter Uhnák 
> wrote:
> >> >>
> >> >> Hi,
> >> >>
> >> >> what is the canonical way to get a class from a symbol?
> >> >>
> >> >> a) Converting symbol into class via string protocol
> >> >>
> >> >> a.1) #Array asClass
> >> >> I use this the most, because it is easy, uses unary selector, and so
> >> >> far
> >> >> I've never ran into any issues. But apparently it is not good -- why?
> >> >>
> >> >> a.2) #Array asClassInEnvironment: Smalltalk globals
> >> >>
> >> >> b) Retriving the class by key from the system dictionary
> >> >>
> >> >> b.1) Smalltalk globals at: #Array
> >> >>
> >> >> b.2) Smalltalk at: #Array
> >> >>
> >> >> b.3) Smalltalk classNamed: #Array
> >> >>
> >> >> c) something else entirely?
> >> >>
> >> >> I get that using #asClass wouldn't work if there was a different
> >> >> environment, however I don't even know in what situation there could
> be
> >> >> a
> >> >> different environment, so I cannot assert how problematic it is or
> >> >> isn't.
> >> >>
> >> >> Thanks,
> >> >> Peter
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > Clément Béra
> >> > Pharo consortium engineer
> >> > https://clementbera.wordpress.com/
> >> > Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
> >>
> >
> >
> >
> > --
> > Clément Béra
> > Pharo consortium engineer
> > https://clementbera.wordpress.com/
> > Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
>
>


Re: [Pharo-users] Generate equality

2018-02-09 Thread Denis Kudriashov
I will add it to Calypso.
I use it often.

2018-02-08 17:23 GMT+03:00 Herbert Vojčík :

>
> Stephane Ducasse wrote:
>
>> http://smalltalkhub.com/#!/~CAR/ReusableBricks/packages/Equals
>>
>
> Ah. It uses trait that does it dynamically.
>
> Good to know, usable for some more dynamic scenarios; but here I wanted
> something more explicit a la existing "generate xxx", so I went for
> Alistair's suggestion, so it was just a matter of Playground and:
>
> (RBGenerateEqualHashRefactoring className: PharktSymbol variables:
> #(baseAsset quoteAsset)) execute
>
> Thanks.
>
> (btw, it would be nice if that was actually in a menu; but if Nautilus if
> phased out, at least in Calypso in Pharo 7 :-) )
>
> Herby
>
>
> On Thu, Feb 8, 2018 at 12:47 PM, Herbert Vojčík  wrote:
>>
>>>
>>> Alistair Grant wrote:
>>>
 Hi Herby,

 On 8 February 2018 at 03:10, Herbert Vojčík   wrote:

> Hi!
>
> Do you think it would be reasonable to have, a la "generate accessors"
> /
> "generate initialize method", a "generate equality" thingie that would
> generate #= and #hash for the method, mechanically?
>
> Just created a new "piece of data" class and felt like it would be
> helpful.
>

 The refactoring browser is already capable of generating #= and #hash:

>>>
>>> Now somebody tell me it actually is there in the Nautilus menu, I just
>>> did
>>> not find it. Which would be the best outcome, save making myself
>>> ridiculous
>>> online... :-)
>>>
>>>
>>> | r |

 r := RBGenerateEqualHashRefactoring
   className: MyClass
   variables: #(vars which should be used in equal and hash).
 r execute


 HTH,
 Alistair


>>
>


Re: [Pharo-users] Pharo things analog reads ?

2018-02-05 Thread Denis Kudriashov
Hi Steven.

I added I2C support
<https://github.com/pharo-iot/PharoThings/releases/tag/v0.2.1> to
PharoThings and WiringPi.

Now you can ask the board instance for I2C connection:

i2cConnection := board connectToI2CDevice: 4.


And then read/write data using wiringpi functions like:

i2cConnection readData.
i2cConnection read8BitsAt: 16r32 "register".

i2cConnection writeData: 16rAB.
i2cConnection write8BitsAt: 16r32 "register" data: 16rA5.


Also I added I2CDevice as superclass for simple i2c devices. There is
example of accelerometer ADXL345. Look for details.


Best regards,
Denis


2017-12-19 23:20 GMT+01:00 Steven Costiou <steven.cost...@kloum.io>:

> hi,
>
> i've tried i2c and added ffi calls in WiringPiLibrary.
>
> *wiringPiI2cSetup: devId*
>
> ^self ffiCall: #(int wiringPiI2CSetup (int devId) )
>
> *readI2C: fd*
>
> ^self ffiCall: #(int wiringPiI2CRead (int fd))
>
> Then the following script is able to read a byte from a connected device
> (i tried with a trinket https://learn.adafruit.com/introducing-trinket/
> introduction):
> <https://learn.adafruit.com/introducing-trinket/introduction)>
>
> |lib addr val|
>
> lib := WiringPiLibrary uniqueInstance.
>
> addr := self wiringPiSetupI2C: 4. *“Setup the i2c to the 0x04 address”*
> val := self readI2C: addr. *“Read a byte from the i2c address”*
>
> val inspect
>
> So connecting an Arduino-like device to the raspberry that is configured
> as an i2c slave, Pharo can ask for analog values. I will try tomorrow with
> analog sensors, I will share if i manage to build nice examples.
>
> Seems to be even easier using a special chip: https://learn.adafruit.com/
> reading-a-analog-in-and-controlling-audio-volume-with-
> the-raspberry-pi?view=all
>
> but it uses more pins on the board.
>
> Steven.
>
>
>
> Le 2017-12-17 19:48, Denis Kudriashov a écrit :
>
> Hi Steven
>
> 2017-12-17 12:40 GMT+01:00 Steven Costiou <steven.cost...@kloum.io>:
>
>> Hi,
>>
>> For what i know, raspberry pi boards cannot read analog sensors (which
>> are the most interesting imo), except by connecting to some kind of bridges
>> or to Arduino boards.
>>
>> In the PharoTHings code i see that there are Arduino classes, and also it
>> is based on wiringpi and wiringpi provides support for i2c which is needed
>> to connect to an Arduino and perform analog reads.
>>
>> I'm exploring the wiringpi doc to see if there is an example for that,
>> but in the meantime, would someone already have an example of analog reads
>> with PharoThings, with working code (even simple) ?
>>
> It is in my todo. I need to build example with temperature sensor. I will
> continue work on it next year.
> Now feel free to contribute to the project.
>
> About Arduino: it is not finished. Problem that I use Mac but serial port
> is not working there (it is required for Firmata)
>
>>
>>
>> Steven.
>>
>


Re: [Pharo-users] calypso modularity

2018-01-22 Thread Denis Kudriashov
Hi Peter.

Calypso is modular but maybe not in the parts which you need.

There are two core packages which are not related to the "Smalltalk
navigation":
- navigation model based on first class queries.
- UI components for possible browsers

And I imagine how I would use them in particular business applications
which I built in may career.
Now the only example is "Smalltalk navigation" which is packaged in
multiple "SystemQueries" and "SystemTools" packages.

2018-01-20 21:40 GMT+01:00 Peter Uhnák :

> Hi,
>
> how modular is Calypso in respect to:
>
> * taking the UI apart and compositing it in a different manner
>

Calypso is not a browser framework like Glamour. So the UI part is
restricted by the required browsers controlfow in the abstract class
ClyBrowser:
- top half of window is used to place navigation panes which should be
defined by subclasses
- bottom half of window is used by tabs.
- and toolbar at the middle.

Tabs, toolbar items, context menu and shortcuts are all pluggable. They all
extended by annotating required classes with context where they should be
used.
So they are not hardcoded and reusable.

Navigation panes are defined as instances of ClyQueryView which is reusable
widget to show result of any calypso query. It implements correct updating
after system changes, maintains item selection and provide menus and
shortcuts.

* reusing parts of it in a different place/application (e.g. just the code
> editor, or just the method list, ...)
>

It is in todo.
But now these tools are required to be in browser tabs, they know about
tab. But I want to be able annotate arbitrary widget that it should be
shown as browser tab.


> * using alternative abstractions to just package/class/protocol/method
>   * e.g. instead of showing classes SomeSubject, SomeSubjectTest it would
> show "Some Subject" (a string returned by SomeSubject class>>myName) and
> clicking on it would show the combined methods from both the SomeSubject
> and SomeSubjectTest.
>

So as I said these panes are based on ClyQueryView. Whatever query you
would pass it will show result items. Query can return mixed items. For
example QueryBrowser shows together methods, classes and class comments.
All menus and shortcuts are continue work with known types. And you can
implement new commands for new items type.

Only questions is how inject special queries to the required panes. It is
now hardcoded. And there is hardcoded logic how to handle selection
changes.
For example FullBrowser knows that it should show methods for selected
classes. It expects that class pane will provide classes and not something
else.

But there is already system of browser plugins and we can delegate some
logic to them. The question is what use cases we need.
For example to support optional trait methods visibility I will need to
allow plugins decorate default scope for methods. Trait plugin will extends
with inherited traits (when trait visibility is enabled by default).
In addition it could provide possibility to implement mixed instance side
and class side mode.


> Also would such alternate usecases be considered a feature of Calypso (so
> it is intentional in building Calypso to use it in a different manner), or
> purely coincidental (as in, if it is possible, Calypso is built for
> different purpose and I cannot expect that some property will not disappear
> in the future).
>

Yes. I think it is important to be able experiment.


>
> Thanks a lot!
> Peter
>


Re: [Pharo-users] Working directory

2018-01-18 Thread Denis Kudriashov
Also notice that OS can give program very surprising working directory when
you run it using UI tools.
For example in MacOS drag image to the vm using Finder assigns root (/) as
working directory.


2017-12-15 21:38 GMT+01:00 Hilaire :

> Oh, in a build for a DrGeo app based on P7, the working directory is one
> level highter to the image folder.
>
> So in P7, there are two different results for the working directory: the
> user home directory, and one level hight to image dir.
>
> What's the context? Where to look at?
>
>
> --
> Dr. Geo
> http://drgeo.eu
>
>


Re: [Pharo-users] Commander feedback

2018-01-17 Thread Denis Kudriashov
And thank's a lot, Juraj.

Very impressive review :). I will answer questions later

2018-01-17 16:04 GMT+01:00 Denis Kudriashov <dionisi...@gmail.com>:

> Hy Juraj,
>
> Do not spend time in Calypso part and even do not read it :). It is super
> outdated and very draft. I am now working on it.
>
> I will look you changes soon.
>
> 2018-01-17 15:07 GMT+01:00 Juraj Kubelka <juraj.kube...@icloud.com>:
>
>> Hi Denis,
>>
>> I finally read Section 3. I left two comments where I do not understand
>> why something happens. I will appreciate a further explanation :-)
>>
>> Here is the pull request: https://github.com/Sq
>> uareBracketAssociates/Booklet-Infrastructure/pull/2
>>
>> I have found out that the code in the Calypso chapter does not work. I
>> was able to change some of them. Do you want me to commit what I was able
>> to change? Well, you should check if the changes are correct.
>>
>> Cheers,
>> Juraj
>>
>>
>> On Dec 27, 2017, at 13:20, Denis Kudriashov <dionisi...@gmail.com> wrote:
>>
>> Hi Juraj.
>>
>> You can find new version here https://github.com/Square
>> BracketAssociates/Booklet-Infrastructure
>> <https://github.com/SquareBracketAssociates/Booklet-Infrastructure>. It
>> is still draft version but in general all parts are covered now.
>>
>> 2017-12-06 12:47 GMT+01:00 Juraj Kubelka <juraj.kube...@icloud.com>:
>>
>>> Hi Denis,
>>>
>>> Thank you. Let me know. I will be happy to help.
>>>
>>> Juraj
>>>
>>>
>>> On Dec 5, 2017, at 18:43, Denis Kudriashov <dionisi...@gmail.com> wrote:
>>>
>>> Hi Juraj.
>>>
>>> Yes. documentation needs to be improved. I made only pass on it.
>>> Now there is new Commander version. The code still in dev branch
>>> <https://github.com/dionisiydk/Commander/tree/dev>. The basic idea is
>>> same but some names are changed and internally it is based on
>>> ClassAnnotation's <https://github.com/dionisiydk/ClassAnnotation>. It
>>> became more simple and flexible.
>>> This week I should release new Calypso version. And after I will work on
>>> documentation for both projects. Commander will be first. And next week I
>>> will have update on it.
>>>
>>> 2017-12-05 21:05 GMT+01:00 Juraj Kubelka <juraj.kube...@icloud.com>:
>>>
>>>> Hi,
>>>>
>>>> I like the idea of the Commander library https://github.com/dio
>>>> nisiydk/Commander
>>>> I am trying to understand how to use it, but I struggle to understand
>>>> it as documentation includes quiete complex examples:
>>>> https://ci.inria.fr/pharo-contribution/view/Books/
>>>> job/PharoBookWorkInProgress/lastSuccessfulBuild/artifact/boo
>>>> k-result/Commander/Commander.html
>>>>
>>>> I believe that it would be useful to have a tutorial that shows:
>>>>
>>>> 1. create a command CmdOne including methods,
>>>> 2. create a activator ActOne including methods,
>>>> 3. create a context CtxOne including methods,
>>>> 4. execute  and you obtain a collection with one
>>>> item (CmdOne instance?)
>>>> 5. create command CmdTwo with some methods
>>>> 6. execute  and you obtain a collection with two
>>>> items
>>>>
>>>> Then next section could describe how to make a UI on top of this.
>>>>
>>>
>>> Thank's for initiative. It is exactly what I will do.
>>>
>>>
>>>>
>>>> Learning it by exploring Calypso is too complex, because it involves
>>>> more objects and I actually do not see how to do the previous steps.
>>>>
>>>
>>> I agree, current version is a bit complicated inside. But it is already
>>> fixed. And there will be update soon.
>>>
>>>
>>>>
>>>> I will be happy to help with the documentation.
>>>> My question is: How can I proceed the mentioned steps?
>>>>
>>>
>>> I would appreciate for your help. I will call you for review next week.
>>>
>>> Best regards,
>>> Denis
>>>
>>>
>>>> Thanks,
>>>> Juraj
>>>>
>>>
>>>
>>
>>
>


Re: [Pharo-users] Commander feedback

2018-01-17 Thread Denis Kudriashov
Hy Juraj,

Do not spend time in Calypso part and even do not read it :). It is super
outdated and very draft. I am now working on it.

I will look you changes soon.

2018-01-17 15:07 GMT+01:00 Juraj Kubelka <juraj.kube...@icloud.com>:

> Hi Denis,
>
> I finally read Section 3. I left two comments where I do not understand
> why something happens. I will appreciate a further explanation :-)
>
> Here is the pull request: https://github.com/SquareBracketAssociates/
> Booklet-Infrastructure/pull/2
>
> I have found out that the code in the Calypso chapter does not work. I was
> able to change some of them. Do you want me to commit what I was able to
> change? Well, you should check if the changes are correct.
>
> Cheers,
> Juraj
>
>
> On Dec 27, 2017, at 13:20, Denis Kudriashov <dionisi...@gmail.com> wrote:
>
> Hi Juraj.
>
> You can find new version here https://github.com/SquareBracketAssociates/
> Booklet-Infrastructure
> <https://github.com/SquareBracketAssociates/Booklet-Infrastructure>. It
> is still draft version but in general all parts are covered now.
>
> 2017-12-06 12:47 GMT+01:00 Juraj Kubelka <juraj.kube...@icloud.com>:
>
>> Hi Denis,
>>
>> Thank you. Let me know. I will be happy to help.
>>
>> Juraj
>>
>>
>> On Dec 5, 2017, at 18:43, Denis Kudriashov <dionisi...@gmail.com> wrote:
>>
>> Hi Juraj.
>>
>> Yes. documentation needs to be improved. I made only pass on it.
>> Now there is new Commander version. The code still in dev branch
>> <https://github.com/dionisiydk/Commander/tree/dev>. The basic idea is
>> same but some names are changed and internally it is based on
>> ClassAnnotation's <https://github.com/dionisiydk/ClassAnnotation>. It
>> became more simple and flexible.
>> This week I should release new Calypso version. And after I will work on
>> documentation for both projects. Commander will be first. And next week I
>> will have update on it.
>>
>> 2017-12-05 21:05 GMT+01:00 Juraj Kubelka <juraj.kube...@icloud.com>:
>>
>>> Hi,
>>>
>>> I like the idea of the Commander library https://github.com/dio
>>> nisiydk/Commander
>>> I am trying to understand how to use it, but I struggle to understand it
>>> as documentation includes quiete complex examples: https://ci.inria.fr/
>>> pharo-contribution/view/Books/job/PharoBookWorkInProgress/la
>>> stSuccessfulBuild/artifact/book-result/Commander/Commander.html
>>>
>>> I believe that it would be useful to have a tutorial that shows:
>>>
>>> 1. create a command CmdOne including methods,
>>> 2. create a activator ActOne including methods,
>>> 3. create a context CtxOne including methods,
>>> 4. execute  and you obtain a collection with one
>>> item (CmdOne instance?)
>>> 5. create command CmdTwo with some methods
>>> 6. execute  and you obtain a collection with two
>>> items
>>>
>>> Then next section could describe how to make a UI on top of this.
>>>
>>
>> Thank's for initiative. It is exactly what I will do.
>>
>>
>>>
>>> Learning it by exploring Calypso is too complex, because it involves
>>> more objects and I actually do not see how to do the previous steps.
>>>
>>
>> I agree, current version is a bit complicated inside. But it is already
>> fixed. And there will be update soon.
>>
>>
>>>
>>> I will be happy to help with the documentation.
>>> My question is: How can I proceed the mentioned steps?
>>>
>>
>> I would appreciate for your help. I will call you for review next week.
>>
>> Best regards,
>> Denis
>>
>>
>>> Thanks,
>>> Juraj
>>>
>>
>>
>
>


Re: [Pharo-users] Is there a way to stop arrays sorting automatically?

2017-12-31 Thread Denis Kudriashov
Hi.

2017-12-31 14:47 GMT+01:00 Andy Burnett :
>
>
> Thanks Ben,
> That is really interesting. I had completely misunderstood the problem.
> Checking the items in oc2 shows that they are literally the same object.
> So, it would seem that I have to run copy, or some other method to get a
> unique object.
>
> I can see that this would make sense from an efficiency perspective.
> Reusing the same object would presumably save memory space. However, it
> would probably be good to update the comment to let people know that this
> will happen.
>
> What is the process for submitting suggested improvements to class
> comments?
>

It's same as any other code. Just follow instructions
https://github.com/pharo-project/pharo/wiki/Contribute-a-fix-to-Pharo. It
is now simplified a lot.


>
> Cheers
> Andy
>


Re: [Pharo-users] [Vm-dev] Running headless on Windows

2017-12-29 Thread Denis Kudriashov
2017-12-29 16:13 GMT+01:00 Andrei Stebakov :

> Nicolai, the maximize/non-maximize trick worked! Thanks! I wonder if it's
> an easy fix to put in Pharo.
>

So it means that something in image is not initialised. It can be another
bug of wrong startup order


>
> On Fri, Dec 29, 2017 at 6:22 AM, p...@highoctane.be 
> wrote:
>
>> I am using nssm because the service option is broken.
>>
>> The code seems to still be in the image but disabled (there are quite a
>> few things like that actually).
>>
>> Phil
>>
>>
>> On Fri, Dec 29, 2017 at 11:59 AM, Torsten Bergmann 
>> wrote:
>>
>>>
>>> Hi, (cross posting vm-dev)
>>>
>>> nssm is nice - but requires additional tools.
>>>
>>> Since the days of Squeak the windows VM had the
>>>
>>>  -service "ServiceName"
>>>
>>> option and one was able to run Squeak as a windows service out of the
>>> box.
>>>
>>> See http://wiki.squeak.org/squeak/105 for details.
>>>
>>> This option allows to register/deregister with the windows service
>>> manager and run
>>> a headless image.
>>>
>>> I run a Squeak Wiki (Swiki/Comanche) since years with this and it is
>>> very nice and stable.
>>>
>>> Unfortunately this is broken in recent Pharo VMs and so far Esteban or
>>> others did not
>>> have the time to look into this issue. Would be really nice if this
>>> option could
>>> be recovered in 2018. So one could easily deploy and run Seaside or
>>> Teapot/Tealight
>>> or Zinc/WebClient based web services on Windows.
>>>
>>> If we want to deploy Smalltalk based web applications or services on
>>> Windows we
>>> should support that. It will keep Windows administrators happy and we
>>> would integrate with
>>> the whole ecosystem (for instance you can start/stop a service using
>>> Windows scripting for
>>> doing backups, etc.) right out of the box.
>>>
>>> Bye
>>> T.
>>>
>>>
>>>
>>> Gesendet: Freitag, 29. Dezember 2017 um 11:36 Uhr
>>> Von: "p...@highoctane.be" 
>>> An: "Any question about pharo is welcome" 
>>> Betreff: Re: [Pharo-users] Running headless on Windows
>>>
>>> If you want to run Pharo as a service, I have found nssm to be working
>>> well.
>>>  https://nssm.cc
>>>
>>> Phil
>>>
>>> On Dec 29, 2017 09:25, "Nicolai Hess" >> nicolaih...@gmail.com]> wrote:
>>>
>>>
>>> 2017-12-29 3:07 GMT+01:00 Andrei Stebakov >> sper...@gmail.com]>:
>>> Pierce, I tried all of those "no display" options, the result is the same
>>>
>>>
>>> On Dec 28, 2017 8:37 PM, "Pierce Ng" >> pie...@samadhiweb.com]> wrote:On Wed, Dec 27, 2017 at 04:58:39PM +0100,
>>> Cyril Ferlicot D. wrote:
>>> > On 12/27/2017 04:39 PM, Andrei Stebakov wrote:
>>> > > When I run Pharo 6.1 with -- headless option on Windows, it executes
>>> the
>>> > > eval command as expected but during the execution (which lasts 4
>>> sec) it
>>> > > opens the Pharo GUI.
>>> > > Is it expected? I thought headless means that the whole execution
>>> would
>>> > > happen in the background
>>> >
>>> > I think that currently Pharo does not have a "real" headless. But I
>>> > heard there was work on that part for Pharo 7.
>>>
>>> I know OP is talking about Windows...  I've been running server
>>> applications on
>>> Linux without X11 with -vm-display-null and in-image RFBServer for
>>> access to
>>> Pharo over VNC. This works very well for me.
>>>
>>> I believe "real" headless means GUI is not run at all and therefore does
>>> not
>>> consume CPU cycles, which is very welcome. Meanwhile, maybe
>>> -vm-display-null
>>> works on Windows for scripting purposes?
>>>
>>> Pierce
>>>
>>>
>>>
>>> Hi Andrei,
>>>
>>> can you try this:
>>>
>>> Open Pharo normal (no headless option).
>>> Change the window size to "not-maximized" (eve if it is actually not
>>> maximized, maximize it ones and change it back to "not-maximized")
>>> Save and quit the image.
>>>
>>> After that, a call like
>>>
>>> pharo --headless pharo.image eval "DateAndTime now"
>>> will write the output to the stdout file, without opening a window.
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>


Re: [Pharo-users] Commander feedback

2017-12-28 Thread Denis Kudriashov
Only Calypso is not ready.


2017-12-28 13:03 GMT+01:00 Juraj Kubelka <juraj.kube...@icloud.com>:

> Hi Denis,
>
> thanks! I will read it soon.
>
> You say that Calypso chapter is in wrong state. What chapters are
> up-to-date? I guess that Chapter 3 is what you updated recently, right?
>
> Cheers,
> Juraj
>
>
> On Dec 28, 2017, at 07:03, Denis Kudriashov <dionisi...@gmail.com> wrote:
>
>
>
> 2017-12-28 11:02 GMT+01:00 Denis Kudriashov <dionisi...@gmail.com>:
>
>> Hi
>>
>> 2017-12-27 19:15 GMT+01:00 Sean P. DeNigris <s...@clipperadams.com>:
>>
>>> Denis Kudriashov wrote
>>> > https://github.com/SquareBracketAssociates/Booklet-Infrastructure
>>>
>>> Cool! Can't wait to read :)
>>
>>
> Also notice, the Calypso chapter is in wrong state. Do not try read it.
> Next year I will push it
>
>
>>
>> And feel free to pull requests.
>>
>>
>>> One small question: why
>>> "Booklet-Infrastructure"? That doesn't seem to match up to "A booklet on
>>> the
>>> infrastructure of the Calypso tool suite"…
>>>
>>
>> It's question to Stef :). I just updated prepared chapters.
>>
>>
>>>
>>>
>>> -
>>> Cheers,
>>> Sean
>>> --
>>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>>
>>>
>>
>
>


Re: [Pharo-users] Commander feedback

2017-12-28 Thread Denis Kudriashov
2017-12-28 11:02 GMT+01:00 Denis Kudriashov <dionisi...@gmail.com>:

> Hi
>
> 2017-12-27 19:15 GMT+01:00 Sean P. DeNigris <s...@clipperadams.com>:
>
>> Denis Kudriashov wrote
>> > https://github.com/SquareBracketAssociates/Booklet-Infrastructure
>>
>> Cool! Can't wait to read :)
>
>
Also notice, the Calypso chapter is in wrong state. Do not try read it.
Next year I will push it


>
> And feel free to pull requests.
>
>
>> One small question: why
>> "Booklet-Infrastructure"? That doesn't seem to match up to "A booklet on
>> the
>> infrastructure of the Calypso tool suite"…
>>
>
> It's question to Stef :). I just updated prepared chapters.
>
>
>>
>>
>> -
>> Cheers,
>> Sean
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>>
>


Re: [Pharo-users] Commander feedback

2017-12-28 Thread Denis Kudriashov
Hi

2017-12-27 19:15 GMT+01:00 Sean P. DeNigris <s...@clipperadams.com>:

> Denis Kudriashov wrote
> > https://github.com/SquareBracketAssociates/Booklet-Infrastructure
>
> Cool! Can't wait to read :)


And feel free to pull requests.


> One small question: why
> "Booklet-Infrastructure"? That doesn't seem to match up to "A booklet on
> the
> infrastructure of the Calypso tool suite"…
>

It's question to Stef :). I just updated prepared chapters.


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


Re: [Pharo-users] image/vm mismatch on raspberry pi model 3

2017-12-28 Thread Denis Kudriashov
Hi Greg.

2017-12-28 4:05 GMT+01:00 Greg Lewin :

> (I want to try https://github.com/pharo-iot/PharoThings on the pi) - I
> now see there is another VM on there ... I have just tried it with
> better results.  Matching image-VM versions does seem to be a problem
> with Smalltalk.
>

So with github instruction you are succeed, right?

Problem that CI job which you found is super outdated. Probably we should
remove it.
There was major VM release called Spur VM which produced incompatibility
with old image versions. Normally you will not see such problems because
major updates are very rare.


>
> ...
>
> On 28 December 2017 at 02:34, Greg Lewin  wrote:
> > Hi,
> >
> >
> > Having copied a viable pair of image+changes and its associated
> > sources file to a pi 3,  in the same directory as the directory from
> > the zip file (from
> > https://ci.inria.fr/pharo/view/RaspberryPi/job/
> RaspberryPi-Publish/ws/64.zip)
> > containing the VM code for a rpi,
> >
> > on running
> >
> > ./PharoS Pharo6.1
> >
> > I get the message
> >
> > "This interpreter (vers. 6505) cannot read image file (vers. 6521)."
> >
> > How does one ensure a match between VM and image+sources on raspberry pi
> ?
> >
> > I have also tried one image pair from an earlier version and get a
> > similar message.
> >
> > thanks
> >
> > Greg
>
>


Re: [Pharo-users] Commander feedback

2017-12-27 Thread Denis Kudriashov
Hi Juraj.

You can find new version here
 https://github.com/SquareBracketAssociates/Booklet-Infrastructure
<https://github.com/SquareBracketAssociates/Booklet-Infrastructure>. It is
still draft version but in general all parts are covered now.

2017-12-06 12:47 GMT+01:00 Juraj Kubelka <juraj.kube...@icloud.com>:

> Hi Denis,
>
> Thank you. Let me know. I will be happy to help.
>
> Juraj
>
>
> On Dec 5, 2017, at 18:43, Denis Kudriashov <dionisi...@gmail.com> wrote:
>
> Hi Juraj.
>
> Yes. documentation needs to be improved. I made only pass on it.
> Now there is new Commander version. The code still in dev branch
> <https://github.com/dionisiydk/Commander/tree/dev>. The basic idea is
> same but some names are changed and internally it is based on
> ClassAnnotation's <https://github.com/dionisiydk/ClassAnnotation>. It
> became more simple and flexible.
> This week I should release new Calypso version. And after I will work on
> documentation for both projects. Commander will be first. And next week I
> will have update on it.
>
> 2017-12-05 21:05 GMT+01:00 Juraj Kubelka <juraj.kube...@icloud.com>:
>
>> Hi,
>>
>> I like the idea of the Commander library https://github.com/dio
>> nisiydk/Commander
>> I am trying to understand how to use it, but I struggle to understand it
>> as documentation includes quiete complex examples: https://ci.inria.fr/
>> pharo-contribution/view/Books/job/PharoBookWorkInProgress/la
>> stSuccessfulBuild/artifact/book-result/Commander/Commander.html
>>
>> I believe that it would be useful to have a tutorial that shows:
>>
>> 1. create a command CmdOne including methods,
>> 2. create a activator ActOne including methods,
>> 3. create a context CtxOne including methods,
>> 4. execute  and you obtain a collection with one item
>> (CmdOne instance?)
>> 5. create command CmdTwo with some methods
>> 6. execute  and you obtain a collection with two items
>>
>> Then next section could describe how to make a UI on top of this.
>>
>
> Thank's for initiative. It is exactly what I will do.
>
>
>>
>> Learning it by exploring Calypso is too complex, because it involves more
>> objects and I actually do not see how to do the previous steps.
>>
>
> I agree, current version is a bit complicated inside. But it is already
> fixed. And there will be update soon.
>
>
>>
>> I will be happy to help with the documentation.
>> My question is: How can I proceed the mentioned steps?
>>
>
> I would appreciate for your help. I will call you for review next week.
>
> Best regards,
> Denis
>
>
>> Thanks,
>> Juraj
>>
>
>


Re: [Pharo-users] Running headless on Windows

2017-12-27 Thread Denis Kudriashov
Hi.

I think there is separate PharoConsole.exe for headless on Windows

2017-12-27 16:39 GMT+01:00 Andrei Stebakov :

> When I run Pharo 6.1 with -- headless option on Windows, it executes the
> eval command as expected but during the execution (which lasts 4 sec) it
> opens the Pharo GUI.
> Is it expected? I thought headless means that the whole execution would
> happen in the background
>


Re: [Pharo-users] Usability issues with Calypso

2017-12-27 Thread Denis Kudriashov
Hi Sean

2017-09-24 14:46 GMT+02:00 Denis Kudriashov <dionisi...@gmail.com>:

> Hi Sean
>
> 2017-09-23 19:57 GMT+02:00 Sean P. DeNigris <s...@clipperadams.com>:
>
>> Stephane Ducasse-3 wrote
>> > Calypso is still an enfant and this is
>> > IMPORTANT that people tell what
>> > they do not like so that we can improve.
>>
>> A few more impressions now that I've been using Calypso as my default
>> browser:
>> - Overall really enjoying it!
>> - When browsing a class from its own package, and then adding an extension
>> protocol via '*...' in "New protocol" context menu, the dialog closes
>> without objection, but then the new protocol doesn't seem to exist. I had
>> to
>> create a dummy protocol and then DND the methods into the
>> package-to-be-extended.
>>
>
> In Calypso you should not create protocols with star. In method editor
> status bar there is explicit checkbox "extension"  to specify external
> package for the method.
> We should move away from star convention and work directly with packages.
> Calypso gives you the tools for this.
>
> But I will add special notification when user creates new protocol with
> star. I think it will help "old" Pharo users to adopt.
> https://github.com/dionisiydk/Calypso/issues/96
>

It is done in latest stable version. In addition there is new behavior when
user selects extended class (which is grey in class list):

- extending package group is added to the method group list. It is placed
just after "extensions" group.
- extending package group is selected by default which shows only extended
methods instead of all method
- automatic selection of extended class side:

- if instance side is extended then browser switches to instance side when
you select it

- if class side is extended then browser switches to class side when you
select it

- if both sides are extended there will be two classes in class list:
"AClass" and "AClass class"


It means that now when you select extended class the browser will show
"expected" extended methods. You do not need anymore to scroll protocol
list to find current package. And you do not need to guess where extension
is actually defined: in instance side or in class side.


>
>
>> - When Calypso is set to be the default browser, it would be helpful if
>> the
>> World menu item changed from "Calypso Browser" to "Nautilus"
>> - Lack of word wrapping is becoming teeedious
>>
>>
>>
>> -
>> Cheers,
>> Sean
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>>
>


Re: [Pharo-users] Breakpoints in Pharo

2017-12-27 Thread Denis Kudriashov
2017-12-27 10:37 GMT+01:00 Nicolai Hess :

> Works for me too (on windows).
> But sometimes, a change and accept of the current method, does not removes
> the "Breakpoint"-Icon.
> So, it looks like there is a breakpoint, but isn't anymore and the code of
> course does not trigger the debugger.
> The icon vanishes, if I unselect and select the current method.
>

I think it is fixed in Calypso

2017-12-27 10:27 GMT+01:00 kmo :
>
>> Just tried it in Pharo 6.1 on Linux 32 bit. Breakpoints work. So
>> presumably
>> this is a Pharo on Windows issue.
>>
>>
>>
>>
>> --
>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>
>>
>


Re: [Pharo-users] Pharo things analog reads ?

2017-12-20 Thread Denis Kudriashov
Thank's for links. I will look

2017-12-19 23:20 GMT+01:00 Steven Costiou <steven.cost...@kloum.io>:

> hi,
>
> i've tried i2c and added ffi calls in WiringPiLibrary.
>
> *wiringPiI2cSetup: devId*
>
> ^self ffiCall: #(int wiringPiI2CSetup (int devId) )
>
> *readI2C: fd*
>
> ^self ffiCall: #(int wiringPiI2CRead (int fd))
>
> Then the following script is able to read a byte from a connected device
> (i tried with a trinket https://learn.adafruit.com/introducing-trinket/
> introduction):
> <https://learn.adafruit.com/introducing-trinket/introduction)>
>



> |lib addr val|
>
> lib := WiringPiLibrary uniqueInstance.
>
> addr := self wiringPiSetupI2C: 4. *“Setup the i2c to the 0x04 address”*
> val := self readI2C: addr. *“Read a byte from the i2c address”*
>
> val inspect
>
> So connecting an Arduino-like device to the raspberry that is configured
> as an i2c slave, Pharo can ask for analog values. I will try tomorrow with
> analog sensors, I will share if i manage to build nice examples.
>
> Seems to be even easier using a special chip: https://learn.adafruit.com/
> reading-a-analog-in-and-controlling-audio-volume-with-
> the-raspberry-pi?view=all
>
> but it uses more pins on the board.
>
> Steven.
>
>
>
> Le 2017-12-17 19:48, Denis Kudriashov a écrit :
>
> Hi Steven
>
> 2017-12-17 12:40 GMT+01:00 Steven Costiou <steven.cost...@kloum.io>:
>
>> Hi,
>>
>> For what i know, raspberry pi boards cannot read analog sensors (which
>> are the most interesting imo), except by connecting to some kind of bridges
>> or to Arduino boards.
>>
>> In the PharoTHings code i see that there are Arduino classes, and also it
>> is based on wiringpi and wiringpi provides support for i2c which is needed
>> to connect to an Arduino and perform analog reads.
>>
>> I'm exploring the wiringpi doc to see if there is an example for that,
>> but in the meantime, would someone already have an example of analog reads
>> with PharoThings, with working code (even simple) ?
>>
> It is in my todo. I need to build example with temperature sensor. I will
> continue work on it next year.
> Now feel free to contribute to the project.
>
> About Arduino: it is not finished. Problem that I use Mac but serial port
> is not working there (it is required for Firmata)
>
>>
>>
>> Steven.
>>
>


Re: [Pharo-users] Pharo things analog reads ?

2017-12-17 Thread Denis Kudriashov
Hi Steven

2017-12-17 12:40 GMT+01:00 Steven Costiou :

> Hi,
>
> For what i know, raspberry pi boards cannot read analog sensors (which are
> the most interesting imo), except by connecting to some kind of bridges or
> to Arduino boards.
>
> In the PharoTHings code i see that there are Arduino classes, and also it
> is based on wiringpi and wiringpi provides support for i2c which is needed
> to connect to an Arduino and perform analog reads.
>
> I'm exploring the wiringpi doc to see if there is an example for that, but
> in the meantime, would someone already have an example of analog reads with
> PharoThings, with working code (even simple) ?
>
It is in my todo. I need to build example with temperature sensor. I will
continue work on it next year.
Now feel free to contribute to the project.

About Arduino: it is not finished. Problem that I use Mac but serial port
is not working there (it is required for Firmata)

>
>
> Steven.
>


Re: [Pharo-users] Calypso bugs with metalinks in latest 7

2017-12-07 Thread Denis Kudriashov
Hi.

It looks strange because Calypso do not use Ring classes.

To disable critiques look at Problems section in github Calypso


2017-12-07 10:50 GMT+01:00 Steven Costiou :

> Hi,
>
> running Reflectivity tests (e.g. ReflectivityReificationTest) provokes
> errors and tests fails:
>
> RGMethodDefinition did not understand #isDeprecated. Seems to be located
> in MetaLinkChanged calypso extension (the 4 methods provoke the same bug).
>
> To reproduce it i used the launcher to get the latest pharo 7 and the
> script from here to get Calypso https://github.com/dionisiydk/Calypso
>
> Also, is it possible to switch off ClyCriticsAnalysis ? I have problems
> while experimenting with instance-specific metalinks, and i cannot yet
> describe exactly how to reproduce it. I'd like to disable it until i can
> fix bugs in my own work before reactivating it...
>
>
>
> Steven.
>


Re: [Pharo-users] Commander feedback

2017-12-05 Thread Denis Kudriashov
Hi Juraj.

Yes. documentation needs to be improved. I made only pass on it.
Now there is new Commander version. The code still in dev branch
. The basic idea is same
but some names are changed and internally it is based on ClassAnnotation's
. It became more simple and
flexible.
This week I should release new Calypso version. And after I will work on
documentation for both projects. Commander will be first. And next week I
will have update on it.

2017-12-05 21:05 GMT+01:00 Juraj Kubelka :

> Hi,
>
> I like the idea of the Commander library https://github.com/
> dionisiydk/Commander
> I am trying to understand how to use it, but I struggle to understand it
> as documentation includes quiete complex examples: https://ci.inria.fr/
> pharo-contribution/view/Books/job/PharoBookWorkInProgress/
> lastSuccessfulBuild/artifact/book-result/Commander/Commander.html
>
> I believe that it would be useful to have a tutorial that shows:
>
> 1. create a command CmdOne including methods,
> 2. create a activator ActOne including methods,
> 3. create a context CtxOne including methods,
> 4. execute  and you obtain a collection with one item
> (CmdOne instance?)
> 5. create command CmdTwo with some methods
> 6. execute  and you obtain a collection with two items
>
> Then next section could describe how to make a UI on top of this.
>

Thank's for initiative. It is exactly what I will do.


>
> Learning it by exploring Calypso is too complex, because it involves more
> objects and I actually do not see how to do the previous steps.
>

I agree, current version is a bit complicated inside. But it is already
fixed. And there will be update soon.


>
> I will be happy to help with the documentation.
> My question is: How can I proceed the mentioned steps?
>

I would appreciate for your help. I will call you for review next week.

Best regards,
Denis


> Thanks,
> Juraj
>


Re: [Pharo-users] Calypso question: adding a context menu item

2017-12-05 Thread Denis Kudriashov
Hi Juraj.

I repeated your steps and it works for me:
In "vars" mode I have "Say Hello" in context menu of selected variable
(just before "Show in method browser" item).

Maybe you were looking at context menu of class pane? In that case command
activator should be defined as:

ClyHelloCommand class>>systemBrowserClassMenuActivator

^CmdContextMenuCommandActivator byRootGroupItemFor:
ClyClassSystemBrowserContext





2017-12-05 18:12 GMT+01:00 Juraj Kubelka :

> Hi,
>
> To implement a context menu item. I have implemented a new class:
>
> -=-=-=-
> CmdCommand subclass: #ClyHelloCommand
> instanceVariableNames: ''
> classVariableNames: ''
> package: 'Calypso-Extensions’
> -=-=-=-
>
> with methods:
>
> -=-=-=-=-
> ClyHelloCommand class >> #systemBrowserMenuActivator
> 
>
> ^CmdContextMenuCommandActivator byRootGroupItemFor:
> ClyVariableSystemBrowserContext
>
> ClyHelloCommand >> # defaultMenuItemName
> ^'Say Hello’
>
> ClyHelloCommand >> # execute
> self inform: 'Hello'
> -=-=-=-=-
>
> But it does not display in the context menu. I expect it next to “Generate
> accessors” as I took this command as an example.
> What do I miss?
>
> Thanks,
> Juraj
>


Re: [Pharo-users] Building a Baseline

2017-12-04 Thread Denis Kudriashov
Hi Andrew.

It is known and super annoying bug Metacello script never checkout/switch
to requested branch/tag/commit
.

2017-12-04 13:04 GMT+01:00 Prof. Andrew P. Black :

> In the baseline configuration of my project, it says
>
> spec
> baseline: 'SmaCC'
> with: [ spec repository: 'github://apblack/SmaCC:working' ].
>
> Later, I have a parser that depends on 'SmaCC'.
>
> However, when I load my baseline, it seems to load from the current branch
> of the local clone of *apblack/SmaCC* in my file system.  That is, my
> local clone was on branch *master*, so *master* was loaded, rather than
> *working*.
>
> What am I doing wrong, and how do I fix the baseline so that the correct
> branch is loaded?
>
> Andrew
>
> The complete baseline is as follows:
>
> baseline: spec
> 
>
> spec for: #'common' do: [
> spec
> baseline: 'SmaCC'
> with: [ spec repository: 'github://apblack/SmaCC:working' ].
> spec
> baseline: 'FileDialog'
> with: [ spec repository: 'github://peteruhnak/file-dialog/repository' ].
> spec package: 'Grace-Scope'.
> spec package: 'Grace-Names' with: [ spec requires: {'Grace-Parser' .
> 'Grace-Scope'} ].
> spec package: 'Grace-Parser' with: [ spec requires: {'SmaCC' .
> 'Grace-Scope'} ].
> spec package: 'Grace-IDE' with: [
> spec requires: {'FileDialog' . 'Grace-Compiler'} ].
> spec package: 'Grace-Compiler' with: [
> spec requires: {'Grace-Parser' . 'Grace-Names'} ].
> spec package: 'GraceTests' with: [ spec requires: {'Grace-Parser' .
> 'Grace-Names'} ]
> ]
>
>


Re: [Pharo-users] PharoThings - Metacello installation broken

2017-12-03 Thread Denis Kudriashov
Thank's for report.
I fixed it. Try again.

I will set up travis to cover such problems. I never tested it on fresh
computer

2017-12-03 16:48 GMT+01:00 bachitoph :

> Hi,
> I'm just trying https://github.com/pharo-iot/PharoThings. But if
> installing
> the client side as suggested below.
>
> Install the client part of PharoThings in the development (client) Pharo
> image:
>
> Metacello new
>   baseline: 'PharoThings';
>   repository: 'github://pharo-iot/PharoThings/src';
>   load: 'RemoteDev'
>
> After some loading I get the Metacello message
>
> github--pharoiotFirmatav01x157812618139788200831786773995104653406.zip
> does
> not exist.
>
> I tried this under Windows10 with fresh loaded Pharo 6.1 from
> www.pharo.org.
>
> any hints?
>
> thanks
> cjb
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] Network data exchange - Basys and Seamless usage questioning

2017-11-17 Thread Denis Kudriashov
Hi, Henry.

Just follow instructions on github page. Do you have any problem with them?
(I ask because you probably noticed it).

Also look at main application built on top of Seamless: TelePharo project
https://github.com/dionisiydk/TelePharo,
http://dionisiydk.blogspot.fr/2017/08/pharmide-is-renamed-to-telepharo-and.html
.

Seamless does not provide any security option. So now it is up to user to
establish secure network with external tools like SSH or VPN.
So it can be interesting to implement it with your solution. But I have no
time to work on it.


2017-11-17 15:26 GMT+01:00 henry <he...@callistohouse.club>:

> From my years of Squeaking, I only ever us Monticello Browser. As one new
> to our using github, Metacello and Pharo, could you explain how I would
> load Seamless? I think it is a Metacello command. I am very interested in
> seeing how it runs on ParrotTalk and thought I would explore this system.
>
> Thank you
>
> Sent from ProtonMail Mobile
>
>
> On Thu, Nov 16, 2017 at 11:14, Denis Kudriashov <dionisi...@gmail.com>
> wrote:
>
> 2017-11-16 17:11 GMT+01:00 henry <he...@callistohouse.club>:
>
>> Have you seen ParrotTalk?
>>
>> http://www.squeaksource.com/Cryptography/ParrotTalk-HenryHouse.14.mcz
>>
>> <http://www.squeaksource.com/Cryptography/ParrotTalk-HenryHouse.14.mcz>
>> Requiring
>>
>> http://www.squeaksource.com/Cryptography/Cryptography-HenryHouse.113.mcz
>>
>> <http://www.squeaksource.com/Cryptography/Cryptography-HenryHouse.113.mcz>Where
>> could I find Seamless? I am doing similar with a project Raven: distributed
>> objects over encrypted ASN.1/STON encoded connections.
>>
>
> https://github.com/dionisiydk/Seamless
>
>
>>
>> Thank you.
>>
>>
>> Sent from ProtonMail Mobile
>>
>>
>> On Wed, Nov 15, 2017 at 18:09, Cédrick Béler <cdric...@gmail.com> wrote:
>>
>> Hi,
>>
>> sorry for the late reply Denis,
>>
>>
>> Can you show example how you work with your objects using this network?
>>
>>
>> It’s not fully decided yet. I’m just trying to show that 2 peers A and B
>> can exchange and sync information without central server, but also
>> considering they have multiples devices (connected on demand P2P - offline
>> first is a major requirement).
>>
>> So for now, to test, I just connect A and B through basys by sending a
>> connection in both direction A->B B->A. I think ok keeping a "message hub »
>> specific to each interaction A can have with B(s), C(s)... A queue but that
>> kind of never deletes messages but changes its meta content - so as to sync
>> with other devices when they eventually connect).
>>
>> So for now, my need is quite simple regarding connections.
>> I used mostly for now #sendDataPacket:
>>
>> I could do it also with Zinc in HTTP. But, as always in Smalltalk, I
>> explore in plenty of directions and discover great stuffs like Seamless
>> perfectly usable and some less finished or older gems like BitTalk or
>> UbiquiTalk…  Very interesting as I will need more functionalities to deal
>> with decentralized networks.
>>
>>
>> BasisNetworkStub is only created for tests. And I think it misses one
>> important function: how identify peers. When your image get new connection
>> it should identify what remote peer is connected by it. So two connections
>> from same remote image should be identified as single peer instance on your
>> local image.
>>
>>
>> Yes, sure I’ve spotted that and I definitely need a way to identify
>> peer-devices (belonging to a peer realm/swarm). I’ll do later.
>>
>>
>> I would of course use Seamless for distributed applications because it
>> allows to implement solution with objects locally and then transparently
>> split them over network.
>> But Seamless not implements any kind of message queue. So I would use
>> some proven solution for it instead of custom implementation. But it can
>> depends on the task.
>>
>>
>> Do you think of something in particular ? :)
>> For now my queue will only be ordered collections or whatever simple
>> collection. It should be enough to start with.
>>
>>
>>
>>> 2) or may I use Seamless straight with restrictions (I wonder if
>>> limiting the classes that can be executed would suffice - proxies should
>>> only be on the peer inbox and outbox I think) ?
>>
>> 3) or maybe I should do a lighter version of seamless ? If so where
>>> should I look at/change ?
>>>
>>
>> You can try subcla

Re: [Pharo-users] Network data exchange - Basys and Seamless usage questioning

2017-11-16 Thread Denis Kudriashov
2017-11-16 17:11 GMT+01:00 henry :

> Have you seen ParrotTalk?
>
> http://www.squeaksource.com/Cryptography/ParrotTalk-HenryHouse.14.mcz
>
> 
> Requiring
>
> http://www.squeaksource.com/Cryptography/Cryptography-HenryHouse.113.mcz
>
> Where
> could I find Seamless? I am doing similar with a project Raven: distributed
> objects over encrypted ASN.1/STON encoded connections.
>

https://github.com/dionisiydk/Seamless


>
> Thank you.
>
>
> Sent from ProtonMail Mobile
>
>
> On Wed, Nov 15, 2017 at 18:09, Cédrick Béler  wrote:
>
> Hi,
>
> sorry for the late reply Denis,
>
>
> Can you show example how you work with your objects using this network?
>
>
> It’s not fully decided yet. I’m just trying to show that 2 peers A and B
> can exchange and sync information without central server, but also
> considering they have multiples devices (connected on demand P2P - offline
> first is a major requirement).
>
> So for now, to test, I just connect A and B through basys by sending a
> connection in both direction A->B B->A. I think ok keeping a "message hub »
> specific to each interaction A can have with B(s), C(s)... A queue but that
> kind of never deletes messages but changes its meta content - so as to sync
> with other devices when they eventually connect).
>
> So for now, my need is quite simple regarding connections.
> I used mostly for now #sendDataPacket:
>
> I could do it also with Zinc in HTTP. But, as always in Smalltalk, I
> explore in plenty of directions and discover great stuffs like Seamless
> perfectly usable and some less finished or older gems like BitTalk or
> UbiquiTalk…  Very interesting as I will need more functionalities to deal
> with decentralized networks.
>
>
> BasisNetworkStub is only created for tests. And I think it misses one
> important function: how identify peers. When your image get new connection
> it should identify what remote peer is connected by it. So two connections
> from same remote image should be identified as single peer instance on your
> local image.
>
>
> Yes, sure I’ve spotted that and I definitely need a way to identify
> peer-devices (belonging to a peer realm/swarm). I’ll do later.
>
>
> I would of course use Seamless for distributed applications because it
> allows to implement solution with objects locally and then transparently
> split them over network.
> But Seamless not implements any kind of message queue. So I would use some
> proven solution for it instead of custom implementation. But it can depends
> on the task.
>
>
> Do you think of something in particular ? :)
> For now my queue will only be ordered collections or whatever simple
> collection. It should be enough to start with.
>
>
>
>> 2) or may I use Seamless straight with restrictions (I wonder if limiting
>> the classes that can be executed would suffice - proxies should only be on
>> the peer inbox and outbox I think) ?
>
> 3) or maybe I should do a lighter version of seamless ? If so where should
>> I look at/change ?
>>
>
> You can try subclass SeamlessNetwork and override request processing
> method with special restrictions on what requests are permitted. Maybe you
> can propose such kind of policy to the Seamless itself.
>
>
>
> Subclassing Seamless seems to be a very good simple and powerful
> possibility (to get inspiration too) and I may do that.
>
> Anyway most of what I have to do is build a system that seamlessly present
> to the user information extracted from messages (stored locally- versioned)
> => its actually just transposing what you all are used too with tools like
> git but applied to « general information exchange and processing ».
> Enterprise information systems are so boring… they should be far more a la
> smalltalk ^^
>
> Cheers,
>
> Cédrick
>
>
>


  1   2   3   4   >