[Pharo-users] PetitParser problem with plus

2014-12-17 Thread James Foster
There is something about plus that I don’t understand. In the following code if 
I parse for (x , x) then I get what I expect. If I parse for (x plus) then the 
image hangs. What am I doing wrong?

James

| a notA x y |
a := $a asParser.
notA := $a asParser negate star flatten.
x := a / notA.
y := x , x. “works fine”
y := x plus. “never finishes”
^y end parse: 'ab’.




Re: [Pharo-users] PetitParser problem with plus

2014-12-18 Thread James Foster
That did it and it makes sense. Thanks so much!

> On Dec 17, 2014, at 11:36 PM, Guillaume Larcheveque 
>  wrote:
> 
> So you just have to remove the #star in notA or replace it by #plus to makes 
> it succeed only when it consume at least one character
> 
> 2014-12-18 7:54 GMT+01:00 Guillaume Larcheveque 
> mailto:guillaume.larcheve...@gmail.com>>:
> With x, x it will only go to 2 level deep.
> 
> With the plus you allow to go as far as the x rule succeed and your x rule 
> always succeed because notA always succeed due to the star without consuming 
> anything so you fall into infinite loop.
> 
> 2014-12-18 6:47 GMT+01:00 James Foster  <mailto:smallt...@jgfoster.net>>:
> There is something about plus that I don’t understand. In the following code 
> if I parse for (x , x) then I get what I expect. If I parse for (x plus) then 
> the image hangs. What am I doing wrong?
> 
> James
> 
> | a notA x y |
> a := $a asParser.
> notA := $a asParser negate star flatten.
> x := a / notA.
> y := x , x. “works fine”
> y := x plus. “never finishes”
> ^y end parse: 'ab’.
> 
> 
> 
> 
> -- 
> Guillaume Larcheveque
> 
> 
> 
> -- 
> Guillaume Larcheveque
> 



[Pharo-users] Maximum number of rules in PetitParser?

2014-12-21 Thread James Foster
I have a grammar with about 600 rules. With some work I’ve come up with a 
useful subset of 400 rules. Unfortunately this is still more than the 255 
number of instance variables that Pharo allows. Is there a way to have 
PetitParser use something other than instance variables to cache the rules? 
Especially something that works with PPBrowser?

James




Re: [Pharo-users] What copyright to use... / Glorp-Fuel interface

2015-01-19 Thread James Foster
Hi Cam,

Glad to hear of your project and your plans to make it available to the 
community. As to the copyright approach, see 
http://choosealicense.com/licenses/mit/ 
. If the code was developed by 
employees of your company as part of their job, use “Debris Publishing, Inc.” 
as the [fullname]. 

Basically, the owner is the one who has the authority to make a decision on the 
license. As between the employer and the employees, the ownership of the work 
product will typically be with the employer. The license (if selected by the 
appropriate party as owner) tells others what they can do with the code. There 
is no need for your to “donate” the ownership to anyone else, as long as the 
rightful owner makes a good license choice (such as MIT). 

If you plan to contribute directly to Pharo (as opposed to having a library 
that can be loaded into Pharo), then you should follow the instructions at 
https://pharo.fogbugz.com/?W68 , including 
sending in a signed copy of the Software Distribution Agreement.

James

> On Jan 19, 2015, at 3:27 PM, Cameron Sanders via Pharo-users 
>  wrote:
> 
> 
> Date: January 19, 2015 at 3:27:42 PM PST
> Subject: What copyright to use... / Glorp-Fuel interface
> From: Cameron Sanders 
> To: Any question about pharo is welcome 
> 
> 
> Hi All.
> 
> I have decided to share with the community some tools we developed at Debris 
> Publishing, Inc., to simplify project start-up with regard to database 
> access. In particular, the tools allow you to use the Glorp interface on 
> Pharo (or Gemstone) writing to Fuel files on the backend, or SIXX, or native 
> stones for gemstone. This also provides a data-migration tool between the two 
> environments. We have successfully backed our app by Fuel, Gemstone, and some 
> sections by SQL. Furthermore, the approaches can co-exist. 
> 
> Right out-of-the-box one can start using a Glorp interface saving data to 
> Fuel files on a local disk. I'll write up more material and make some videos. 
> There are a few demo test modules illustrating usage.
> 
> [I had to extricated the code from our user login, roles, and datasources 
> start-up code to draw a line somewhere; but that also meant temporarily 
> breaking the compatibility between Gemstone and Pharo environments. With 
> time, and/or community input, we can help replace what we removed or push 
> these tools in that direction in the following months -- but are rather busy 
> in the short-term. Still, this can get newbs up and running in no-time! ]
> 
> So my question is this: i plan to apply the MIT License, and my intent is to 
> allow others to help fatten it up. But what copyright do I apply? When 
> corporations contribute code to the community, what is the standard approach 
> to the copyright, given my intention here? 
> 
> Thanks in advance.
> Sincerely,
> Cam
> 
> 
> 
> 
> 
> 



Re: [Pharo-users] Removal from list

2015-01-27 Thread James Foster
Hi Joshua,

Like most mailing lists, you control your own access; you can’t terminate my 
access and I can’t terminate your access. When you joined the list you did so 
through the web page at 
http://lists.pharo.org/mailman/listinfo/pharo-users_lists.pharo.org and this is 
how you can change your subscriptions.

James


> On Jan 27, 2015, at 4:36 PM, Joshua Panar  wrote:
> 
> Hello - can my address please be removed from the Pharo mail list. I will 
> likely rejoin later, but for now I am receiving too many emails per day from 
> the list.  Greatly appreciated, cheers, Josh Panar
> 
> -- 
> Dr Joshua D Panarjpa...@cs.ryerson.ca
> Department of Computer Science   Ryerson University
> ENG259   350 Victoria St, Toronto, Ontario, Canada  M5B-2K3
> TEL: (416) 979-5000 x 7402,  (416) 979-5063  FAX: (416) 979-5064
> 
> 
> 




[Pharo-users] PetitParser Question

2015-03-17 Thread James Foster
I’m following the example in the book 
(http://pharobooks.gforge.inria.fr/PharoByExampleTwo-Eng/latest/PetitParser.pdf 
,
 pp. 9-10) with a slight modification. I believe that the example evaluates 
things that have the same precedence from right-to-left (is that correct?). 
I’ve tried to adjust things so that it evaluates from left to right, but get an 
error. Any advice?

James

| number term prod prim start |
number := #digit asParser plus flatten ==> [ :str | str asNumber ].
term := PPDelegateParser new.
prod := PPDelegateParser new.
prim := PPDelegateParser new.
term setParser: (term memoized , $+ asParser trim , prod ==> [ :nodes | nodes 
first + nodes last ]) / prod.
prod setParser: (prim , $* asParser trim , prod ==> [ :nodes | nodes first * 
nodes last ]) / prim.
prim setParser: ($( asParser trim , term , $) asParser trim ==> [ :nodes | 
nodes second ]) / number.
start := term end.
start parse: '1 + 2'

Re: [Pharo-users] Object database

2013-05-28 Thread James Foster
Boris,

What is the class/type of the keys in your example? Are the keys simple objects 
(String, Number, etc.) or complex (Person, Employee, Customer, Student, 
Product, etc.). 

With any remote database the challenge will be populating the result into your 
local image. How deep/complex is the result? That is, if only one dictionary 
satisfied your sample query, how many objects would be reached and what would 
be their classes?

How large is the "huge" parent dictionary? Millions? Billions?

Do you need the client Pharo image(s) to be remote from the database? What sort 
of network is between them?

Naturally, my inclination would be to investigate GemStone/S, but various 
factors would influence the decision.

James Foster

On May 28, 2013, at 7:11 AM, Boris Spasojević   wrote:

> Hi all,
> 
> I have a need to persist a really large and funny object structure in Pharo 
> (a huge Dictionary of Dictionaries) and I would like to be able to query this 
> data from a remote image.  
> 
> Basically what I am looking for is some form of database that would allow me 
> to input elements in to this structure from one image, and read them out in 
> another image with queries like i.e.
> 
> dictionaryOfDictionaries select: [ :each | 
> (each keys includes: key1) and: [  each keys includes: key2 ] 
> ]
> It does not have to be strictly an OO database, anything that could enable me 
> to do this fast and easy would be nice.
> 
> 
> Any suggestions/ideas/comments?
> 
> 
> Boris Spasojević - Борис Спасојевић 
> 
> Research assistant 
> Software Composition Group 
> Institute of Computer Science and Applied Mathematics 
> University of Bern 
> 
> email: spaso...@iam.unibe.ch 
> office phone: +41 (0)31 511 7636 
> mobile: +41 (0)76 66 88 175 
> webpage: http://scg.unibe.ch/staff/Boris-Spasojevic 
> 



Re: [Pharo-users] Phaas - anyone interested in setting up Pharo as a Service?

2013-06-14 Thread James Foster
I have some ideas I would like to discuss off-line. Anyone interested should 
contact me at james.fos...@gemtalksystems.com.

James

On Jan 26, 2013, at 8:04 AM, Stéphane Ducasse  wrote:

> andy 
> 
> thanks for this discussion. It would be good to raise a kind of consensus 
> because this is an effort that the association 
> could support.
> 
> Stef
> 
> On Jan 26, 2013, at 11:41 AM, Andy Burnett wrote:
> 
>>> he, sorry for insist, but cloudfoundry already does that... and is 
>>> opensource too :)
>>> at ESUG I seen James present it to deploy pharo images... so is viable :)
>>> 
>>> cheers,
>>> Esteban
>>> 
>> 
>> I agree. And, I was really quite optimistic about cloud foundry when
>> it first came out. I particularly like the way you can have a local
>> micro cloud, and then transition to the hosted cloud. My only
>> disappointment was that VMware are not - seemingly - going to offer
>> gemstone as an option on cloudfoundry.com.
>> Building on what Janko said, I think it is really important to join
>> the cloud 'wave'.
>> 
>> The question is how might we - collectively - make this happen? I am
>> perfectly happy to go with cloud foundry, or open shift, or any other
>> option if more knowledgeable people can show that X is the way to go.
>> My only requirement is that I don't want to deal with anyone lower
>> than pharo. All OS patches need to be done automagically by the
>> hosting provider. I think cloudfoundry.com and open shift do that, but
>> my understanding of cloudfoundry.org is that this is a 'roll it
>> yourself' solution. Obviously, that would require someone to step up
>> and do that for us.
>> My preference would be for us to create a suitably configured module
>> for one of e platforms, and we can then start getting experience with
>> it.  Stephane, is this something that the consortium might take a lead
>> on? My company is happy to pay some of the costs, if this will help.
>> 
>> Cheer
>> Andy
>> 
> 
> 
> 




Re: [Pharo-users] Beginner's question ...

2013-08-16 Thread James Foster
Hi Roland,

Welcome to Smalltalk. As someone who started with BASIC in the early 1970s, I 
have seen a few changes in the past 40 years.

As you have discovered, the typical Smalltalk experience has a heavy emphasis 
on a GUI. As to deployment, it is generally more difficult to take things out 
(browsers, tools, etc.) in Smalltalk than in other environments where there is 
a more rigid distinction between development and deployment. The first thing to 
note is that any Pharo image can be deployed with command line arguments that 
disable the GUI (-vm-display-null and -vm-sound-null). Sometimes we just let 
the other "stuff" come along for the ride and get ignored. Why go to the 
trouble to remove it?

Next, there is GNU Smalltalk (http://smalltalk.gnu.org/), "The Smalltalk for 
those who can type"! Check it out.

Finally, GemStone/S (http://gemtalksystems.com/index.php/products/gemstones/) 
is available as a command-line Smalltalk with no native GUI. 

Let us know what you want your console application to do and we can give more 
advice.

James


On Aug 16, 2013, at 11:33 AM, Roland Strasser  wrote:

> 
> Hi,
> 
> I have programming experiences with BASIC compilers. I would like to
> program in a Smalltalk environment; but I have the following newbie's
> questions:
> 
> a) Can I deploy an image without all the browsers and other "stuff" -
> just a plain console program?
> 
> b) How is it possible to write a console program without gui etc.?
> 
> Thank you!
> Roland.
> 
> 
> 




Re: [Pharo-users] Group and member with Voyage

2013-08-30 Thread James Foster
Hi Esteban,

What you have described is quite common and there are a variety of ways of 
designing this sort of object model. If you were dealing with a relational 
database, then you would have a Group table, a Member table, and a Membership 
table. The Membership table would have one row for each member/group pair and 
the member ID and group ID would be the primary columns (perhaps with other 
things like date joined, date expired, etc.). With an index on the member ID 
and group ID, one could quickly find all the groups for a member and all the 
members for a group, and each piece of data would exist in only one place 
("normalized"). One could take a similar approach with objects, having three 
collections containing Groups, Members, and Memberships respectively. You could 
have an accessor in Group that returned members based on a select from the 
Memberships collection and an accessor in Member that returned groups based on 
a select from the Memberships collection. 

Alternatively, if you wanted to avoid the #'select:' call in one or both 
lookups, you can cache the respective subcollections in Group and/or Member and 
drop the Memberships collection. If you cache in only one place (e.g., each 
Group has a collection of Members), then you can add a method in Member that 
does a #'select:' of Groups where a Group has the Member. If you cache in both 
places then your getters/setters in each can update the other (with the 
understanding that you are duplicating data to get performance efficiency). 

Again, this problem is very common. Consider students in classes, persons with 
addresses, persons with hobbies, etc. Your choices are basically (1) three 
collections, no duplicates, select for both queries; (2) two collections, no 
duplicates, cache for one query, select for the other query; and (3) two 
collections, caches for each query. Which is preferable depends on your typical 
sizes and lookup patterns. If performance is not an issue, then start with 
whatever is simplest for you to code. I lean toward the three collections with 
the lookup penalty (GemStone's ability to index collections makes this approach 
very efficient), but if most of your lookups are from one side or the other and 
scanning the full collection is slow, then cache in one or both places.

If you have a composite, the analysis is similar since Smalltalk does not 
require static typing of variables. You just need to take care that your 
accessors can give back the expected objects.

James

On Aug 29, 2013, at 6:12 PM, Esteban A. Maringolo  wrote:

> Hi all,
> 
> Let's say I have a class Group and a class Member.
> 
> aGroup has many members.
> and aMember can belong to many groups.
> 
> What is the "proper" voyageDescription for those one to many relations?
> 
> Should I do something extra?
> 
> Everytime I add a member to the group, both the member and the group
> get their references updated.
> Now when I add a member to a group and save it, I also save the
> member. Is there another way to avoid this?
> 
> Any recommended practice for this?
> 
> Next level question: What if it gets composite? it is... a Group has
> other Groups as members :)
> 
> 
> Regards!
> 
> Esteban A. Maringolo
> 
> 




Re: [Pharo-users] Group and member with Voyage

2013-08-30 Thread James Foster
Hi Esteban,

It seems that I mistook the question for something easy enough for me to 
answer! Unfortunately, I don't have any knowledge of Voyage+MongoDB so can't 
really give the proper answer.

James

On Aug 30, 2013, at 11:13 AM, Esteban A. Maringolo  wrote:

> Hi James,
> 
> Thanks for your response. You are right, the Pattern is quite common,
> if not ubiquous in all systems.
> 
> My particular question is related with Voyage+MongoDB, and also could
> apply to Magritte (given the fact Voyage "inherits" its descriptions
> model).
> 
> I sucessfully implemented this pattern with ORMs using an intermediary
> table for the relation, or even reifying the relation as a first class
> object.
> I also used the #select: technique to avoid duplication of
> "responsibility" and caching at one side of the relation.
> But I always did it "in memory" with no mapping et all, just plain old
> smalltalk objects (POSO?) and using ORM solutions.
> 
> What I need to know now is:
> 1) How to do this with voyage+MongoDB
> 2) I want to have a two way relation, it is both members and groups
> have a collection (members know their groups and viceversa). This
> requires additional maintenance, but with a higher performance, and
> doesn't require me to load all groups if I'm just materializing one
> member.
> 
> 
> Regards!
> 
> Esteban A. Maringolo
> 
> 
> 2013/8/30 James Foster :
>> Hi Esteban,
>> 
>> What you have described is quite common and there are a variety of ways of 
>> designing this sort of object model. If you were dealing with a relational 
>> database, then you would have a Group table, a Member table, and a 
>> Membership table. The Membership table would have one row for each 
>> member/group pair and the member ID and group ID would be the primary 
>> columns (perhaps with other things like date joined, date expired, etc.). 
>> With an index on the member ID and group ID, one could quickly find all the 
>> groups for a member and all the members for a group, and each piece of data 
>> would exist in only one place ("normalized"). One could take a similar 
>> approach with objects, having three collections containing Groups, Members, 
>> and Memberships respectively. You could have an accessor in Group that 
>> returned members based on a select from the Memberships collection and an 
>> accessor in Member that returned groups based on a select from the 
>> Memberships collection.
>> 
>> Alternatively, if you wanted to avoid the #'select:' call in one or both 
>> lookups, you can cache the respective subcollections in Group and/or Member 
>> and drop the Memberships collection. If you cache in only one place (e.g., 
>> each Group has a collection of Members), then you can add a method in Member 
>> that does a #'select:' of Groups where a Group has the Member. If you cache 
>> in both places then your getters/setters in each can update the other (with 
>> the understanding that you are duplicating data to get performance 
>> efficiency).
>> 
>> Again, this problem is very common. Consider students in classes, persons 
>> with addresses, persons with hobbies, etc. Your choices are basically (1) 
>> three collections, no duplicates, select for both queries; (2) two 
>> collections, no duplicates, cache for one query, select for the other query; 
>> and (3) two collections, caches for each query. Which is preferable depends 
>> on your typical sizes and lookup patterns. If performance is not an issue, 
>> then start with whatever is simplest for you to code. I lean toward the 
>> three collections with the lookup penalty (GemStone's ability to index 
>> collections makes this approach very efficient), but if most of your lookups 
>> are from one side or the other and scanning the full collection is slow, 
>> then cache in one or both places.
>> 
>> If you have a composite, the analysis is similar since Smalltalk does not 
>> require static typing of variables. You just need to take care that your 
>> accessors can give back the expected objects.
>> 
>> James
>> 
>> On Aug 29, 2013, at 6:12 PM, Esteban A. Maringolo  
>> wrote:
>> 
>>> Hi all,
>>> 
>>> Let's say I have a class Group and a class Member.
>>> 
>>> aGroup has many members.
>>> and aMember can belong to many groups.
>>> 
>>> What is the "proper" voyageDescription for those one to many relations?
>>> 
>>> Should I do something extra?
>>> 
>>> Everytime I add a member to the group, both the member and the group
>>> get their references updated.
>>> Now when I add a member to a group and save it, I also save the
>>> member. Is there another way to avoid this?
>>> 
>>> Any recommended practice for this?
>>> 
>>> Next level question: What if it gets composite? it is... a Group has
>>> other Groups as members :)
>>> 
>>> 
>>> Regards!
>>> 
>>> Esteban A. Maringolo
>>> 
>>> 
>> 
>> 
> 
> 




Re: [Pharo-users] glorp

2014-04-24 Thread James Foster
On Apr 23, 2014, at 9:02 PM, Clément Bera  wrote:

> Gemstone is also used quite often for large scale application but Gemstone is 
> not free.

GemStone/S 64 Bit is used for both large and small applications, and GemStone/S 
64 Bit has a free for commercial use license available (see 
http://seaside.gemtalksystems.com/).

James

Re: [Pharo-users] I need some explaination about arguements assignment

2014-08-06 Thread James Foster
Hi Aria,

Welcome to Smalltalk and Pharo. I haven’t tried executing your code but I have 
a couple observations. I believe that the problem is in attempting to assign to 
a passed-in argument. As far as I know, the following is illegal:

foo: aString
aString := aString , ‘ bar’.

Method (and block) arguments may be sent messages, but may not be assigned. A 
common approach to what it appears you are doing is to use a WriteStream. For 
example:

startRecursion
| stream |
stream := WriteStream on: String new.
self recurseOnStream: stream level: 4.
Transcript show: stream contents.

recurseOnStream: aStream level: anInteger
anInteger <= 0 ifTrue: [^self].
anInteger timesRepeat: aStream tab.
aStream nextPutAll: anInteger printString; cr.
self recurseOnStream: aStream level: anInteger - 1.

Let us know if this helps resolve the issue.

James Foster


On Aug 6, 2014, at 8:13 PM, aria2end  wrote:

> Hello, I am new to smalltalk and I would really appreciate your help so I can
> better use and understand Pharo. 
> 
> So here is the problem, I wanted to implement a function to get the value of
> my tree struct nodes in a recursive manner and I wanted to concatenate them
> to a String ( aText ) and later show them on the Transcript. 
> 
> 
> showLists 
>| aText | 
> aText  :=  lol level,  (String with: Character cr). 
>self recursiveShowLists: lol withText: aText tabsNumber: 1. 
> 
> 
> 
> 
> recursiveShowLists: aLoL withText: aText tabsNumber: aNumb 
>| counter index | 
>aLoL lols isEmpty 
>ifFalse: [ 
>counter := 1. 
>[ counter <= aNumb ] 
>whileTrue: [ 
>aText := aText , (String with:
> Character tab). 
>counter := counter + 1 ]. 
>index := 1. 
>aNumb := aNumb + 1. 
>LoL lols do: [ :each | aText := aText , each level ,
> (String with: Character cr) ]. 
>] 
> 
> 
> 
> Without having the last line ( LoL lols do: ... ) everything works fine but
> when I include it and as soon as debugger reaches to [counter <= aNumb ] and
> wants to evaluate it, my arguments start to act weird. aText will become nil
> and aNumb will hold te value of aText! 
> 
> 
> I fixed this issue by adding another temporary variable ( copyText ) and
> instead of direct assignment of aText I used the copyText: 
> 
> 
> 
> recursiveShowLists: aLoL withText: aText tabsNumber: aNumb 
>| counter index copyText | 
>copyText := aText.
>aLoL lols isEmpty 
>ifFalse: [ 
>counter := 1. 
>[ counter <= aNumb ] 
>whileTrue: [ 
>copyText := copyText , (String with:
> Character tab). 
>counter := counter + 1 ]. 
>index := 1. 
>aLoL lols do: [ :each | copyText := copyText , each
> level , (String with: Character cr) ] ] 
> 
> 
> 
> I really like to know the reason behind this issue,  I appreciate all the
> explanations.
> Thanks,
> Aria
> 
> 
> 
> 
> --
> View this message in context: 
> http://forum.world.st/I-need-some-explaination-about-arguements-assignment-tp4772102.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 
> 




Re: [Pharo-users] Easiest way to wrap around the indexed value in a list (mod doesn't quite work)

2019-03-28 Thread James Foster
One of my recent assignments to first-year programming students was to model 
Left-Center-Right (https://en.wikipedia.org/wiki/LCR_(dice_game)) 
 where they needed to do just 
what you are trying to do.

| size stream |
size := 10.
stream := WriteStream on: String new.
1 to: size do: [:i | 
stream
print: i; tab;
print: i \\ size + 1; tab;
print: i + size - 2 \\ size + 1; tab;
cr.
].
stream contents


> On Mar 28, 2019, at 8:12 AM, Tim Mackinnon  wrote:
> 
> Hey guys - I’m wondering if someone might have a nice way of selecting the 
> previous value in a list - but wrapping around to the last value if you are 
> at the front. 
> 
> Essentially I have an exercise with some values in a collection like:
> 
> list :=  #($a $e $o $u).
> 
> And I have an index into the list, and want to loop around from index 1, back 
> to 4 when I hit the beginning of the list.
> 
> While moving forwards is pretty easy with mod - e.g.
> 
> ^list at: (index \\ list size + 1)
> 
> I’m struggling with the cleanest way to do this backwards - as the following 
> is unreadable to me (assuming index = 1)
> 
> ^list at: (index - 2 \\ list size + 1)
> 
> And then I tried (which isn't bad - but still not quite right).
> 
> ^list before: (list at: index) ifAbsent: [ids last].
> 
> 
> I’m sure there is a better way to do this - but it’s alluding me?
> 
> Tim
>   
> 
> 
> 



Re: [Pharo-users] glamorous toolkit forum/maillist

2019-04-19 Thread James Foster
Googling “What is Discord” brought me to https://discordapp.com 
.

> On Apr 19, 2019, at 2:50 PM, Steve Quezadas  wrote:
> 
> Forgive my ignorance, but what is Discord?
> 
> On Thu, Apr 18, 2019 at 1:29 AM Serge Stinckwich  > wrote:
> I think #gtoolkit channel on Discord is the best way to discuss with people.
> 
> On Tue, Apr 16, 2019 at 6:37 PM Steve Quezadas  > wrote:
> Is there a forum or maillist for glamorous toolkit? I can't find anything on 
> the official website or google searches. 
> 
> 
> -- 
> Serge Stinckwic​h​
> Int. Research Unit on Modelling/Simulation of Complex Systems (UMMISCO)
> ​Sorbonne University (SU)
> French National Research Institute for Sustainable Development (IRD)​
> U​niversity of Yaoundé I​, Cameroun
> "Programs must be written for people to read, and only incidentally for 
> machines to execute."
> https://twitter.com/SergeStinckwich 
> ​



Re: [Pharo-users] Smalltalk tutorial is broken

2019-05-10 Thread James Foster

> On May 10, 2019, at 8:53 AM, Christopher Fuhrman 
>  wrote:
> 
> 
> On Fri, May 10, 2019, 15:32 Richard Kenneth Eng  > wrote:
> So say many visitors to https://amber-lang.net/learn.html 
> .
> 
> The problem is this: visitors are failing to read and comprehend the last 
> instruction on the first page of the tutorial. The one that reads: Select the 
> text below and click on the 'DoIt' button.
> ...
> How to fix this? How to avoid this PR nightmare?
> I can think of at least three easy solutions:
> 
> Change the button from "DoIt" to "do the selected text"
> 
> Change the first line to:
> Profstef next "(you must select this entire line of text.)"
> 
> But the best one might be:
> Catch the parse error and if it's a null, remind the user she must first 
> select the text.

Some Smalltalk implementations auto-select the entire line if nothing is 
selected. I like that very much.

Re: [Pharo-users] [gemstones] Use case for GsDevKit_home

2019-05-30 Thread James Foster

> On May 30, 2019, at 5:44 AM, sergio ruiz  wrote:
> 
> ...
> 
> Also, one thing that I find invaluable in troubleshooting applications 
> written using relational databases is to be able to be able to just dump the 
> production database and load it up on my local machine. Is this possible 
> using gemstones?

Backup and restore?

James



Re: [Pharo-users] [gemstones] Use case for GsDevKit_home

2019-05-30 Thread James Foster
Yes, GemStone supports backup and restore. See 11. Making and Restoring Backups 
<https://downloads.gemtalksystems.com/docs/GemStone64/3.4.x/GS64-SysAdminGuide-3.4/11-BackupAndRestore.htm>.
 

> On May 30, 2019, at 8:47 AM, sergio ruiz  wrote:
> 
> 
> Yes! Does Gemstones have this ability?
> 
> On May 30, 2019 at 9:59:31 AM, James Foster (smallt...@jgfoster.net 
> <mailto:smallt...@jgfoster.net>) wrote:
> 
>> Backup and restore?
>> 
>> James
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: http://bit.ly/29z9fG0 <http://bit.ly/29z9fG0>
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com <http://www.codeandmusic.com/>
> http://www.twitter.com/sergio_101 <http://www.twitter.com/sergio_101>
> http://www.facebook.com/sergio101 <http://www.facebook.com/sergio101>


Re: [Pharo-users] Modeling HABTM

2019-06-10 Thread James Foster
Sergio,

When you have a two-way relationship, one option is to keep duplicate 
information and use it to go from one object to the others. The advantage is 
rapid lookup, but the disadvantage is the need to update multiple places to 
maintain consistency (as well as the space it takes). 

Another option is to keep the relationship in only one place and then do a 
search for the secondary relationship on each lookup. So, each episode has a 
collection of tracks and the episode to tracks lookup is direct. If you have a 
track and want to find the episodes, then you query each episode to see if it 
includes that track. The advantage is simplicity of design and maintenance (the 
internal structures are never inconsistent; wrong, maybe, but never 
inconsistent!). 

The disadvantage is extra time doing the lookup. But before you discount this 
approach, ask yourself what performance penalty this will cost. How many 
episodes? How many tracks? Do you have less than 10K of each? How many 
milliseconds does it take to do a “brute-force” search? I strongly recommend:
* Make it work, [and only then]
* Make it right, [and only then, if really needed]
* Make it fast
Do the simplest thing that can possibly work, and that is to have one one set 
of references. Don’t add complexity till you need it. Hide (encapsulate) the 
implementation so you can change it later if needed. 

Another approach is to use a tool that provides automatic references. GemStone 
includes indexes that are managed by the system, so you can just ask the index 
for all episodes that reference a track. You only update one data structure but 
the system manages more.

James

> On Jun 10, 2019, at 5:20 AM, sergio ruiz  wrote:
> 
> I am currently putting together a Seaside website for my radio show. I am 
> trying to figure out how to model the "has and belongs to many" 
> relationships. 
> 
> Each episode can have many tracks, each of these tracks can belong to several 
> episodes.
> I want to be able to present a listing of which episodes each track appears 
> in, and a listing of tracks for each episode.
> 
> The approach I have seen on this is to create an intermediary object and 
> store a set of ids on this, but this seems a little clunky, and it seems like 
> there would be a clean way to do this.
> Am I missing something?
> 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
> 



[Pharo-users] Destructive copy in #replaceFrom:to:with:startingAt:

2019-08-08 Thread James Foster
After many hours of debugging I’ve finally discovered that Pharo’s 
implementation of #replaceFrom:to:with:startingAt: does not make any check for 
overlapping regions to avoid destructive operations. 

| bytes |
bytes := #(1 2 3 4 5 6 7 8) copy.
bytes replaceFrom: 4 to: 7 with: bytes startingAt: 1.
bytes
 "#(1 2 3 1 2 3 1 8) in Pharo"
 "#(1 2 3 1 2 3 4 8) in GemStone”

Essentially, Pharo has taken a memcpy() approach rather than a memmove() 
approach 
(https://fresh2refresh.com/c-programming/c-interview-questions-answers/what-is-the-difference-between-memcpy-ampersand-memmove-functions-in-c/
 
<https://fresh2refresh.com/c-programming/c-interview-questions-answers/what-is-the-difference-between-memcpy-ampersand-memmove-functions-in-c/>).
  

While it isn’t the implementation I would choose, at least now I know!

James Foster



[Pharo-users] github.com/pharo-vcs/libgit2-pharo-bindings

2019-08-14 Thread James Foster
This package defines LGitCallback and provides an implementation of 
#’initializeNull’. It also provides an extension that has an implementation of 
#’beNull’. Where is the variable ’thunk’ defined? Why is this in an extension?


https://github.com/pharo-vcs/libgit2-pharo-bindings/blob/master/LibGit-Core.package/LGitCallback.class/instance/initializeNull.st
instance initialization
initializeNull

self beNull


https://github.com/pharo-vcs/libgit2-pharo-bindings/blob/master/LibGit-Compatibility-Pharo7.package/LGitCallback.extension/instance/beNull.st
*LibGit-Compatibility-Pharo7
beNull

thunk := ExternalAddress null




Re: [Pharo-users] Ssilence does not mean agreement

2019-09-04 Thread James Foster


> On Sep 4, 2019, at 10:22 AM, Sven Van Caekenberghe  wrote:
> I felt compelled to react since not doing so would mean I silently agree.

Please try to get over your compulsion.



Re: [Pharo-users] ..LCK

2019-09-10 Thread James Foster
The lock file is tested to see if the stone is running and if you delete it 
then the system should be willing to start a new stone. Please reboot your 
machine, try the ’startstone’ command again, and then post the output of to the 
gemstone mailing list.

> On Sep 10, 2019, at 2:24 AM, ian  wrote:
> 
> Hi All,
> 
> I am not able to start my stone as I inadvertantly deleted the ..LCK file. :)
> 
> Is there a way to fix this?
> 
> Thanks,
> 
> 




Re: [Pharo-users] Code of Conduct

2019-09-11 Thread James Foster


> On Sep 11, 2019, at 8:17 AM, Offray Vladimir Luna Cárdenas 
>  wrote:
> 
> On 11/09/19 9:14 a. m., Herby Vojčík wrote:
>> I found Contributor Covenant-derived Code of Conduct was added to
>> Pharo, three months ago. This is unacceptable under any circumstances.
>> 
>> Have fun in your woke hell.
> 
> I would like to have more details about this. For those of us who don't
> believe in hell, what is the problem of an explicit Code of Conduct?

More specifically, what behavior does the Code prohibit that you would 
otherwise do? 

For my part, while I might not subscribe to the full progressive agenda, I 
wasn’t planning any racial or ethnic slurs (or a theological discussion of the 
afterlife—but feel free to ask me privately!), so don’t find this “woke” agenda 
too constricting.

James


Re: [Pharo-users] Code of Conduct

2019-09-17 Thread James Foster
One side-effect of the “Covenant” discussion is that it is necessarily 
political, which is something that many (rightly, in my view) are trying to 
avoid. While I agree with most of the views expressed so far, I cringe because 
I anticipate that someone who disagrees will feel the compulsion to tell us 
that we are wrong, and things will go bad from there.

I haven’t reviewed the full email chain, but I’ve spent a few minutes searching 
pharo.org for “code of conduct” and “covenant” and come up empty. Before we 
continue the discussion of how “woke" (politically correct) we want to be, 
could someone confirm that this "dastardly deed" (imposing a progressive 
“Covenant” without asking for agreement) was actually done? Maybe a troll has 
just dropped a fire cracker on us and is sitting back, enjoying watching us run 
around screaming!

If there was, indeed, adoption of a “Covenant” it should have been done by the 
board whose role “is to make decisions if in the future the community can't 
decide on a course of action” (https://pharo.org/about). 

I suggest that we suspend discussion of the politics of speech codes until we 
confirm that there is one for Pharo. At that point we politely (but pointedly) 
ask the board (publicly and privately) to explain what prompted the decision to 
adopt a Code (is it really necessary?) and how this one was selected. Note that 
part of the reason for limiting discussion is to avoid attracting attention of 
outsiders who will want to shape the discussion. Let’s stop kicking up dust for 
the moment!

If we need a Code of Conduct, I respectfully suggest we start with ACM 
(https://www.acm.org/code-of-ethics) which has what should be adequate 
anti-discrimination provisions (see 1.4 for a list of “underrepresented” 
groups) to satisfy the progressives among us.

James Foster

Re: [Pharo-users] Code of Conduct

2019-09-17 Thread James Foster
> On Sep 17, 2019, at 5:19 PM, Ramon Leon  wrote:
> 
> https://github.com/pharo-project/pharo/blob/Pharo8.0/CODE_OF_CONDUCT.md

Thanks. I’ve submitted a PR to use ACM. Let’s move the discussion to 
https://github.com/pharo-project/pharo/pull/4637. 


Re: [Pharo-users] Code of Conduct

2019-09-19 Thread James Foster
Before doing that would you be willing to submit a PR with a proposed 
improvement (and a discussion of why)?

> On Sep 19, 2019, at 9:17 PM, john pfersich  wrote:
> 
> And I don’t intend to abide by it. I’ll cancel my Pharo Association 
> contribution and my contribution to Stephane’s Spec book. I have no interest 
> in supporting a left-wing snowflake “Code of Conduct”. 
> 
> /*—-*/
> Sent from my iPhone
> https://boincstats.com/signature/-1/user/51616339056/sig.png 
> 
> See https://objectnets.net  and 
> https://objectnets.org 
> 
> On Sep 19, 2019, at 20:44, Richard O'Keefe  > wrote:
> 
>> On the whole, the new code is pretty good.
>> 
>> There was one thing that troubled me, though:
>> "even outside of Pharo's public communication channels."
>> What business is it of the Pharo Board what anyone says in any
>> other community?  I've heard too many cases where A says something
>> to B and C complains about it as harassment when B didn't mind.
>> I have personally known people *affectionately* address each other
>> in terms that most would consider a deadly insult.
>> 
>> My behaviour in all digital media is subject to the
>> Harmful Digital Communications Act 2015.  See
>> http://www.legislation.govt.nz/act/public/2015/0063/latest/whole.html 
>> 
>> which extends the Harassment Act 1997.  See
>> http://www.legislation.govt.nz/act/public/1997/0092/latest/whole.html 
>> 
>> for a definition of harassment.
>> If I harass anyone according to these Acts, they have a legal remedy.
>> I understand the the UK and the EU have similar laws.
>> 
>> So I don't understand why the Pharo Board want to extend their reach.
>> 
>> 
>> On Fri, 20 Sep 2019 at 07:21, Esteban Lorenzano > > wrote:
>> Hello, 
>> 
>> I’m talking on behalf of the Pharo Board here. 
>> As start, we accepted Serge’s proposition without actually discussing it 
>> much because we didn’t think it was going to be really a problem. Our 
>> community has been self-regulating since the beginning and we were doing it 
>> fine until now. Once or twice we (the board) needed to act, but never had a 
>> real situation as the ones the CoC tries to cover. 
>> So, we can say we opened the umbrella without rain, just in case. 
>> 
>> Now, after observe the situation, we have decided to retract the code. But 
>> sadly, we cannot just remove it and let things continue as before because as 
>> it’s know “it you open a can or worms, you will need a bigger can to put 
>> them back in”. Which means now we need a code of conduct. 
>> 
>> So we are going to take the simplest one we could find that still can serve 
>> our community, you can see it here: 
>> 
>> https://github.com/pharo-project/pharo/pull/4660 
>> 
>> 
>> This PR will be accepted, but as anything in our community, you can still 
>> discuss it and propose modifications. 
>> Just remember be respectful of people disagreeing with your ideas :)
>> 
>> Cheers,
>> Esteban
>> 
>> PS: As personal note: I blocked a github user that insulted a member of our 
>> community, a user who did not had history with us (or any other visible 
>> project), who did not had a name or ways to contact him so I assumed it was 
>> just another troll. Now, he identifies himself here... I will unblock him, 
>> but that does not means the kind of disrespectful messages he sent can be 
>> sent :)
>> 
>> 
>>> On 19 Sep 2019, at 19:47, Ben Coman >> > wrote:
>>> 
>>> makes me wonder whether he's such a machiavellian sociopath, or a useful 
>>> idiot.  
>>> 
>>> On Thu, 19 Sep 2019 at 23:07, Eugen Leitl via Pharo-users 
>>> mailto:pharo-users@lists.pharo.org>> wrote:
>>> Let's see, I've posted one email to this list describing the dangers
>>> of abusing CoCs
>>> 
>>> I guess you refer to this one...
>>> > On Tue, 17 Sep 2019 at 19:39, Eugen Leitl via Pharo-users 
>>> > mailto:pharo-users@lists.pharo.org>> wrote:
>>> > I agree. Technical people are too easy to exploit by malignant 
>>> > manipulators of people.
>>> > All too often they don't even realize it after the fact.  
>>> 
>>> Thats fairly benign and doubt it had anything to do with being blocked on 
>>> github.
>>>  
>>>  
>>> and one post to GitHub describing the motivations of
>>> people who introduce CoCs, and immediately get banned on GitHub from 
>>> 
>>> Note, the board member who blocked your GIthub account and deleted your 
>>> post there
>>> also voiced their opinion as being...
>>> For me a "welcome and be nice" should be enough to just continue as 
>>> before. 
>>> I find the introduction of CoC was a noise we didn't need, 
>>> our community was doing well and self-

Re: [Pharo-users] Code of Conduct

2019-09-19 Thread James Foster
First, my guess is that it was part of the thing they copied and that aspect 
might not have gotten as much thought as you’ve given it.

Second, this is an international organization and maybe the intent (by the 
original author(s)) was to extend the reach of the NZ/UK/EU-style laws to apply 
to those in jurisdictions with less strict speech codes or where the legal 
remedy is impractical. That is, maybe the author(s) don’t feel it is sufficient 
to tell someone who is harassed, “We can’t do anything about it. Hire a NZ 
lawyer.”

These are speculations on my part and, as a US citizen, I’m partial to our free 
speech protections. I’d prefer to have private organizations practice 
ostracization rather than have the government put rude people in jail. I say 
this, not to start a political discussion, but to point out that some 
harassment that would be illegal in NZ might not have a legal remedy if the 
actor was a US citizen.

In any case, I found that when I submitted a PR then something happened pretty 
quickly. So, I’d suggest that you channel your analysis and concerns into a 
proposed improvement.

James

> On Sep 19, 2019, at 8:44 PM, Richard O'Keefe  wrote:
> 
> On the whole, the new code is pretty good.
> 
> There was one thing that troubled me, though:
> "even outside of Pharo's public communication channels."
> What business is it of the Pharo Board what anyone says in any
> other community?  I've heard too many cases where A says something
> to B and C complains about it as harassment when B didn't mind.
> I have personally known people *affectionately* address each other
> in terms that most would consider a deadly insult.
> 
> My behaviour in all digital media is subject to the
> Harmful Digital Communications Act 2015.  See
> http://www.legislation.govt.nz/act/public/2015/0063/latest/whole.html 
> 
> which extends the Harassment Act 1997.  See
> http://www.legislation.govt.nz/act/public/1997/0092/latest/whole.html 
> 
> for a definition of harassment.
> If I harass anyone according to these Acts, they have a legal remedy.
> I understand the the UK and the EU have similar laws.
> 
> So I don't understand why the Pharo Board want to extend their reach.
> 
> 
> On Fri, 20 Sep 2019 at 07:21, Esteban Lorenzano  > wrote:
> Hello, 
> 
> I’m talking on behalf of the Pharo Board here. 
> As start, we accepted Serge’s proposition without actually discussing it much 
> because we didn’t think it was going to be really a problem. Our community 
> has been self-regulating since the beginning and we were doing it fine until 
> now. Once or twice we (the board) needed to act, but never had a real 
> situation as the ones the CoC tries to cover. 
> So, we can say we opened the umbrella without rain, just in case. 
> 
> Now, after observe the situation, we have decided to retract the code. But 
> sadly, we cannot just remove it and let things continue as before because as 
> it’s know “it you open a can or worms, you will need a bigger can to put them 
> back in”. Which means now we need a code of conduct. 
> 
> So we are going to take the simplest one we could find that still can serve 
> our community, you can see it here: 
> 
> https://github.com/pharo-project/pharo/pull/4660 
> 
> 
> This PR will be accepted, but as anything in our community, you can still 
> discuss it and propose modifications. 
> Just remember be respectful of people disagreeing with your ideas :)
> 
> Cheers,
> Esteban
> 
> PS: As personal note: I blocked a github user that insulted a member of our 
> community, a user who did not had history with us (or any other visible 
> project), who did not had a name or ways to contact him so I assumed it was 
> just another troll. Now, he identifies himself here... I will unblock him, 
> but that does not means the kind of disrespectful messages he sent can be 
> sent :)
> 
> 
>> On 19 Sep 2019, at 19:47, Ben Coman > > wrote:
>> 
>> makes me wonder whether he's such a machiavellian sociopath, or a useful 
>> idiot.  
>> 
>> On Thu, 19 Sep 2019 at 23:07, Eugen Leitl via Pharo-users 
>> mailto:pharo-users@lists.pharo.org>> wrote:
>> Let's see, I've posted one email to this list describing the dangers
>> of abusing CoCs
>> 
>> I guess you refer to this one...
>> > On Tue, 17 Sep 2019 at 19:39, Eugen Leitl via Pharo-users 
>> > mailto:pharo-users@lists.pharo.org>> wrote:
>> > I agree. Technical people are too easy to exploit by malignant 
>> > manipulators of people.
>> > All too often they don't even realize it after the fact.  
>> 
>> Thats fairly benign and doubt it had anything to do with being blocked on 
>> github.
>>  
>>  
>> and one post to GitHub describing the motivations of
>> people who introduce CoCs, and immediately get banned on GitHub fr

Re: [Pharo-users] Code of Conduct

2019-09-21 Thread James Foster
A nice thing about open source and the use of Git is that changes can be 
proposed and adopted quickly. Any proposal should be judged, not on whether it 
is perfect, but whether it makes an improvement. As a corollary, don’t assume 
that the current state is the ideal, but treat it as a platform for continuous 
improvements.

In this case, the phrase you objected to was removed before you made your 
comment.

James

> On Sep 20, 2019, at 11:43 PM, Hilaire  wrote:
> 
> Le 19/09/2019 à 21:20, Esteban Lorenzano a écrit :
>> 
>> So we are going to take the simplest one we could find that still can
>> serve our community, you can see it here: 
>> 
>> https://github.com/pharo-project/pharo/pull/4660
>> 
> Hello,
> 
> Given the heat up on the ml, I took a look on the PR. It looks honest
> and simple for but...
> 
> ...I am really surprised -- worried will be more accurate ! -- by the
> second part of this sentence[1]. I think it is even dangerous! What is
> happening outside of the Pharo community should not be ruled by the
> 'WE'. The 'WE' is not the universal moral police or justice. If you
> think a bit about the Richard Stallman event, he was forced to withdraw
> of the Free Software Foundation because comments he made in a mailing
> list not related to FSF. He wrote his email contents were misinterpreted
> (and we know it happens often) and used against him. Whatever it is true
> or not, I don't see why you should be socially banned (or socially
> killed) from one place (or more like all place) because of what happen
> in another place. This kind of important decision can only be taken by
> the justice where all matter are taken in consideration. Imagine one of
> you kicked out of Pharo community because you loose your mind in another
> channel? It makes me feel a bit like the Aldous Huxley world.
> 
> [1] /We will not tolerate harassment from anyone in the Pharo community,
> even outside of Pharo’s public communication channels./
> 
> Hilaire
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 
> 
> 




Re: [Pharo-users] voyage mongo and transactionality

2019-10-08 Thread James Foster


> On Oct 8, 2019, at 3:05 AM, Jonathan van Alteren  
> wrote:
> 
> We've encountered an issue where a user makes changes to an agenda, but does 
> not click the Save button. Instead, the user closes the browser or uses the 
> navigation to go to a different part of the application. When navigating back 
> to the original agenda, the changes made previously (e.g. items added) are 
> still being displayed, even though they were never explicitly saved.

Here is what I don’t understand: how did the change get from the user’s client 
agent (browser) to the server? If you make a change to a field in a form and 
then close the browser, who sent the change to the server? If you show the save 
domain value in a different location, with a dynamically-generated id and name 
(so it isn’t cached in the browser), or written to the Pharo Transcript, does 
the value still change? That is, are you sure that the change is in the 
reflected in the Smalltalk image and not just somehow cached in the browser?

James




Re: [Pharo-users] Pharo and new MacOS Catalina

2019-10-08 Thread James Foster

> On Oct 8, 2019, at 5:24 AM, Kasper Østerbye  wrote:
> 
> Cheers,
> 
> Have there been any problems with running Pharo on the new MacOS Catelina 
> (10.15)?

macOS Catalina (10.15) finally makes good on the promise to disable 32-bit 
applications. So I’m no longer able to run the Pharo Mooc.

James



Re: [Pharo-users] voyage mongo and transactionality

2019-10-09 Thread James Foster
Thanks for the explanation. And, yes, this is an artifact of your design; if 
you put intermediate values into domain objects then they will remain in your 
domain objects to be seen later. From what you’ve described, I don’t see how it 
would be any different in a non-image environment (Java, C#, etc.), unless you 
re-read the entire object graph from the database. As someone else mentioned, 
this would be a good place for the Memento Pattern.

James

> On Oct 9, 2019, at 1:59 AM, Jonathan van Alteren  
> wrote:
> 
> Hi James,
> 
> I see how my explanation might be unclear.
> 
> We have a main form for the agenda and a subform for an item, which is shown 
> using Seaside call/answer. The save button of the subform is clicked, which 
> adds the item to the underlying agenda model object, but the save button of 
> the main form is not clicked by the user. The callback for the main save 
> button sends the save message to the agenda object, causing the database to 
> be updated.
> 
> So yes, the browser does submit the data on the subform, it's the main form 
> component that doesn't receive the save button callback. I realize that this 
> is in large part an issue with our design. However, the way object 
> persistence seems to work in the image environment plays a large role. 
> 
> 
> Kind regards,
> 
> Jonathan van Alteren
> 
> Founding Member | Object Guild
> jvalte...@objectguild.com
> On 8 Oct 2019, 15:41 +0200, James Foster , wrote:
>> 
>>> On Oct 8, 2019, at 3:05 AM, Jonathan van Alteren 
>>>  wrote:
>>> 
>>> We've encountered an issue where a user makes changes to an agenda, but 
>>> does not click the Save button. Instead, the user closes the browser or 
>>> uses the navigation to go to a different part of the application. When 
>>> navigating back to the original agenda, the changes made previously (e.g. 
>>> items added) are still being displayed, even though they were never 
>>> explicitly saved.
>> 
>> Here is what I don’t understand: how did the change get from the user’s 
>> client agent (browser) to the server? If you make a change to a field in a 
>> form and then close the browser, who sent the change to the server? If you 
>> show the save domain value in a different location, with a 
>> dynamically-generated id and name (so it isn’t cached in the browser), or 
>> written to the Pharo Transcript, does the value still change? That is, are 
>> you sure that the change is in the reflected in the Smalltalk image and not 
>> just somehow cached in the browser?
>> 
>> James
>> 
>> 



Re: [Pharo-users] How can we celebrate the 50th anniversary of Smalltalk?

2020-01-05 Thread James Foster


> On Jan 5, 2020, at 7:39 AM, ponyatov  wrote:
> 
> The best tribute to 50th anniversary will be the implementation of
> distributed multi-user VM.

How would that be different from GemStone?



Re: [Pharo-users] can I somehow test the contents of a package

2020-02-14 Thread James Foster
I got three emails in quick succession to widely different accounts. It is 
almost certainly the case that his account has been hacked.

> On Feb 14, 2020, at 1:05 PM, PBKResearch  wrote:
> 
> Hello everyone
> 
> I have received this e-mail, and another one from Phil quoting the same 
> download link in an entirely different context. I have not downloaded it, 
> because I think there is something suspicious about it. Has anyone else any 
> suspicions? Has someone hacked into my e-mail, or is it this list that has 
> been hacked? Or am I just neurotic?
> 
> Peter Kenny
> 
> -Original Message-
> From: Pharo-users  On Behalf Of 
> p...@highoctane.be
> Sent: 14 February 2020 18:45
> To: pharo-users@lists.pharo.org
> Subject: Re: [Pharo-users] can I somehow test the contents of a package
> 
> I have made some edits. Please check.
> https://drive.google.com/uc?id=1yjAdoDnfoMvxGf9KG2RGedjXvNQdwOee&export=download
> Archive password: 
> 
> 
> 
> 
> 




Re: [Pharo-users] Pharo #sum vs #sumNumbers and the consequence of #average

2020-03-23 Thread James Foster


> On Mar 23, 2020, at 6:06 AM, Sven Van Caekenberghe  wrote:
> 
> What you found out now is that the clever trick used to avoid picking an 
> additive identity (picking an element, counting it twice and then subtracting 
> it) leads to a loss of precision when floating point numbers are involved. 
> This is an important issue.

If this approach is to be preserved, then each class should have an additive 
identity so instead of adding and subtracting an object, we let the object tell 
us its zero.

James


Re: [Pharo-users] Pharo #sum vs #sumNumbers and the consequence of #average

2020-03-23 Thread James Foster


> On Mar 23, 2020, at 8:14 AM, Sven Van Caekenberghe  wrote:
> 
> Both are excellent suggestions.
> 
> We have to think a bit about the consequences.
> 
> Still, both would not solve the problem of what to return when the collection 
> is empty.

Zero?

> 
>> On 23 Mar 2020, at 15:47, Konrad Hinsen  wrote:
>> 
>> Am 23.03.20 um 14:45 schrieb James Foster:
>> 
>>>> On Mar 23, 2020, at 6:06 AM, Sven Van Caekenberghe  wrote:
>>>> 
>>>> What you found out now is that the clever trick used to avoid picking an 
>>>> additive identity (picking an element, counting it twice and then 
>>>> subtracting it) leads to a loss of precision when floating point numbers 
>>>> are involved. This is an important issue.
>>> If this approach is to be preserved, then each class should have an 
>>> additive identity so instead of adding and subtracting an object, we let 
>>> the object tell us its zero.
>> 
>> Or define a singleton class "Zero" with a + method that returns the other 
>> operand, and use that Zero object for the additive identity.
>> 
>> Konrad.
>> 
>> 
> 
> 
> 




[Pharo-users] Interested in gig work opportunity?

2021-03-14 Thread James Foster
I have a self-funded hobby project (unrelated to any employer or company) that 
involves porting some Python code to Pharo. The initial task involves porting 
about 100 classes with 600 methods and writing tests for each of them and I’ve 
budgeted US$1200. I realize that this isn’t a big job or much money, and I’m 
mostly curious to find out whether anyone with the needed skills is interested. 
If so, please contact me at smallt...@jgfoster.net 
 with a brief summary of your Pharo and Python 
experience. Take care not to reply to the group unless you want to let me know 
publicly that this sort of inquiry is inappropriate or unreasonable!

James



[Pharo-users] Re: Understanding how to best structure branches to contribute to a 3rd party project

2021-04-01 Thread James Foster
Tim,

This is a common open-source situation and what you described seems to me to be 
the best practice: (1) changes should be proposed as small, self-contained 
branches; (2) you should keep your main/master branch up-to-date with the 
upstream repository so that you can create new branches for new pull/merge 
requests; and (3) you should create your own branch with the combination of 
things you want to include. I don’t know of a way around this.

James

> On Apr 1, 2021, at 3:15 AM, Tim Mackinnon  wrote:
> 
> Hi Everyone - I tried asking this on Discord, but I think it got a bit lost - 
> and perhaps for more philosophical questions, here is better.
> 
> So - I’m wondering what is the recommended way to work with another project 
> you want to contribute to (in my case CodeParasides). So I know I can fork it 
> and put the fork in my baseline.  But I’m assuming contributions are best 
> done discretely on a branch per proposal (this seems to be the Pharo way - 
> and it makes sense for ease of understanding), but if you have a few of these 
> contributions in play (while the maintainer is evaluating them) would you 
> then have your own “combination” branch to consolidate all those fixes until 
> they get merged in?
> 
> I’ve started to try this,  but merging between branches gets a bit tricky - a 
> few times now it seems that Iceberg shows me misleading info on what is being 
> added/removed (it always looks like my changes are going to be removed, when 
> if fact they get added - so its a bit of a leap of faith on this).
> 
> So I’m wondering if I’m overcomplicating things - or whether this is the 
> suggested way to work with another project?
> 
> Tim


[Pharo-users] Re: Mooc on Advanced OO design looking for interested teachers.

2021-04-23 Thread James Foster
Dear Stéphane,

I used the Pharo MOOC in my OO class last year and would certainly consider an 
Advanced OO Design MOOC for next time.

James Foster, MS, MBA, JD
Assistant Professor of Computer Science 
<https://www.wallawalla.edu/academics/areas-of-study/computer-science/>
Walla Walla University <https://wallawalla.edu/> | 204 S. College Ave. | 
College Place, WA 99324
Excellence in Thought ◊ Generosity in Service ◊ Beauty in Expression ◊ Faith in 
God


> On Apr 23, 2021, at 3:41 AM, Stéphane Ducasse  
> wrote:
> 
> Hello
> 
> I’m starting to write a Mooc on Advanced OO design. 
> It will be in the same format that the Pharo Mooc.
> I would like to know if some of you can be interested using part of this mooc 
> in their curriculum. 
> It will help me for a funding agency I’m applying to.
> 
> S. 
> 
> 
> 
> Stéphane Ducasse
> http://stephane.ducasse.free.fr <http://stephane.ducasse.free.fr/> / 
> http://www.pharo.org <http://www.pharo.org/> 
> 03 59 35 87 52
> Assistant: Aurore Dalle 
> FAX 03 59 57 78 50
> TEL 03 59 35 86 16
> S. Ducasse - Inria
> 40, avenue Halley, 
> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
> Villeneuve d'Ascq 59650
> France
> 



[Pharo-users] Re: [ANN] Camp Smalltalk Supreme Finalized!

2021-06-18 Thread James Foster
Is there anyone else out there for whom weekdays (M-F) would be better than a 
primarily weekend event?

James

> On Jun 17, 2021, at 11:31 AM, Richard Kenneth Eng  
> wrote:
> 
> As of today, Wednesday, June 17, 2021, I have successfully nailed down the 
> most exciting roster of keynote speakers for Camp Smalltalk Supreme next 
> year. Here they are:
> Adele Goldberg — co-creator of Smalltalk
> Dan Ingalls — co-creator of Smalltalk
> Kent Beck — Smalltalk pioneer
> David Buck — Smalltalk veteran and podcaster
> This will be the greatest programming language birthday bash ever. As I wrote 
> to Dan Ingalls...
> 
> "I checked birthday celebrations for other languages like FORTRAN, LISP, 
> COBOL, BASIC, and Pascal, and they were quite anemic."
> 
> For more information, visit: https://gofund.me/225341e3 
> 
> 
> I invite presenters to register.
> 
> Cheers,
> Richard



[Pharo-users] Maintainer of smalltalk.org?

2021-10-05 Thread James Foster
I recently came across smalltalk.org <http://smalltalk.org/> and am curious to 
know who maintains it. I tried sending an email to the contact but the address 
bounced.

Thanks!

James Foster



[Pharo-users] Re: UK Smalltalk User Group Meeting - Wednesday, January 26th

2022-01-18 Thread James Foster
Will this be recorded for later viewing (for those of us who would prefer to be 
asleep at 3am)?

James

> On Jan 17, 2022, at 2:30 PM, Giovanni Corriga  wrote:
> 
> For our January meeting, we'll be hosting GemTalk's Martin McClure who will 
> talk about a new Smalltalk IDE - Sparkle.
> 
> If you're setting out to develop a Smalltalk IDE from scratch, what design 
> decisions do you make? You'd love to "fix" the things that have long annoyed 
> you in existing IDEs, but new designs risk creating their own novel 
> annoyances.
> The Sparkle project-in-progress is creating a new and not entirely 
> conventional development environment for GemStone Smalltalk. Come see factors 
> that have influenced its design, get a demo of the current state of the 
> tools, learn about the project's next steps, and share *your* IDE annoyances.
> 
> Martin heard about Smalltalk in 1975, *finally* got his hands on a running 
> Smalltalk system ten years later, and hasn't let go since. In his 25 years on 
> the GemStone team, Martin has worked on many aspects - some VM internals, 
> some user interface design, but mostly all the things that go in between. In 
> his rare spare time, he works on Mist, a Smalltalk variant with improved 
> modularity and no virtual machine. When not dodging Covid, he does a lot of 
> contra and country dancing.
> 
> This will be an online meeting from home.
> 
> If you'd like to join us, please sign up in advance on the meeting's Meetup 
> page ( https://www.meetup.com/UKSTUG/events/282299228/ 
>  ) to receive the meeting 
> details. Don’t forget to bring your laptop and drinks!
> 



[Pharo-users] Re: UK Smalltalk User Group Meeting - Wednesday, January 26th

2022-01-18 Thread James Foster
You are right that it is at 11:00 AM PST. I clicked on the link and didn’t 
recognize that the web site set the time to my local timezone. Very nice!

> On Jan 18, 2022, at 9:56 AM, Martin McClure 
>  wrote:
> 
> I believe this will be recorded. 
> And for someone it will be at 3AM. 
> In your time zone, James, I believe it will be at 11AM.
> 
> Regards,
> -Martin
> 
> On 1/18/22 07:55, James Foster wrote:
>> Will this be recorded for later viewing (for those of us who would prefer to 
>> be asleep at 3am)?
>> 
>> James
>> 
>>> On Jan 17, 2022, at 2:30 PM, Giovanni Corriga >> <mailto:giova...@corriga.net>> wrote:
>>> 
>>> For our January meeting, we'll be hosting GemTalk's Martin McClure who will 
>>> talk about a new Smalltalk IDE - Sparkle.
>>> 
>>> If you're setting out to develop a Smalltalk IDE from scratch, what design 
>>> decisions do you make? You'd love to "fix" the things that have long 
>>> annoyed you in existing IDEs, but new designs risk creating their own novel 
>>> annoyances.
>>> The Sparkle project-in-progress is creating a new and not entirely 
>>> conventional development environment for GemStone Smalltalk. Come see 
>>> factors that have influenced its design, get a demo of the current state of 
>>> the tools, learn about the project's next steps, and share *your* IDE 
>>> annoyances.
>>> 
>>> Martin heard about Smalltalk in 1975, *finally* got his hands on a running 
>>> Smalltalk system ten years later, and hasn't let go since. In his 25 years 
>>> on the GemStone team, Martin has worked on many aspects - some VM 
>>> internals, some user interface design, but mostly all the things that go in 
>>> between. In his rare spare time, he works on Mist, a Smalltalk variant with 
>>> improved modularity and no virtual machine. When not dodging Covid, he does 
>>> a lot of contra and country dancing.
>>> 
>>> This will be an online meeting from home.
>>> 
>>> If you'd like to join us, please sign up in advance on the meeting's Meetup 
>>> page ( https://www.meetup.com/UKSTUG/events/282299228/ 
>>> <https://www.meetup.com/UKSTUG/events/282299228/> ) to receive the meeting 
>>> details. Don’t forget to bring your laptop and drinks!
>>> 
>> 
> 



Re: [Pharo-users] looking for another iterator :)

2018-01-21 Thread James Foster
Since ‘atMax:’ doesn’t seem as clear to me, I’d prefer ‘upToMax:’ or ‘withMax:’ 
or (especially) the following:

upTo: anInteger timesDo: aBlock
upTo: anInteger timesSelect: aBlock
upTo: anInteger timesCollect: aBlock

James Foster

> On Jan 21, 2018, at 8:56 AM, Stephane Ducasse  wrote:
> 
> I thought about something like that...
> 
> SequenceableCollection >> atMax: numberOfItems do: aBlock
>"Execute the iteration with at the maximum numberOfItems. If the
> receiver contains less than numberOfItems iterate them all."
>1 to: (numberOfItems min: self size) do: [:index | aBlock value:
> (self at: index)]
> 
> This is an abstraction that we need to treat some samples.
> 
> Stef
> 
> On Sun, Jan 21, 2018 at 5:47 PM, Stephane Ducasse
>  wrote:
>> Hi Ben and Clement
>> 
>> I have a collection (a dictionary in my case) and I want to get
>> maximum 5 bindings out of it and iterate on them.
>> I want keysAndValuesDo: or do: but only up to 5 elements.
>> 
>> aDict atMax: 5 do: [:each | ]
>> 
>> So I learned from:to:do:
>> 
>> aCollection atMax: 5 do: [:each | ]
>> 
>> Does it make sense?
>> 
>> Stef
>> 
>> On Sun, Jan 21, 2018 at 1:16 PM, Clément Bera  wrote:
>>> I don't think we do. Do you need it on SequenceableCollection or
>>> HashedCollection too ?
>>> 
>>> Recently I was trying to iterate over the first N elements of a collection
>>> and since there was no #first:do: I used #from:to:do:. I guess you could use
>>> that too:
>>> 
>>> aCollection from: 1 to: (aCollection size min: 1000) do: aBlock
>>> 
>>> Which guarantees you iterate at max over 1000 elements. But that API is
>>> SequenceableCollection specific.
>>> 
>>> On Sun, Jan 21, 2018 at 11:44 AM, Ben Coman  wrote:
>>>> 
>>>> On 21 January 2018 at 18:36, Stephane Ducasse 
>>>> wrote:
>>>>> Hi
>>>>> 
>>>>> I would like to iterate at max on a certain amount of elements in a
>>>>> collection.
>>>>> And I was wondering if we have such iterator.
>>>> 
>>>> I'm not clear what functionality your asking for.  Could you present
>>>> it as code & result if you assumed the iterator you want was
>>>> available?
>>>> 
>>>> cheers -ben
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Clément Béra
>>> Pharo consortium engineer
>>> https://clementbera.wordpress.com/
>>> Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
> 
> 




Re: [Pharo-users] Windows installation broken?

2018-06-18 Thread James Foster


> On Jun 18, 2018, at 10:47 AM, Herbert Vojčík  wrote:
> 
> Esteban Lorenzano wrote on 18. 6. 2018 16:04:
>> please restrain your self to talk like that in the future. Is rude and 
>> unnecessary.
> 
> I won't. Sometimes it seems this kind of talk is needed. Windows launcher was 
> not working for so long but it is still pushed as the default download 
> option, because "higher goals" I presume. If this kind of talk helps to get 
> rid of it until working (or make it finally actually work), it is anything 
> but unnecessary.

“Sometimes" it seems necessary to be rude. If an insult is the only thing that 
works, "it is anything but unnecessary."

While one can make a case that arrogant, rude behavior is occasionally 
“necessary," you haven’t made it here. To do so you first need to show (1) not 
just that the problem existed but was reported a long time ago, (2) that other 
more gentle attempts to push the issue were unsuccessful, (3) that the benefit 
of the fix outweighs the cost of the damage you are doing to the community, and 
(4) that you are uniquely qualified to make that judgment. You have not 
satisfied any of those requirements. 

Is this the way you treat your family? Are you managing a software team using 
this approach? Or do you limit this sort of behavior to on-line communities?

James Foster


Re: [Pharo-users] a basic hash question

2018-07-30 Thread James Foster
Werner,

I would say that you are right, this is a problem. A (not un-common) source of 
subtle bugs in Smalltalk is missing this rule that equivalent objects must have 
the same hash. In GemStone the objects are not equivalent (I’m not arguing that 
this is right, just that it avoids the problem you identify).

I wonder what would happen if the hash comparison were added to the equivalence 
operator (#’=‘)!

James

> On Jul 30, 2018, at 5:07 AM, werner kassens  wrote:
> 
> Hi,
> i guess i can subsume almost everything i know about hashes in one sentence:
> it is my understanding that two objects that are equal (obj1=obj2.
> -->true) have to have the same hash value (which is used for some
> collection types), whereas objects where obj1=obj2 returns false should
> have different hash values although it may happen that they have the
> same one.
> 
> now here things don't turn out exactly like that:
> (1 to:4) = #(1 2 3 4). "true"
> (1 to:4)hash = #(1 2 3 4)hash. "false"
> well ok, actually these results make - pfffh, in a certain way - sense
> to me, but i wonder what arguments the people in the know would use to
> defend that result, if i would have another opinion?
> werner
> 
> 
> 




Re: [Pharo-users] a basic hash question

2018-07-31 Thread James Foster
To what extent is it required by ANSI that objects be of the same class? Does 
Pharo treat a String and a Symbol as equivalent if they have the same 
characters?

James

> On Jul 30, 2018, at 10:59 PM, Richard O'Keefe  wrote:
> 
> I do not think that (1 to: 4) and #(1 2 3 4) should be equal.
> Let me put it a little more strongly:  it's a bug.
> Taking
>   a := 1 to: 4.
>   b := Array withAll: a.
>   c := OrderedCollection withAll: b.
> in the two other Smalltalk systems I just tried,
> no two of these are equal.  This is what the ANSI
> Smalltalk standard requires.  Ceteris paribus,
> two sequences are equivalent if and only if
> 1. they are instance of the same class
> 2. they have the same size
> 3. corresponding elements are equivalent.
> It is fairly common for Smalltalk systems to distinguish
> between "these sequences are equivalent" and "these
> sequences have the same elements in the same order",
> with no consensus on the name of the second method.
> One calls it #sameContentsAs:, Squeak #hasEqualElements:.
> 
> 
> On 31 July 2018 at 00:07, werner kassens  > wrote:
> Hi,
> i guess i can subsume almost everything i know about hashes in one sentence:
> it is my understanding that two objects that are equal (obj1=obj2.
> -->true) have to have the same hash value (which is used for some
> collection types), whereas objects where obj1=obj2 returns false should
> have different hash values although it may happen that they have the
> same one.
> 
> now here things don't turn out exactly like that:
> (1 to:4) = #(1 2 3 4). "true"
> (1 to:4)hash = #(1 2 3 4)hash. "false"
> well ok, actually these results make - pfffh, in a certain way - sense
> to me, but i wonder what arguments the people in the know would use to
> defend that result, if i would have another opinion?
> werner
> 
> 
> 



Re: [Pharo-users] a basic hash question

2018-07-31 Thread James Foster
@Richard O’Keefe: I’m trying to find the place in the ANSI Standard you are 
citing. All I’ve found so far is at 5.3.1.1:

The meaning of "equivalent" cannot be precisely defined but the intent is that 
two objects are
considered equivalent if they can be used interchangeably. Conforming protocols 
may choose to
more precisely define the meaning of "equivalent”.

Can you provide a reference for your assertion that objects must be of the same 
class in order to be equivalent?

How about other comparisons between objects of different classes? Is 1.9 < 2? 
Is 2.1 > 2? How about 2.0 = 2? Is #a < ‘b’? is #b > ‘a’? How about #a = ‘a’? It 
seems strange to suggest that an object can be less than or greater than, but 
not equal to!

James

> On Jul 31, 2018, at 9:24 PM, Richard O'Keefe  wrote:
> @James Foster:  100%.  There are no exceptions
> 
> On 1 August 2018 at 02:05, James Foster  <mailto:smallt...@jgfoster.net>> wrote:
> To what extent is it required by ANSI that objects be of the same class? 


Re: [Pharo-users] a basic hash question

2018-07-31 Thread James Foster
Thanks. That is helpful.

James

> On Jul 31, 2018, at 10:28 PM, Richard O'Keefe  wrote:
> 
> Can I give a reference?  Well, I did: the ANSI Smalltalk standard.
> Specifically, section 5.7.8.2, the refinement for 
> 
> Numbers are governed by section 5.6.7.1, which requires numbers that are
> compared for equality to be converted to a common representation, which
> in this case requires (sigh) integers to be converted to floats.  With
> that definition it is possible to find integers x z and a float y such
> that x = y and y = z are true but x = z is false, which is a very bad
> thing.  My Smalltalk tries to be ANSI conformant, but some things are
> just too broken to live with, and that's one of them.  (The rule should
> always be to convert in a way that loses no information.)
> 
> It may well seem strange to you, but "equivalence" (#=) in Smalltalk
> is not coupled to "ordering" (the Magnitude methods) and never has been.
> For example, #= compares the characters of strings, which are equal iff
> they have the same codepoint.  But #< and the other magnitude methods
> use an "implementation-defined" collation order, which could, for example,
> ignore alphabetic case.  So it would be entirely consistent with the
> standard and historic practice to have 'A' <= 'a' and 'a' <= 'A' but
> 'A' ~= 'a'.  This is not merely a theoretical possibility; I just tried
> it in GNU Smalltalk.
> 
> There was a serious historic bug in many Smalltalks where
> 'a' = #a was true (using string comparison) but
> #a = 'a' was false (using identity).  This may well be
> why the standard insists on the classes (not the species)
> being the same, to ensure that  =  is
> consistent with  = .
> 
> On 1 August 2018 at 16:47, James Foster  <mailto:smallt...@jgfoster.net>> wrote:
> @Richard O’Keefe: I’m trying to find the place in the ANSI Standard you are 
> citing. All I’ve found so far is at 5.3.1.1 <http://5.3.1.1/>:
> 
> The meaning of "equivalent" cannot be precisely defined but the intent is 
> that two objects are
> considered equivalent if they can be used interchangeably. Conforming 
> protocols may choose to
> more precisely define the meaning of "equivalent”.
> 
> Can you provide a reference for your assertion that objects must be of the 
> same class in order to be equivalent?
> 
> How about other comparisons between objects of different classes? Is 1.9 < 2? 
> Is 2.1 > 2? How about 2.0 = 2? Is #a < ‘b’? is #b > ‘a’? How about #a = ‘a’? 
> It seems strange to suggest that an object can be less than or greater than, 
> but not equal to!
> 
> James
> 
>> On Jul 31, 2018, at 9:24 PM, Richard O'Keefe > <mailto:rao...@gmail.com>> wrote:
>> @James Foster:  100%.  There are no exceptions
>> 
>> On 1 August 2018 at 02:05, James Foster > <mailto:smallt...@jgfoster.net>> wrote:
>> To what extent is it required by ANSI that objects be of the same class? 
> 



Re: [Pharo-users] Gemstone as a service?

2018-08-18 Thread James Foster
Will you be coming to ESUG? Perhaps we could discuss this in more detail after 
my talk on Wednesday at 12:30 
(https://esug.github.io/2018-Conference/conf2018.html 
<https://esug.github.io/2018-Conference/conf2018.html>). 

James Foster

> On Aug 18, 2018, at 9:11 AM, Andy Burnett  
> wrote:
> 
> Hello,
> I was wondering if anyone offers GaaS? I would love to be able to just focus 
> on writing code, and leave the system management to others. Gemstone does 
> seem to offer a very complete package.
> 
> Also, does anyone know what's happening with Pharocloud? The site is still 
> running, but it seems to be very quiet.
> 
> Cheers
> Andy



Re: [Pharo-users] Gemstone as a service?

2018-08-19 Thread James Foster

> On Aug 19, 2018, at 1:28 AM, Marten Feldtmann  wrote:
> 
> This would be of general interest ... I suppose
> 
> Marten

I’m certainly hoping so! From the schedule:

A Browser-based IDE for Cloud-hosted GemStone
When
Wed, September 12, 12:30pm – 12:45pm
Description
James Foster Polito

While Smalltalk has been an innovator in many ways, hosted development tools 
has not been a notable area of leadership. Smalltalk’s ecosystem tends to have 
a more challenging install process (particularly for GemStone) and this may 
limit its ability to attract attention. Tools like Cloud9 and Jupyter make it 
very easy to experiment with C++ or Python using just a web browser. In this 
presentation we look at an approach to using GemStone in the cloud with only a 
web browser.

James Foster

P.S. I’m not sure how “Politio” got added to my name in the ESUG schedule, but 
https://www.urbandictionary.com/define.php?term=Polito 
<https://www.urbandictionary.com/define.php?term=Polito>, gives the following 
definition:

"A sweet, innocent guy at heart. Not afraid to express himself. 
Full of prosperity <https://www.urbandictionary.com/define.php?term=prosperity> 
and talent, loving every moment he gets from pleasing a crowd. A carefree 
character that has a clear feminine side. Stands out from the crowd and always 
has something to share and someone to share it with. Moves on quickly through 
life and is admired by many, but hurts people with comments that may seem very 
simple to him. Naive at times, Linguistic 
<https://www.urbandictionary.com/define.php?term=Linguistic>, cheerful, honest, 
smiley, juvenile <https://www.urbandictionary.com/define.php?term=juvenile>, 
good-looking, confident, funny, talented this list could go on forever ;) "

> Am 19.08.2018 um 05:15 schrieb James Foster:
>> Will you be coming to ESUG? Perhaps we could discuss this in more detail
>> after my talk on Wednesday at 12:30
>> (https://esug.github.io/2018-Conference/conf2018.html). 
>> 
>> James Foster
>> 
>>> On Aug 18, 2018, at 9:11 AM, Andy Burnett
>>> >> <mailto:andy.burn...@knowinnovation.com>> wrote:
>>> 
>>> Hello,
>>> I was wondering if anyone offers GaaS? I would love to be able to just
>>> focus on writing code, and leave the system management to others.
>>> Gemstone does seem to offer a very complete package.
>>> 
>>> Also, does anyone know what's happening with Pharocloud? The site is
>>> still running, but it seems to be very quiet.
>>> 
>>> Cheers
>>> Andy
>> 
> 
> 
> -- 
> Marten Feldtmann
> 



Re: [Pharo-users] Gemstone as a service?

2018-08-19 Thread James Foster

> On Aug 19, 2018, at 3:49 PM, Andy Burnett  
> wrote:
> 
> Might [someone provide] GaaS ... through Heroku[?]


Regarding Heroku, see 
https://programminggems.wordpress.com/2013/07/16/gemstones-on-heroku/ 
 and 
https://github.com/jgfoster/heroku-gss  
(from 2013). It seems to me that ephemeral file systems are a pretty big hurdle.

James




Re: [Pharo-users] Gemstone as a service?

2018-09-16 Thread James Foster
My ESUG presentation (based on recent screencasts at 
https://www.youtube.com/user/JamesGFoster/videos 
) culminated with a live 
hands-on opportunity for people to connect to a cloud-hosted GemStone/S 64 Bit 
3.4.2 server. As I expected, the question came up of future prospects for a 
real GaaS offering. So far I’m not aware of anyone with official plans in this 
space, but I’m personally interested in exploring the idea. 

Two questions arise from the point-of-view of any potential provider: (1) what 
is the demand; and (2) what would it look like from an operational perspective. 
So, in order to better answer those questions I’d like to get in touch with 
people who would like to try out a GaaS solution. If I provide a dev/test 
environment for 45 days, will you will give me feedback? If you are interested, 
please respond privately with (a) your GemStone/S version (preferably 3.4.2), 
(b) the size of your repository (preferable less than 32 GB, ideally 8 GB or 
less), (c) what client IDE you use to interact with GemStone, and (d) a sorted 
list of preferred/acceptable server locations (from Amsterdam, Frankfurt, 
London, New York, San Francisco, and Toronto). 

Thanks!

James

> On Aug 18, 2018, at 6:11 PM, Andy Burnett  
> wrote:
> 
> Hello,
> I was wondering if anyone offers GaaS? I would love to be able to just focus 
> on writing code, and leave the system management to others. Gemstone does 
> seem to offer a very complete package.
> 
> Also, does anyone know what's happening with Pharocloud? The site is still 
> running, but it seems to be very quiet.
> 
> Cheers
> Andy



[Pharo-users] Distinguishing between dynamic vs. static HTTP requests

2018-09-20 Thread James Foster
When serving web pages from a web server in front of Smalltalk (e.g., Apache, 
Nginx, etc.), is there a convention for designating which pages are to be sent 
on to Smalltalk and which are to be served directly (or sent somewhere else)? 
Is there a prefix or suffix for one or the other? That is, do you treat 
everything that begins with ‘/static/‘ as static (easy enough) and everything 
else gets forwarded to Smalltalk? Or do you have a similar prefix for 
‘/dynamic/‘ content? Or do you have a suffix (‘.st’ or ‘.seaside’) that 
designates requests that are sent on to Smalltalk? I can make any of these 
work, and I can come up with my own rules, but if there is a convention I’d 
like to follow it.

Thanks,
James


Re: [Pharo-users] Why is the root class of tests named TestAsserter?

2018-10-10 Thread James Foster
Hi Abdelghani,

I don’t have immediate access to earlier versions of SUnit (oh, that it were on 
GitHub!), but my recollection is that TestCase was originally a root class but 
duplicate code with TestResource inspired a refactoring that called for a 
common superclass. The name TestAsserter was chosen to reflect the common 
behavior.

James

> On Oct 9, 2018, at 8:12 AM, Alidra Abdelghani via Pharo-users 
>  wrote:
> 
> 
> From: Alidra Abdelghani 
> Subject: Why is the root class of tests named TestAsserter?
> Date: October 9, 2018 at 8:12:11 AM PDT
> To: pharo-users@lists.pharo.org
> 
> 
> Hi,
> 
> I am trying to understand how classes in smalltalk projects are named. 
> Something I can hardly understand is why the root class of the Test hierarchy 
> is named TestAsserter?
> What is the intention behind the term Asserter?
> Wouldn’t it be more appropriate to name it AbstractTest since most classes of 
> this hierarchy are Tests?
> 
> Many thanks in advance
> Abdelghani
> 
> 
> 



Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-22 Thread James Foster
We will have the same issue porting PP2 to GemStone and look forward to 
suggestions.

> On Oct 22, 2018, at 4:40 AM, Steffen Märcker  wrote:
> 
> Hi Jan,
> 
> I am trying to port PP2 to VW and managed to get most of the tests green. =) 
> Some of the remaining test failures occur in
> 
> PP2DebuggingStrategy>>cacheIfNeeded:debugResult:
> 
> where a result of nil is to be stored in an IdentityDictionary. But in VW 
> Dictionaries do not accept nil as a key. If this is indeed intended, I wonder 
> how to circumvent the limitation best. Would it be feasible to use a 
> placeholder object instead of nil (which code would be effected)? Or would it 
> be better to not cache nil at all?
> 
> I'd be happy to hear your thoughts.
> 
> Best, Steffen
> 
> 
> 
> 
> 
> Am .10.2018, 20:58 Uhr, schrieb Jan Kurš :
> 
>> I run PP2 on travis [1], seems Pharo 6.1 loads all configurations, both on
>> linux and mac. Pharo 5, Pharo 6.0 got broken, why is build configuration so
>> hard :'( I don't know, how can I support you. I myself had to gave up on
>> some tools, because I failed to load them.
>> 
>> There is no specific reason to use SmallInteger maxVal...  and nobody ever
>> thought it might be too little. 'PP2 min: X' fails if there are less
>> repetitions that X. 'PP2 max: X' parses at most X repetitions.
>> 
>> ($a asPParser min: 2 max: 3) parse: 'a'. -> Failure
>> ($a asPParser min: 2 max: 3) parse: 'aa'.  #($a $a)
>> ($a asPParser min: 2 max: 3) parse: 'aaa'. #($a $a $a)
>> ($a asPParser min: 2 max: 3) parse: ''. #($a $a $a)
>> 
>> 
>> Use $- asPParser for characters, e.g:
>> $- asPParser parse: '-'
>> 
>> [1]: https://travis-ci.org/kursjan/petitparser2/builds/438358467
>> 
>> On Thu, Oct 11, 2018 at 8:13 PM Steffen Märcker  wrote:
>> 
>>> Reading the code of PetitParser, I wonder why PPRepeatingParser
>>> initializes 'max' with SmallInteger maxVal instead of some notion of
>>> infinity, like Float infinity (and PP2RepeatingNode as well). If I
>>> understand the code correctly, PParser>>min: fails if the number of
>>> repetitions exceeds SmallInteger maxVal, doesn't it?
>>> 
>>> Best, Steffen
>>> 
>>> 
>>> Am .10.2018, 17:10 Uhr, schrieb Steffen Märcker :
>>> 
>>> > I am using MacOS 10.13.6 and the 32bit VM:
>>> >
>>> > Pharo 6.0
>>> > Latest update: #60546
>>> >
>>> > ... the String in about is wrong, it should be 6.1. I installed it via
>>> > the launcher as "Official Distribution: Pharo 6.1 - 32Bit (stable)" I
>>> > just noticed, that the sources file is missing from vms/private/6521/,
>>> > too.
>>> >
>>> > Am .10.2018, 17:02 Uhr, schrieb Sean P. DeNigris >> >:
>>> >
>>> >> Steffen Märcker wrote
>>> >>> I did the following:
>>> >>> 1)  Download and start Pharo 6.1 stable via the launcher.
>>> >>> 2b) Attempt to install PP2 via the scripts from GitHub:
>>> >>>  Metacello new
>>> >>>  baseline: 'PetitParser2';
>>> >>>  repository: 'github://kursjan/petitparser2';
>>> >>>  load.
>>> >>>  Metacello new
>>> >>>  baseline: 'PetitParser2Gui';
>>> >>>  repository: 'github://kursjan/petitparser2';
>>> >>>  load.
>>> >>
>>> >> This way worked for me in Pharo #60546 (check in
>>> World->System->About).
>>> >> What
>>> >> exact Pharo version/OS are you on? 32 or 64-bit
>>> >>
>>> >>
>>> >>
>>> >> -
>>> >> Cheers,
>>> >> Sean
>>> >> --
>>> >> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>> >>
>>> >
>>> >
>>> 
> 
> 




Re: [Pharo-users] My Keynote at the Salta Conference

2018-11-20 Thread James Foster
Hi Richard,

So the  that we gave you is now “lost"? Perhaps people didn’t understand 
what you expected from us other than money. What else is needed to make your 
project a success? We are supposed to “code the competition” as well? Anything 
else?

Is this practice of insulting people (“Doesn’t anyone care about promoting 
Pharo?”) supposed to be motivating? Is it a demonstration of you expertise at 
marketing? Does it build confidence about how the Smalltalk community will be 
perceived by the new arrivals?

I’ve appreciated your blog posts and your passion, but I’m put off by this 
approach.

James

P.S. I realize that I’m probably doing what I’m criticizing in you—throwing out 
negative comments from behind a keyboard to score points when I might not be so 
harsh in person. 

> On Nov 20, 2018, at 2:36 PM, Richard Kenneth Eng  
> wrote:
> 
> Not even a single nibble? Doesn't anyone care about promoting Pharo?
> 
> What a colossal lost opportunity!
> 
> 
> On Sun, 18 Nov 2018 at 09:29, Richard Kenneth Eng  > wrote:
> Some of you may already be aware of my presentation at Smalltalks 2018, the 
> outcome of which was full funding for my Smalltalk programming competition. 
> See My Keynote at the Salta Conference 
> .
> 
> Three years ago, David Buck provided an outline for the competition. See 
> attached.
> 
> I would like to use that as a starting point, though I am open to alternative 
> suggestions.
> 
> The reason for this post is the following...
> 
> I need volunteers to code the competition. I am nowhere near qualified to do 
> so, as my knowledge of Pharo is limited.
> 
> Without help from Pharoers (or, at least, Smalltalkers), the competition is 
> in jeopardy. This is a great opportunity to promote Pharo. (The original 
> competition three years ago was going to use VisualWorks, but since Cincom 
> did not see fit to support my competition this year, I decided to go with 
> Pharo.)
> 
> Please contact me if anyone is interested. It would be a terrible shame to 
> waste this opportunity.
> 
> Regards,
> Richard



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

2019-01-16 Thread James Foster


> On Jan 16, 2019, at 6:28 AM, Petr Fischer via Pharo-users 
>  wrote:
> 
> 
> From: Petr Fischer 
> Subject: Re: [Pharo-users] adding instance variables (data) to the Object 
> class
> Date: January 16, 2019 at 6:28:44 AM PST
> To: pharo-users@lists.pharo.org
> 
> 
> Yes, due to the object layouts and strong connection of Object with VM, my 
> idea can not be done that easily.
> 
> I want to add some information (instance variables like OID [object id]) to 
> some objects of any kind (some objects = persistent objects).
> 
> I can do it with map (idenity as key, OID + other info as value), but I was 
> afraid that the map would tend to be enormous.
> Now (with all your feedback) I am inclined to think that this 
> (map/dictionary) will be the only way.
> 
> Also - on some systems (like Gemstone), there is "dynamic instance variables" 
> (just key/value pairs) and you can add some information to any object 
> instance you want. I like this, but not possible in Pharo, right?

While GemStone allows dynamic instance variables on most objects (to support 
Ruby), it is not allowed on “special” objects like SmallInteger instances that 
are encoded completely in the OOP.

> 
> Thanks! pf
> 
> 
>> I am having a little trouble understanding how adding instance
>> variables to Object is supposed to work.  Where would an immediate
>> object like a SmallInteger *put* such variables?  What does it even
>> *mean* for 0 and 1 to have instance variables?  Do you really want
>> to give an extra word of storage to *every* object in your system,
>> or to just some, but potentially of any kind?
>> 
>> The usual technique is to use something like a WeakIdentityKeyDictionary.
>> 
>> On Mon, 14 Jan 2019 at 13:54, Petr Fischer via Pharo-users <
>> pharo-users@lists.pharo.org> wrote:
>> 
>>> It looks like I can't simply add statefull trait to the Object like this:
>>> 
>>> ProtoObject subclass: #Object
>>>uses: TMyTrait
>>>instanceVariableNames: ''
>>>classVariableNames: 'DependentsFields'
>>>package: 'Kernel-Objects'
>>> 
>>> After this, Pharo 7 VM goes to 100% of CPU usage, several GB of RAM usage
>>> and then crash.
>>> 
>>> Or... what do you mean by "talents"? I found also this:
>>> https://github.com/tesonep/pharo-talents
>>> 
>>> Thanks, pf
>>> 
>>> 
 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
> 
>>> 
>>> 
> 
> 
> 
> 



[Pharo-users] Re: [PDFtalk] Porting to non-namespace Smalltalks

2022-03-01 Thread James Foster
Hi Christian,

I’m glad to hear that PDFtalk is getting such good exposure! I have a brief 
question about the VW port: Did you need to replace any base methods (using 
package overrides, not subclass overrides)?

James

> On Mar 1, 2022, at 10:08 AM, christian.hai...@smalltalked-visuals.com wrote:
> 
> Hi all,
>  
> PDFtalk is a PDF library for VisualWorks[1]. The library has been ported 
> successfully to Gemstone[2].
> Now, there is interest from companies in a port to Squeak and VA Smalltalk.
>  
> The project[3] has started and we are making good progress. 
> The first step: porting the Values package.
> This is easy, because there are no namespace issues.
>  
> The next step is to implement class renamings so that namespaced classes can 
> be renamed to global prefixed names.
>  
> Then PDFtalk with all its components, except for the UI, can be ported.
>  
> The porting approach is different to the traditional way of loading and 
> fixing.
> The import files for other Smalltalks are generated from VisualWorks where 
> the code is transformed by declarative rules.
> The approach is documented in [4].
>  
> I set up a GitHub organization for this project[5]. There, the fileouts for 
> each dialect are published (Gemstone, Squeak and VA Smalltalk so far), so 
> that people without VisualWorks can work with the code in their Smalltalk.
>  
> Also, I record and explain all steps of the porting process for Squeak in 
> great detail[6], so that people can follow it.
>  
> I would like to invite Smalltalkers from all dialects to take part in this 
> project.
> The code transformations for Squeak will be quite similar to the ones needed 
> for Pharo and Cuis.
> Therefore, each port to one Smalltalk will help the port to other Smalltalks.
>  
> Any takers?
>  
> Happy hacking,
> Christian
>  
>  
> [1] https://wiki.pdftalk.de/doku.php?id=start 
> 
> [2] https://wiki.pdftalk.de/doku.php?id=pdftalk4gemstone 
> 
> [3] https://wiki.pdftalk.de/doku.php?id=pdftalknonnamespacefileout 
> 
> [4] https://wiki.pdftalk.de/doku.php?id=smalltalktransform 
> 
> [5] https://github.com/PortingPDFtalk 
> [6] https://wiki.pdftalk.de/doku.php?id=valuesportinglog 
> 


[Pharo-users] Re: [Esug-list] Re: [PDFtalk] Porting to non-namespace Smalltalks

2022-03-01 Thread James Foster
Hi Christian,

I think you are right; I just was curious.

Thanks,

James

> On Mar 1, 2022, at 10:40 AM,  
>  wrote:
> 
> Hi James,
>  
> I am not aware that I override any system methods. That would change the 
> behavior of the base system and that is not ok.
> I do extend system classes though.
> But maybe I don’t understand your question…
>  
> Christian
>  
>  
> Von: James Foster  
> Gesendet: Dienstag, 1. März 2022 19:23
> An: Pharo Mailing List 
> Cc: ESUG Mailing list 
> Betreff: [Pharo-users] Re: [PDFtalk] Porting to non-namespace Smalltalks
>  
> Hi Christian,
>  
> I’m glad to hear that PDFtalk is getting such good exposure! I have a brief 
> question about the VW port: Did you need to replace any base methods (using 
> package overrides, not subclass overrides)?
>  
> James
> 
> 
>> On Mar 1, 2022, at 10:08 AM, christian.hai...@smalltalked-visuals.com 
>> <mailto:christian.hai...@smalltalked-visuals.com> wrote:
>>  
>> Hi all,
>>  
>> PDFtalk is a PDF library for VisualWorks[1]. The library has been ported 
>> successfully to Gemstone[2].
>> Now, there is interest from companies in a port to Squeak and VA Smalltalk.
>>  
>> The project[3] has started and we are making good progress. 
>> The first step: porting the Values package.
>> This is easy, because there are no namespace issues.
>>  
>> The next step is to implement class renamings so that namespaced classes can 
>> be renamed to global prefixed names.
>>  
>> Then PDFtalk with all its components, except for the UI, can be ported.
>>  
>> The porting approach is different to the traditional way of loading and 
>> fixing.
>> The import files for other Smalltalks are generated from VisualWorks where 
>> the code is transformed by declarative rules.
>> The approach is documented in [4].
>>  
>> I set up a GitHub organization for this project[5]. There, the fileouts for 
>> each dialect are published (Gemstone, Squeak and VA Smalltalk so far), so 
>> that people without VisualWorks can work with the code in their Smalltalk.
>>  
>> Also, I record and explain all steps of the porting process for Squeak in 
>> great detail[6], so that people can follow it.
>>  
>> I would like to invite Smalltalkers from all dialects to take part in this 
>> project.
>> The code transformations for Squeak will be quite similar to the ones needed 
>> for Pharo and Cuis.
>> Therefore, each port to one Smalltalk will help the port to other Smalltalks.
>>  
>> Any takers?
>>  
>> Happy hacking,
>> Christian
>>  
>>  
>> [1] https://wiki.pdftalk.de/doku.php?id=start 
>> <https://wiki.pdftalk.de/doku.php?id=start>
>> [2] https://wiki.pdftalk.de/doku.php?id=pdftalk4gemstone 
>> <https://wiki.pdftalk.de/doku.php?id=pdftalk4gemstone>
>> [3] https://wiki.pdftalk.de/doku.php?id=pdftalknonnamespacefileout 
>> <https://wiki.pdftalk.de/doku.php?id=pdftalknonnamespacefileout>
>> [4] https://wiki.pdftalk.de/doku.php?id=smalltalktransform 
>> <https://wiki.pdftalk.de/doku.php?id=smalltalktransform>
>> [5] https://github.com/PortingPDFtalk <https://github.com/PortingPDFtalk>
>> [6] https://wiki.pdftalk.de/doku.php?id=valuesportinglog 
>> <https://wiki.pdftalk.de/doku.php?id=valuesportinglog>
>  
> ___
> Esug-list mailing list -- esug-l...@lists.esug.org
> To unsubscribe send an email to esug-list-le...@lists.esug.org



[Pharo-users] Re: Null Object Pattern

2022-03-16 Thread James Foster
Richard,

My _concern_ with inlining is that since it is designed to short-circuit 
dynamic method lookup, it is impossible to call a _different_ implementation. 
That is, you lose the opportunity to have the _receiver_ decide how to respond 
to the message. You may think of it as a message, but the caller is deciding 
how the receiver will respond—which largely defeats the purpose and role of it 
being a message. Yes, at the machine code level you are performing a branch 
instruction, but when comparing OOP to Procedural Programming we typically make 
a distinction between “messages” and "procedure calls." The distinction is that 
the receiver gets to decide how to respond to a message. In C++ this is the 
distinction between a “virtual" and "non-virtual" function. By inlining, you 
are converting the function from a virtual function to a non-virtual function, 
and this can make a difference (which is why virtual functions exist).

How should a proxy (https://en.wikipedia.org/wiki/Proxy_pattern 
) to nil respond to the #’isNil’ 
message? How should the Null Object Pattern 
(https://en.wikipedia.org/wiki/Null_object_pattern 
) respond to #’isNil’? 

And, yes, I’m sure you can come up with benchmarks that show a measurable 
difference, but what is the impact in realistic code? When someone asked about 
inlining #’yourself’ in GemStone I believe I measured the performance as taking 
2 nanoseconds per call (on a 2012 machine). A 10% speedup would make it 1.8 
nanoseconds. Is that worth it? Maybe, maybe not.

Note that I described my position as a “concern,” not an ideological objection. 
Mostly I’m giving a rationale for something that doesn’t seem to be explained 
very well for you. I accept that there may be a time for inlining, but I can 
“comprehend" another side to the issue.

James

> On Mar 16, 2022, at 9:42 PM, Richard O'Keefe  wrote:
> 
> We're still not on the same page.
> You seem to have some ideological objection to inlining that
> I am completely failing to comprehend.
> Just because a procedure call (message send) is inlined doesn't
> in the least mean it *isn't* a procedure call (message send),
> just as compiling a procedure call (message send) as a jump
> (last-call optimisation) doesn't mean it *isn't* a procedure
> call (message send).
> By the way, forget about "40 years ago".
> I just did an experiment in Pharo 9, and found that
> using "_ ifNotNil: " instead of "_ izNil ifFalse: "
> -- where izNil is a non-inlined self == nil --
> gave a 10% speedup, in a test code where real work was going
> on as well.
> As for turning off all inlining, what do you think that would
> do to #ifFalse:ifTrue: and its relatives?  
> 
> 
> On Thu, 17 Mar 2022 at 08:34,  > wrote:
> 
> 
> To start with, why do you CARE whether a particular method is inlined or not?
> 
> I care because it makes “everything is a message” a lie! And I suspect (no 
> proof and could be wrong) it’s an optimization that only made sense with the 
> hardware constraints of 40+ years ago. Arguing against premature optimization 
> is hardly something I just made up ;-)
> 
> This makes absolutely no sense to me. What makes you think that the 
> combination "_ isNil ifFalse: [_]" will NOT be inlined?
> 
> I may have been unclear. My intent was to communicate: “I’d like to stop ALL* 
> inlining of messages by default if possible”
> 
> *or as many as practical
> 
> The thing that rings loud alarm bells for me is there being "long chains" in 
> the first place.
> 
> I agree that it is in general a smell, but long chains was tangential to the 
> intention above
> 
> Can you give an example?
> 
> I don’t know if I can think of one that’s not contrived… Wrapping something 
> external? Squeak’s AppleScript support used to mirror the underlying AS, 
> which is pretty much exactly that.
> 
> In my own programming, I've generally found that nils turning up in the 
> middle of a chain indicates a serious design error somewhere.
> 
> Agreed. See smell comment above.
> 



[Pharo-users] Re: Null Object Pattern

2022-03-17 Thread James Foster
 this case I needed to know whether it was a NullSummary.
> 
> And of course you run into E.F.Codd's lesson: "one NULL is never
> enough, information can be missing for more than one reason".
> Take the familiar example of a phone number:
>  - I know that Fred's phone number is X
>  - I know that Fred has a phone but I don't know what the number is
>  - I don't know whether Fred has a phone or not
>  - I know that Fred has no phone
> There's room for three *different* null objects there.
> Should we have UnknownNumberOfActualPhone to answer false to #isnil
> and NonNumberOfNonexistentPhone to answer true?  Or what?
> 
> By the way, you may have misunderstood my benchmark.
> It wasn't that #isNil or even _ ifNotNil: speeded up by
> 10%, it was the *whole* matrix-munching benchmark that
> speeded up.  Certainly not a big deal, but it's not
> something I'd be happy to give up in order to get less
> maintainable code.
> 
> 
> 
> 
> 
> 
> 
> 
> On Thu, 17 Mar 2022 at 18:21, James Foster  <mailto:smallt...@jgfoster.net>> wrote:
> Richard,
> 
> My _concern_ with inlining is that since it is designed to short-circuit 
> dynamic method lookup, it is impossible to call a _different_ implementation. 
> That is, you lose the opportunity to have the _receiver_ decide how to 
> respond to the message. You may think of it as a message, but the caller is 
> deciding how the receiver will respond—which largely defeats the purpose and 
> role of it being a message. Yes, at the machine code level you are performing 
> a branch instruction, but when comparing OOP to Procedural Programming we 
> typically make a distinction between “messages” and "procedure calls." The 
> distinction is that the receiver gets to decide how to respond to a message. 
> In C++ this is the distinction between a “virtual" and "non-virtual" 
> function. By inlining, you are converting the function from a virtual 
> function to a non-virtual function, and this can make a difference (which is 
> why virtual functions exist).
> 
> How should a proxy (https://en.wikipedia.org/wiki/Proxy_pattern 
> <https://en.wikipedia.org/wiki/Proxy_pattern>) to nil respond to the #’isNil’ 
> message? How should the Null Object Pattern 
> (https://en.wikipedia.org/wiki/Null_object_pattern 
> <https://en.wikipedia.org/wiki/Null_object_pattern>) respond to #’isNil’? 
> 
> And, yes, I’m sure you can come up with benchmarks that show a measurable 
> difference, but what is the impact in realistic code? When someone asked 
> about inlining #’yourself’ in GemStone I believe I measured the performance 
> as taking 2 nanoseconds per call (on a 2012 machine). A 10% speedup would 
> make it 1.8 nanoseconds. Is that worth it? Maybe, maybe not.
> 
> Note that I described my position as a “concern,” not an ideological 
> objection. Mostly I’m giving a rationale for something that doesn’t seem to 
> be explained very well for you. I accept that there may be a time for 
> inlining, but I can “comprehend" another side to the issue.
> 
> James
> 
>> On Mar 16, 2022, at 9:42 PM, Richard O'Keefe > <mailto:rao...@gmail.com>> wrote:
>> 
>> We're still not on the same page.
>> You seem to have some ideological objection to inlining that
>> I am completely failing to comprehend.
>> Just because a procedure call (message send) is inlined doesn't
>> in the least mean it *isn't* a procedure call (message send),
>> just as compiling a procedure call (message send) as a jump
>> (last-call optimisation) doesn't mean it *isn't* a procedure
>> call (message send).
>> By the way, forget about "40 years ago".
>> I just did an experiment in Pharo 9, and found that
>> using "_ ifNotNil: " instead of "_ izNil ifFalse: "
>> -- where izNil is a non-inlined self == nil --
>> gave a 10% speedup, in a test code where real work was going
>> on as well.
>> As for turning off all inlining, what do you think that would
>> do to #ifFalse:ifTrue: and its relatives?  
>> 
>> 
>> On Thu, 17 Mar 2022 at 08:34, > <mailto:s...@clipperadams.com>> wrote:
>> 
>> 
>> To start with, why do you CARE whether a particular method is inlined or not?
>> 
>> I care because it makes “everything is a message” a lie! And I suspect (no 
>> proof and could be wrong) it’s an optimization that only made sense with the 
>> hardware constraints of 40+ years ago. Arguing against premature 
>> optimization is hardly something I just made up ;-)
>> 
>> This makes absolutely no sense to me. What makes you think that the 
>> combination "_ isNil ifFalse: [_]" will NOT be inlined?
>> 
>> I may have been unclear. My intent was to communicate: “I’d like to stop 
>> ALL* inlining of messages by default if possible”
>> 
>> *or as many as practical
>> 
>> The thing that rings loud alarm bells for me is there being "long chains" in 
>> the first place.
>> 
>> I agree that it is in general a smell, but long chains was tangential to the 
>> intention above
>> 
>> Can you give an example?
>> 
>> I don’t know if I can think of one that’s not contrived… Wrapping something 
>> external? Squeak’s AppleScript support used to mirror the underlying AS, 
>> which is pretty much exactly that.
>> 
>> In my own programming, I've generally found that nils turning up in the 
>> middle of a chain indicates a serious design error somewhere.
>> 
>> Agreed. See smell comment above.
>> 
> 



[Pharo-users] Re: Null Object Pattern

2022-03-19 Thread James Foster
I don’t understand. Wouldn’t an override of #'doesNotUnderstand:’ solve this 
problem? The proxies I’ve seen subclass from nil or ProtoObject and forward 
almost everything to the target. It’s really very easy.

> On Mar 19, 2022, at 3:14 AM, Richard O'Keefe  wrote:
> 
> An object should be a Proxy or Stub only with reference to a specific 
> protocol, which should be kept narrow.
> 
> Being a Proxy is a form of coupling.  Proxying a wide
> interface creates maintenance problems:
> Squeak 5.3 : Object selectors size => 485
> Pharo 9.0  : Object selectors size => 435
> astc   : Object selectors size => 325
> VW 8.3PUL  : Object selectors size => 304
> 
> The interface of Object is HUGE.  You want to bet that
> your Proxy got *all* of the methods right?  This
> interface didn't get that way all at once; it grew.
> The number was 78 in Smalltalk-80.  At a minimum, then,
> Smalltalk systems have accreted one extra Object method
> every two months.
> 
> So you set up your proxy to *flawlesly* mirror Object,
> and then, WHOOPS, upgrade Smalltalk and now there is a
> method that Object has and your Proxy either lacks (if
> it descends from ProtoObject but not Object) or inherits
> an inappropriate version of (if it descends from Object).
> 
> What this means is that nobody ever *does* flawlessly
> mock everything in the public interface of an object
> they are Proxying.  They proxy a *limited* protocol.
> Because that is all they *can* do.
> 
> Look, I know that people who have been trained to work
> with the stuff can use C4 as cooking fuel.  But I haven't
> had that training, so I won't touch the stuff.  In the
> same way, I dare say there are things *you* can safely
> do in Smalltalk that fumblefingers here would be burnt
> badly by.  There are many things that *can* be done that
> I *won't* do.  In a chemistry lab, I would not work with
> ClF3 let alone O2F2.  In Smalltalk, I don't monkey with
> #isNil.
> 
> On Fri, 18 Mar 2022 at 03:52, James Foster  <mailto:smallt...@jgfoster.net>> wrote:
> Richard,
> 
> I very much admire Dijkstra’s admonition regarding “The Humble Programmer” 
> and was pointing a student to that article just this week. 
> 
> In any case, I think you’ve demonstrated that you now comprehend the argument 
> against inlining—you just don’t agree. That’s fair and I think the discussion 
> has been clarified. Would it be fair to say that you have an “ideological 
> objection” to allowing a Proxy or Stub to transparently stand in for another 
> object (say, in a two-object-space environment such as Pharo and GemStone)? 
> That is, a domain object can’t be replaced by a Proxy or Stub without a 
> wholesale rewrite of the rest of the application? I respect that as a 
> reasonable position (demanding perfect clarity), but I see a cost to that 
> position as well.
> 
> Of course, if you really want to avoid allowing the receiver to chose its 
> response to a message, you can use other messages. So if you want to find out 
> if an object is identical to nil you should use `nil == myObject` to ensure 
> that there was not an override of #’isNil’ or #’==‘ by the object’s class. 
> 
> James
> 
>> On Mar 17, 2022, at 2:27 AM, Richard O'Keefe > <mailto:rao...@gmail.com>> wrote:
>> 
>> My chief concern is that I am a bear of very little brain,
>> and if you change the meaning of #isNil to anything at all
>> other than "is the receiver identical to nil" you *WILL*
>> (not may) confuse me.  This extends to things that happen
>> not to be inlined: if even a god-like Smalltalker like
>> Andres Valloud overloads #, to something other than "combine
>> the collection that is the receiver with the collection that
>> is the argument to yield a new collection" than I *WILL*
>> most certainly be confused and find the code unmaintainable.
>> Smalltalk being Smalltalk, if you admit an inconsistent
>> overload anywhere, I can no longer understand sends of that
>> selector anywhere.  One of the things to like about Traits
>> is that you can say "this class doesn't just *happen* to
>> have selectors x and y, it has them *because* it has this
>> whole consistent bundle of selectors."
>> 
>> There are more annotations documented for my Smalltalk
>> compiler than are actually implemented.  One that *is*
>> implemented is , and it has caught more
>> mistakes than I care to admit to.  It's particularly
>> important for a bundle of methods with varying arguments
>> that are meant to be routed through a single method,
>> which *is* meant to be overridden.  It makes sure 

[Pharo-users] Re: Null Object Pattern

2022-03-20 Thread James Foster
Hello Richard,

> What part of … is hard to understand?

Did you mean for this to come off as condescending? Or are you are honestly 
wondering how effectively you are communicating? In either case, all of it is 
hard for me to understand since it doesn’t describe the Proxy Pattern which 
requires that "Clients can't tell whether they work with a subject or its 
proxy” (https://en.wikipedia.org/wiki/Proxy_pattern 
<https://en.wikipedia.org/wiki/Proxy_pattern>). My understanding of a proxy is 
that it will rarely/never happen that "there will be *more* selectors you 
needed to think about but didn’t." So, far from being (an instance of) the 
problem, an override of #’doesNotUnderstand:’ is the elegant solution.

> I wanted something that was like an OrderedCollection but could only hold 
> elements of a specific class.

It seems what you want is not a Proxy but a Facade 
(https://en.wikipedia.org/wiki/Facade_pattern 
<https://en.wikipedia.org/wiki/Facade_pattern>) in which you "may perform 
additional functionality [such as type checking] before ... forwarding a 
request” (https://en.wikipedia.org/wiki/Facade_pattern 
<https://en.wikipedia.org/wiki/Facade_pattern>). 

> I *could* make a proxy by going through #doesNotUnderstand: but I am not 
> going to.

That’s fine, and a proxy is probably inappropriate for the things you do. But 
there are a few usage scenarios 
<https://en.wikipedia.org/wiki/Proxy_pattern#Possible_usage_scenarios> where 
they are appropriate. My primary experience with them is with distributed 
object communication 
<https://en.wikipedia.org/wiki/Distributed_object_communication> where they are 
appropriate.

> I *could* make a batch of ricin and store it in my granddaughter's bedroom, 
> but I'm not going to.

I’m glad to hear it. To take a more realistic example, I could try to fly a 747 
but I’m not going to (since my commercial pilot’s license doesn’t include that 
rating). That doesn’t mean that no one should fly a 747 (or implement a 
Proxy—the people who make GemBuilder for Smalltalk 
<https://gemtalksystems.com/products/gbs-vw/> should certainly use proxies). I 
remember hearing a joke about Kent Beck holding a sign saying “Will override 
#doesNotUnderstand: for food”! I took it as not saying that only a genius can 
understand DNU but that you should think carefully about how it will be used 
(and in many cases something else would be appropriate). Everything else about 
Kent Beck’s work makes it clear that leaving behind clear maintainable code is 
a top priority.

James

> On Mar 19, 2022, at 11:11 PM, Richard O'Keefe  wrote:
> 
> An override of #doesNotUnderstand: *is* (an instance of) the problem.
> What part of "you may think you know what to forward now, but just
> wait a couple of months or install an additional package and there
> will be *more* selectors you needed to think about but didn't" is
> hard to understand?
> 
> Proxies done right are proxies *relative to a specified protocol*.
> 
> Let me give you a personal example.
> I wanted something that was like an OrderedCollection but
> could only hold elements of a specific class.
> No worries, just make a proxy.  Make a bare-bones object,
> define all the #add... methods to check their argument,
> and use #doesNotUnderstand to forward everything else to
> the underlying OrderedCollection.
> 
> The first problem is the selectors that the bare-bones
> object *does* understand by virtue of being an object.
> (Remember there are *hundreds* of these selectors in
> Squeak, Pharo, VisualWorks, even in gst there are more
> than 120).  You must, for example, ensure that #instVarAt:
> is forwarded, not handled locally, BUT you must also
> ensure that #instVarAt:put: is handled locally, not forwarded.
> And then one day you find that your program has broken,
> because mutable collections now have
>   aMutableCollection inPlaceCollect: collectBlock
> and that can put unacceptable results in the collection
> *without* going through any #add... method.  
> 
> Eventually you realise "handing out a wrapper for this
> collection constrained to only allow adding certain things"
> is the wrong way to do it, and you do something like
> 
> constrainedAdder: constraint
>   ^[:x | (constraint value: x)
>ifTrue:  [self add: x]
>ifFalse: [DomainError receiver: self selector: #add:]]
> 
> or you do something else entirely, like handing out a wrapper with
> a *narrow* interface that doesn't make the slightest pretence of
> *being* the other object.
> 
> I *could* make a batch of ricin and store it in my
> granddaughter's bedroom, but I'm not going to.
> I *could* make a proxy by going through #doesNotUnderstand:
> but I am n

[Pharo-users] Re: Null Object Pattern

2022-03-21 Thread James Foster
Richard,

My primary reference for the Proxy Pattern is the classic "Design Patterns, 
Elements of Reusable Object-Oriented Software" by Gamma, Helm, Johnson, and 
Vlissides (Addison-Wesley 1995). In describing how to implement the pattern the 
“Gang of Four (or GOF)" advise “using doesNotUnderstand in Smalltalk” (p. 212). 
Furthermore, as to typing, they say that “Proxy doesn’t always have to know the 
type of real subject” (213). 

The GOF anticipated the problem with inlined selectors and caution that “a few 
special messages ... are handled directly by the virtual machine [and] do not 
cause the usual method look-up” (p. 212). So, I think it is reasonable, in the 
context of a discussion of the Proxy Pattern, to suggest that the Proxy Pattern 
would be more effective with fewer inlined selectors.

As to where the Proxy Pattern was developed, the GOF describe “Known Uses” 
including remote objects in NEXTSTEP (1994) and in Smalltalk (1987). In the 
remote object context, a Proxy has no need to know the type of the target, it 
just needs to know how to forward messages and return results. While there is 
typically a way to find out if something is a proxy or not (e.g., #’_isProxy’) 
the beauty of the Proxy Pattern is that you don’t have to rewrite the entire 
application and use something like #’apparentClass’ or #’apparentlyNil’. Only 
the parts of the application that care if you have a proxy (which will 
typically not be the main domain code) need to look more deeply (with special 
selectors or reflection).

It appears that you believe that a untyped proxy to a remote object is bad and 
that all the code in an application should be written to be aware of the 
possible “remoteness” of certain objects. It is my understanding that a 
transparent untyped proxy to a remote object is well-accepted, extremely 
useful, and can be implemented reliably. 

I don’t think I can contribute much more to the conversation than that so I’ll 
leave it there.

Regards,

James

> On Mar 20, 2022, at 4:55 PM, Richard O'Keefe  wrote:
> 
> Never forget that the Proxy pattern was developed in the context of a TYPED 
> programming
> language.  So "Clients can't tell whether they work with a subject or its 
> proxy” means WITH REFERENCE
> TO A STATED PROTOCOL.  Doing this in Ada or Java is fine, because you define 
> an interface type, and that
> makes it safe.  Here is a sentence from a typical description of the pattern: 
> "Since the proxy implements the 
> INTERFACE as the original class, it can be passed to any client that expects 
> a real service object."  Having
> a specified and *enforced* smallish interface prevents the maintenance issues 
> that plague attempts to use
> this pattern in Smalltalk.
> 
> Remote objects and local objects have different semantics because remote 
> messages and local messages
> have different semantics.  Local messages cannot be lost, duplicated, or 
> reordered, nor can communication
> with a local object drop out for no local reason.  Version skew is a much 
> bigger problem with distributed
> systems than local ones, so once again, it is proxying WITH REFERENCE TO A 
> STATED PROTOCOL (and
> that not a large one!) that counts.  There is no such thing as a 100% 
> transparent remote proxy.  So it is
> very useful to know what an object really is as well as what it pretends to 
> be.  That is,
>   #class#apparentClass
>   #isNil #apparentlyNil
> are *different*,
> 
> So the argument thus far is
> - a selector should not be inlined if it might need to be overridden
> - such as in an application of the Proxy pattern
> - but well-designed Proxies are such WITH REFERENCE TO STATED PROTOCOLS
> - meaning that selectors that are NOT in such protocols are fair game for 
> inlining.
> 



[Pharo-users] Re: [Esug-list] [PDFtalk] Porting to non-namespace Smalltalks

2022-03-27 Thread James Foster
https://github.com/GemTalk/SETT  

> On Mar 27, 2022, at 3:56 PM, Richard Sargent 
>  wrote:
> 
> GemTalk Systems published a tool called SETT which is designed to extract 
> sources from Store into a git repository. I think it's filetree, not to El 
> format, but getting it (and its history) out of Store is the primary 
> motivation.
> 
> It requires direct access to the Store database, as far as I understand.
> 
> Look at the GemTalk area on GitHub for the project and details. (I'm on 
> vacation, using my phone and memory, so pardon the scarcity of detail.)
> 
> On Sun, Mar 27, 2022, 13:17 stephane ducasse  > wrote:
> BTW about porting from VW, you see a friend of mine wanted to see how to help 
> porting Siren to Pharo. 
> Now this is not possible because he could not get a personal VW license. 
> 
> So even if people want to help pointing to a store database is equivalent to 
> /dev/null for most people.
> For example I cannot (and also does not for legal reason) run VW on my 
> machine. 
> Not talking about the new M1 I will get.
> 
> S
> 
>> On 27 Mar 2022, at 22:12, seasidebook > > wrote:
>> 
>> Hi christian 
>> 
>> I took the squeakValues60 becau se I thought that this is what you wanted 
>> that we do.
>> I should continue but I’m busy
>> 
>> 
>> ahhh I did not know that you already did it. 
>> Do you need help to package your changes?
>> Because you can fork my repo and load your changes.
>> 
>> I got lost with the explanation of OrderedDictionary below because I’m dead 
>> :) - worked too mcuh today.
>> But what we can do is to package the one that is working for you under 
>> http://github.com/pharo-container 
>> and update the baseline to load it. 
>> Alternatively we could see what is wrong in the pharo’s one. 
>> 
>> Now my brain decided to shut down :) so I need to sleep.
>> 
>> S
>> 
>>> Hi Stef,
>>>  
>>> Great! Thank you for your work.
>>> Good example for the tonel format.
>>>  
>>> Which sources were you using?
>>> How did you generate this? 
>>> Do you use VW to create the output?
>>>  
>>>  
>>> For the last ESUG (2.5 years ago – sigh), I already did the transformation 
>>> for Values for Pharo. Thanks to you, I revised them and published the 
>>> result on GitHub (https://github.com/PortingPDFtalk/PharoValues 
>>> ) and added a Pharo porting 
>>> page to the wiki (https://wiki.pdftalk.de/doku.php?id=pharoport 
>>> ). Please have a look. 
>>>  
>>> The fileouts are for Pharo versions 6.1, 7.0, 8.0 and 9.0 (7.0 to 9.0 have 
>>> identical sources). The sources load without errors or warnings and all 27 
>>> tests pass.
>>>  
>>>  
>>> Some of the problems in your code have to do with OrderedDictionary as 
>>> superclass of Valuemap. When I did my first round on the port, I had a 
>>> class OrderedDictionary in my Values implementation. Unfortunately, 
>>> OrderedDictionary does not work as I expected.
>>>  
>>> (OrderedDictionary with: #a -> 1 with: #b -> 2) = 
>>> (OrderedDictionary with: #b -> 2 with: #a -> 1)
>>>  
>>> answers true, although the order is different. Therefore, it cannot be used 
>>> as value.
>>>  
>>> Instead of raising this issue on a Pharo list (sorry), I decided to use a 
>>> new name: Valuemap. 
>>> A Valuemap is an OrderedDictionary where the order is relevant for 
>>> comparisons. 
>>> Squeak had the same problem where it was considered a bug and fixed. 
>>> While I subclass Dictionary for Valuemap in Pharo, I can use 
>>> OrderedDictionary in Squeak. This removes a lot of methods from the fileout.
>>>  
>>>  
>>> A remark about the renamings you propose in your commit comment.
>>> Thank you for the suggestions, but I decline for two reasons:
>>> Names for classes, methods and variables are very important to me. Naming 
>>> is part of the creative expression of the code author. I do think much 
>>> about the right names and therefore, I claim the liberty and right to name 
>>> things according to my feeling.
>> 
>> Yes now you may want to read an excellent book that just came out: 
>> http://books.pharo.org  Pharo with Styles.
>> If you want to have future contributors this is good to follow good practices
>> Else I’m quite sure that you would not like a French Pharo :)
>> 
>>> Maybe my names are a bit influenced by German, where we tend to have longer 
>>> names. Therefore, my names are not so heavily camel-cased J. In contrast, 
>>> Pharo has quite a different style with a love for camel-casing J 
>>> (#timeStamp, #nanoSeconds etc.). 
>>> From a practical view, it would be a lot of work to rename all references 
>>> to the items in this basic systems library. There is a lot of code out 
>>> there using it. Of course, if there is a good reason for a renaming (like a 
>>> spelling mistake or mislead

[Pharo-users] Re: Pharo is unresponsive after forcing quit

2022-04-27 Thread James Foster
Pharo 10 on Mac Monterey works fine for me.

> On Apr 27, 2022, at 5:43 PM, Stewart MacLean  wrote:
> 
> Hi,
> 
> [Pharo 10 on Mac Monterey]
> 
> Due to the multi-process nature of Bonjour that I'm attempting to interface 
> to, I am crashing the system ALOT as it disappears down a black hole and I 
> try to figure out the cause.
> 
> However, I've noticed that most of the time when I restart Pharo it is 
> unresponsive to clicks and I have to relaunch Pharo AGAIN! Argh!
> 
> The mouse moves but no one is at home. Right click brings up menus, but they 
> don't respond.
> 
> As I move the mouse, list items are highlighted.
> 
> As this is a completely new OS process, I'm wondering what is causing this 
> behaviour?
> 
> Has anyone else experienced this, or have an explanation?
> 
> Cheers,
> 
> Stewart


[Pharo-users] Re: Looking for North American programming language/Smalltalk researchers (academic or industry)

2022-07-14 Thread James Foster
Yes, I’m interested but would prefer the second half of June (our school is on 
the quarter system) and would prefer weekdays rather than weekends.

James Foster

> On Jul 14, 2022, at 8:35 AM, David Mason  wrote:
> 
> Given the success of Camp Smalltalk Supreme, Richard and I were wondering if 
> there is interest in a 3rd research Smalltalk conference (alongside ESUG/IWST 
> and FAST/Smalltalks) oriented to North American Smalltalkers..
> 
> It would probably take place in May/June, and probably in/around Toronto.
> 
> So I’m looking for people interested in being on a program committee.
> 
> Thanks
> 
> ../Dave


[Pharo-users] Re: How do I unsubscribe?

2023-01-17 Thread James Foster
Hi Hedley,

If you look at the raw source for the email, it includes the following lines in 
the header:

Reply-To: Any question about pharo is welcome 
Subject: [Pharo-users] How do I unsubscribe?
List-Id: Any question about pharo is welcome 
List-Archive: 

List-Help: 
List-Owner: 
List-Post: 
List-Subscribe: 
List-Unsubscribe: 

So, it appears that pharo-users-le...@lists.pharo.org 
 is correct.

James

> On Jan 17, 2023, at 2:18 PM, Hedley Finger  wrote:
> 
> I can't find any info at the Affinity list-server about unsubscribing from 
> this list. Presumably there is a special address but I can't think what 
> command to add after pharo-users-???. TIA.
> 
> Hedley Finger
> hedley.fin...@gmail.com 
>



[Pharo-users] Re: Wow - Chat GPT understands Smalltalk

2023-03-22 Thread James Foster via Pharo-users
Are you willing to sign your name to this? Is anonymity important to presenting 
these ideas?

James Foster

> On Mar 22, 2023, at 5:34 AM, in_pharo_users--- via Pharo-users 
>  wrote:
> 
> Offray,  and to all others,
> 
> you are missing the issue.
> 
> The problem we face is not to measure 'intelligence' of a system, but it's 
> ability to verbally act indistinguishable from a human.
> 
> This ability is allready given as chatbots are accepted by millions of users, 
> f.i. as user interfaces. (measurement = 'true', right?)
> 
> ChatGPT has the ability to follow a certain intention, f.i. to convince the 
> user to buy a certain product.  For this purpose, chat bots are getting  now 
> equipped with life like portrait pictures, speech input and output systems 
> with life like voices, phone numbers that they can use to make calls or being 
> called.  They are fed with all available data on the user, and we know that 
> ALL information about every single internet user in available and is being 
> consolidared on necessity.  The chat bots are able to use this information to 
> guide their conversational strategy, as the useful aspects of the users 
> mindset are extracted from his internet activity.
> 
> These chat bots are now operated on social network platforms with life like 
> names, 'pretending' to be human.
> 
> These bots act verbally indistinguishable from humans for most social media 
> users, as the most advanced psychotronic technology to manufacture consent.
> 
> The first goal of such a propaganda will naturally be to manufacture consent 
> about humans accepting being manipulated by AI chat bots, right?
> 
> How can this be achieved?  
> 
> Like allways in propaganda, the first attempt is to 
> - suppress awareness of the propaganda, then 
> - suppress the awareness of the problematic aspects of the propaganda 
> content, then 
> - reframe the propaganda content as acceptable, then as something to wish for,
> - achive collaboration of the propaganda victim with the goals of the 
> propaganda content.
> 
> Interestingly, this is exactly the schema that your post follows, Offray.
> 
> This often takes the form of domain framing, like we see in our conversation: 
>  the problem is shifted to the realm of academics - here informatics/computer 
> sciences - and thus delegated to experts exclusively.  We saw this in the 
> 9/11 aftermath coverup.
> 
> Then, Offray, you established yourself as an expert in color, discussing 
> aspects that have allready been introduced by others and including the groups 
> main focus 'Smalltalk', thus manufacturing consent and establishing yourself 
> as a reliable 'expert', and in reverse trying to hit at me, whom you have 
> identified as an adversary.
> 
> Then you offered a solution in color to the problem at hand with 'traceable 
> AI' and thus tried to open the possibility of collaboration with AI 
> proponents for the once critical reader.
> 
> I do not state, Offray, that you are knowingly an agent to promote the NWO AI 
> program.  I think you just 'learned' / have been programmed to be a 
> successful academic software developer, because to be successful in 
> academics, it is neccessary to learn to argue just like that since the 
> downfall of academic science in the tradition of, let's say, Humboldt.  So, I 
> grant that you may be a victim of propaganda yourself, instead of being a 
> secret service sposored agent. You took quite some time to formulate your 
> post, though.
> 
> You acted to contain the discussion about AI in this vital and important 
> informatics community to technical detail, when it is neccessary that 
> academics and community members look beyond the narrow borders of their 
> certifications and shift their thinking to the point of view where they can 
> see what technology does in the real world.
> 
> 
> 
> 
> 
> On 21.3.2023 at 7:21 PM, "Offray Vladimir Luna Cárdenas" 
>  wrote:
>> 
>> I agree with Richard. The Turing test is not a good one to test 
>> intelligence and we have now just over glorified Eliza chatbots 
>> that 
>> appear to think and to understand but do none of them. ...


[Pharo-users] Re: Exception handler chaining

2023-05-25 Thread James Foster via Pharo-users
The #’on:do:’ implementation in Block accepts either an Exception or an 
ExceptionSet as the first parameter. So you can do something like the following 
(I’m typing from memory without trying so may have syntax errrors):

[ “tryBlock” ] on: (Array with: ExceptionOne with: ExceptionTwo) do: [:ex | 
  (ex isKindOf: ExceptionOne) ifTrue: [ “handleOne” ].
  (ex isKindOf: ExceptionTwo) ifTrue: [ “handleTwo” ].
].

The above code can be improved in a variety of ways, but it should get you 
started. Note also that since Smalltalk allows you to modify base classes, you 
could add #’on:do:on:do:’ to Block.

James

> On May 25, 2023, at 8:24 AM, mlnt...@gmail.com wrote:
> 
> In other languages there is the possibility to chain exception handlers like 
> this:
> 
> try { doOne(); doTwo(); doThree(); }
> 
> catch(ExceptionOne ex){
> 
> handleOne();
> 
> }
> 
> catch(ExceptionTwo ex) {
> 
> handleTwo();
> 
> }
> 
> catch(ExceptionThree ex) {
> 
> handleThree();
> 
> }
> 
> catch(Exception ex) {
> 
> handleRest();
> 
> }
> 
> Is this possible in Pharo? I’ve tried
> 
> [ block ]
> 
> on: ExceptionOne do: [ handleOne ]
> 
> on: ExceptionTwo do: [ handleTwo ]
> 
> but it is invalid syntax.
> 



[Pharo-users] Re: Exception handler chaining

2023-05-25 Thread James Foster via Pharo-users
Rather than ‘Array with:with:’ it probably should be ‘ExceptionSet with:with:’.

> On May 25, 2023, at 9:19 AM, James Foster via Pharo-users 
>  wrote:
> 
> The #’on:do:’ implementation in Block accepts either an Exception or an 
> ExceptionSet as the first parameter. So you can do something like the 
> following (I’m typing from memory without trying so may have syntax errrors):
> 
> [ “tryBlock” ] on: (Array with: ExceptionOne with: ExceptionTwo) do: [:ex | 
>   (ex isKindOf: ExceptionOne) ifTrue: [ “handleOne” ].
>   (ex isKindOf: ExceptionTwo) ifTrue: [ “handleTwo” ].
> ].
> 
> The above code can be improved in a variety of ways, but it should get you 
> started. Note also that since Smalltalk allows you to modify base classes, 
> you could add #’on:do:on:do:’ to Block.
> 
> James
> 
>> On May 25, 2023, at 8:24 AM, mlnt...@gmail.com wrote:
>> 
>> In other languages there is the possibility to chain exception handlers like 
>> this:
>> 
>> try { doOne(); doTwo(); doThree(); }
>> 
>> catch(ExceptionOne ex){
>> 
>> handleOne();
>> 
>> }
>> 
>> catch(ExceptionTwo ex) {
>> 
>> handleTwo();
>> 
>> }
>> 
>> catch(ExceptionThree ex) {
>> 
>> handleThree();
>> 
>> }
>> 
>> catch(Exception ex) {
>> 
>> handleRest();
>> 
>> }
>> 
>> Is this possible in Pharo? I’ve tried
>> 
>> [ block ]
>> 
>> on: ExceptionOne do: [ handleOne ]
>> 
>> on: ExceptionTwo do: [ handleTwo ]
>> 
>> but it is invalid syntax.
>> 
> 



[Pharo-users] Re: [ANN] Willow-SpinKit v10.0.0 [v10.0.0] released!

2023-05-29 Thread James Foster via Pharo-users
I’m curious about these emails. Is it common practice to have the Pharo mailing 
list notified for GitHub events on Pharo-based projects? Personally, rather 
than getting 8-10 emails today from "Buenos Aires Smalltalk," I’d prefer 
getting one a month written by a person with a summary of what is happening. 
Even for Pharo itself, we get at most one a week. It seems that interested 
persons could subscribe directly to the GitHub project if they wanted more 
details.

James

> On May 29, 2023, at 1:13 PM, Buenos Aires Smalltalk  
> wrote:
> 
> Willow-SpinKit , integration between 
> Willow and SpinKit reached it's v10.0.0 
>  version.
> 
> What's Changed
> 
> Add Pharo 11 support by @gcotelli in 
> https://github.com/ba-st/Willow-SpinKit/pull/26
> Update Willow to v15
> Full Changelog: https://github.com/ba-st/Willow-SpinKit/compare/v9.1.0…v10.0.0
> 
> Regards,
> 
> The Buenos Aires Smalltalk team
> 



[Pharo-users] Re: GLASS Platform - Docker container?

2024-01-16 Thread James Foster via Pharo-users
Hi Sergio,

This question might be better for the GLASS mailing list 
(https://gemtalksystems.com/techsupport/community-and-mailing-lists/), but I’m 
happy to respond here.

I wrote about GemStone in a Docker container in 2018 (see 
https://programminggems.wordpress.com/2018/09/01/gemstone-in-a-docker-container/
 and https://github.com/jgfoster/DockerForGemStone) and David Schaffer has a 
nice follow-up that he has keep up-to-date at 
https://github.com/cdavidshaffer/gemstone-docker. There is also one from Julián 
Maestri at https://hub.docker.com/r/basmalltalk/gemstone-s.

Hope that helps!

James Foster

> On Jan 16, 2024, at 8:22 PM, sergio ruiz  wrote:
> 
> 
> Hi, all.
> 
> I used the GLASS platform years ago, and I was thinking it might be a good 
> match for my upcoming projects.
> 
> The documentation looks to be the same documentation I used back when I 
> started with Seaside.
> 
> I am wondering if GLASS has been ported to Docker yet. This seems like a 
> natural extension.
> 
> Thanks!
> 
> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: 
> https://pgp.key-server.io/pks/lookup?op=get&search=0x69B08F58923AB3A2
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> @sergio_101@mastodon.social
> https://sergio101.com
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
> 



[Pharo-users] Re: [ Security ] Accessing private information from Pharo image

2024-01-16 Thread James Foster via Pharo-users
Dear Sergio,

You are right that passwords and credentials should not be committed to source 
code. There are several alternatives available.

If you are running the code on your own machine, logged as you, then I would 
just keep the credentials in ~/.ssh as a private key. Another place for the 
credentials might be something like /var/opt/MYAPP/myPrivateKey. In any case, 
ensure that you protect the key with 400 or 600 security (this assumes you are 
using Linux or macOS).

James Foster

> On Jan 16, 2024, at 8:27 PM, sergio ruiz  wrote:
> 
> Hi, all.
> 
> One of my projects logs in to Spaces (Digital Ocean’s version of S3). I need 
> to be able access the credentials, but I don’t want to store them in the 
> source code, as I will be using Github to store the projects.
> 
> Is there an accepted way to do this (encryption)?
> 
> Should I store them on the system as environment variables? is this efficient?
> 
> thanks!
> 
> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: 
> https://pgp.key-server.io/pks/lookup?op=get&search=0x69B08F58923AB3A2
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> @sergio_101@mastodon.social
> https://sergio101.com
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
> 



[Pharo-users] Re: [ Security ] Accessing private information from Pharo image

2024-01-17 Thread James Foster via Pharo-users
On Jan 17, 2024, at 3:55 AM, Norbert Hartl  wrote:
> 
> the example is about cloud servers. So we can rule out thumb drives easily ;) 
> …
> 
> Norbert


I read the following to say that the goal is to talk to a cloud server from a 
non-cloud client.

> One of my projects logs in to Spaces (Digital Ocean’s version of S3).

James

[Pharo-users] Re: Backing up data

2024-01-17 Thread James Foster via Pharo-users
Sergio,

If you are keeping data in a Pharo image then you could just save the image 
instead of using STON. Alternatively, you could model your data in an 
Application class with three instance variables: theaters, movies, and events. 
Then you could dump the root application object and STON should preserve the 
relationships (I expect). I prefer this model since it allows me to create a 
test object that encapsulates all the data in one place (even if it is 
referenced from a class variable).

For GemStone, execute `SystemRepository fullBackupGzCompressedTo: aFilePath` 
(see details at 
https://downloads.gemtalksystems.com/docs/GemStone64/3.7.x/GS64-SysAdminGuide-3.7/11-BackupAndRestore.htm).
 This does a full object dump and preserves the relationship between objects. 
Note that GemStone also creates a transaction log so once a transaction 
commits, you can restore it in event of a system crash.

James Foster

> On Jan 17, 2024, at 8:48 PM, sergio ruiz  wrote:
> 
> I have been in the relational database world for decades. One of the things 
> that is super simple is backing up and restoring data.
> 
> Sometimes, it makes it makes sense to pull the production data into 
> development. In the case of a catastrophe, it’s super simple to restore data 
> from a backup.
> 
> I am thinking of backup strategies for my data once again, and am wondering 
> if things have changed since I was last using smalltalk.
> 
> I am thinking of the following:
> 
> STON
> I could dump all of my data into STON, but there is one slight twist. In this 
> project, it’s just making a list of movie listings. There are three basic 
> classes: Theater, Movie, Event. Each of these classes stores an 
> OrderedCollection of items of that type on a class variable, as I’ll need to 
> access each on their own.. so, if an event has a theater, I’ll need to access 
> Theaters on their own, and Movies on their own.
> 
> So, I would have to rebuild the list of Theaters from the Theaters in each 
> event. Otherwise, I would lose the link between the Theaters on the Theater 
> class variable and the Theater in the Event instance.
> 
> Am I thinking about this incorrectly?
> 
> Gemstones
> I am totally into the idea of using gemstones. Is there a backup and restore 
> for objects here? do the relationships remain?
> 
> Voyage
> This seems like a good solution, but I would rather stay in the smalltalk 
> object store.
> 
> Ideas?
> 
> Thanks!
> 
> 
> peace,
> sergio
> photographer, journalist, visionary
> 
> Public Key: 
> https://pgp.key-server.io/pks/lookup?op=get&search=0x69B08F58923AB3A2
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> @sergio_101@mastodon.social
> https://sergio101.com
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
> 



[Pharo-users] Re: Iterating over a Dictionary

2024-01-23 Thread James Foster via Pharo-users
myDict associationsDo: [: anAssociation | ].
myDict keysDo: [:aKey | ].
myDict valuesDo: [:aValue | ].
myDict do: [:aValue | ]. “An alias for #valuesDo:”

James Foster

> On Jan 23, 2024, at 8:27 AM, Joachim Tuchel  wrote:
> 
> AI knows little about Smalltalk ;-)
> 
> You can use do: with each Association as a parameter or you can use 
> keysAndValuesDo:
> 
> myDic do: [:assoc| | key value| key := assoc key. value := assoc value. ...].
> myDic keysAndValuesDo: [:key :value| ...]
> 
> 
> Joachim
> 
> 
> 
> 
> 
> Am 23.01.24 um 17:24 schrieb sergio ruiz:
>> I need to iterate over a dictionary.
>> 
>> I asked the AI buddy for a little help, and he says:
>> 
>> | myDictionary |
>> 
>> "Create a dictionary"
>> myDictionary := Dictionary new.
>> myDictionary at: 'one' put: 1.
>> myDictionary at: 'two' put: 2.
>> myDictionary at: 'three' put: 3.
>> 
>> "Iterate over the dictionary"
>> myDictionary do: [ :key :value |
>> Transcript show: key , ' -> ', value printString ; nl.
>> ].
>> 
>> but when i try this, I get:
>> 
>> ArgumentsCountMismatch: This block accepts 2 arguments, but was called with 
>> 1 argument.
>> 
>> Is the AI using a different dialect of smalltalk?
>> 
>> how would I go about acting on each pair?
>> 
>> Thanks!
>> 
>> 
>> peace,
>> sergio
>> photographer, journalist, visionary
>> 
>> Public Key: 
>> https://pgp.key-server.io/pks/lookup?op=get&search=0x69B08F58923AB3A2
>> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
>> @sergio_101@mastodon.social
>> https://sergio101.com <https://sergio101.com/>
>> http://www.codeandmusic.com <http://www.codeandmusic.com/>
>> http://www.twitter.com/sergio_101
>> http://www.facebook.com/sergio101
>> 
> -- 
> 
> --- 
> Objektfabrik Joachim Tuchel  mailto:jtuc...@objektfabrik.de 
> Fliederweg 1 http://www.objektfabrik.de 
> <http://www.objektfabrik.de/>
> D-71640 Ludwigsburg  http://joachimtuchel.wordpress.com 
> <http://joachimtuchel.wordpress.com/>
> Telefon: +49 7141 56 10 86 0Fax: +49 7141 56 10 86 1
> 



[Pharo-users] Re: [Pharo-dev] A little post Why class number is an idiotic quality metric?

2024-02-10 Thread James Foster via Pharo-users
For those that didn't write the post, here is a link…

https://pharoweekly.wordpress.com/2024/02/10/why-class-number-is-an-idiotic-quality-metric/

James

> On Feb 10, 2024, at 1:13 AM, stephane ducasse  
> wrote:
> 
> 
> https://wordpress.com/post/pharoweekly.wordpress.com/4226
> 
> 
> Stéphane Ducasse
> http://stephane.ducasse.free.fr
> 06 30 93 66 73
> 
> "If you knew today was your last day on earth, what would you do differently? 
> ESPECIALLY if, by doing something different, today might not be your last 
> day on earth.” Calvin & Hobbes
> 
> 
> 
> 
> 



[Pharo-users] GemStone and Relational Databases

2024-02-19 Thread James Foster via Pharo-users
On Feb 19, 2024, at 3:17 AM, Tim Mackinnon  wrote:
> 
> I do think [GemStone] might have solutions to map to a SQL db to appease corp 
> teams - although I'm not sure.

GemConnect (https://gemtalksystems.com/products/gemconnect/) is an add-on 
product for GemStone that allows you to interact with an Oracle relational 
database from GemStone. It is used by several customers to dump transactional 
data to Oracle for reporting. See also GemConnect-for-Postgres 
(https://github.com/GemTalk/GemConnect-for-Postgres).

Less developed is a way to make GemStone look like a relational database. Years 
(decades!) ago there was a third-party add-on that allowed marketing to check a 
box in RFPs but it was never taken seriously. More recently (years, but not 
decades ago), I did a proof-of-concept that demonstrated connecting Microsoft’s 
ODBC to GemStone (so you could see GemStone data using SQL. See 
https://github.com/jgfoster/GemStone-ODBC with links to a silent video and 
slides.

James

[Pharo-users] Re: Early rate deadline is approaching....

2024-04-09 Thread James Foster via Pharo-users
Is the presentation deadline past? I ask because 
https://registration.esug.org/call2024.html doesn’t work.

> On Apr 9, 2024, at 5:46 AM, stephane ducasse  
> wrote:
> 
> Hello
> 
> People do not miss this unique opportunity to participate in ESUG in early 
> July
> 
>   https://esug.org
>   
> Pay attention that the early rate end is approaching… 15 of April 2024.
> 
> https://registration.esug.org/ESUG
> 
> 
> 
> Stéphane Ducasse
> http://stephane.ducasse.free.fr
> 06 30 93 66 73
> 
> "If you knew today was your last day on earth, what would you do differently? 
> ESPECIALLY if, by doing something different, today might not be your last 
> day on earth.” Calvin & Hobbes
> 
> 
> 
> 
> 



[Pharo-users] Re: [Pharo-dev] EU Citizen Initiative for consumers to have access to apps they purchased

2024-08-03 Thread James Foster via Pharo-users
How would this impact software that is licensed on a subscription basis? What 
if some functionality in the application requires a server component. Is the 
vendor required to provide that server component forever? Or is the vendor 
prohibited from building applications that have a server component?

I have a deep suspicion of government regulation of business arrangements like 
this.

James

> On Aug 3, 2024, at 5:47 AM, David Mason  wrote:
> 
> There is currently a citizen initiative to get a law in place that makers of 
> software must not make the software become unusable after they end support.
> 
> While this is directly about games, it has implications for things like cars, 
> tractors, medical devices, and anything that has a significant software 
> component.
> 
> I encourage my EU friends and colleagues to consider signing and explaining 
> to their friends why it's important for them to sign even if they don't play 
> games.
> 
> Here's a video that explains it: https://www.youtube.com/watch?v=mkMe9MxxZiI
> 
> Here's tha petition: https://www.stopkillinggames.com/
> 
> Sorry this is a bit off-topic, but I think it's important to the entire 
> software industry.
> 
> ../Dave



[Pharo-users] Re: A question about Pharo’s Vision document

2024-08-20 Thread James Foster via Pharo-users
I think of this as a reference to the phrase “Turtles all the way down.” This 
is an allusion to the idea that the world is a dome-shaped turtle that stands 
on another turtle that stands on another turtle. How far? “Why, it is turtles 
all the way down.” In this theory, “down” is not toward the center of a sphere, 
but has an absolute direction and implies invinite recursion. See 
https://en.wikipedia.org/wiki/Turtles_all_the_way_down.

The idea is that Smalltalk is pure objects, made up of objects, made up of 
objects. How far? “Objects, all the way down.” Here “down” implies infinite 
recursion. 

James Foster

> On Aug 20, 2024, at 12:15 AM, Rene Paul Mages (ramix)  
> wrote:
> 
> Dear Pharo community,
> 
> At the beginning of this 2012-document  :
> 
> https://inria.hal.science/hal-01879346/document
> 
> we can read the following sentence (page 4) :
> 
>   "Objects all the way down"
> 
> Please what is the meaning (in this context) of the adjective "down" ?
> 
> -- 
> All the best
> Rene Paul Mages (ramix) GnuPG key : 0x9840A6F7
> https://sites.google.com/view/les-logiciels-libres/pharo
> https://sites.google.com/view/renepaulmages/propriete-intellectuelle
> https://twitter.com/RenePaulMages