Re: [Pharo-project] wrong network packages dependencies

2010-10-22 Thread Luc Fabresse
Great!
This is really bad dependencies...

#Luc


2010/10/21 Pavel Krivanek pavel.kriva...@gmail.com

 issue http://code.google.com/p/pharo/issues/detail?id=3133

 On Thu, Oct 21, 2010 at 3:34 PM, Pavel Krivanek
 pavel.kriva...@gmail.com wrote:
  Hi,
 
  This list of dependencies makes Network package dependent on Morphic
  and other high-level packages.
 
  #('TextMessageLink emphasizeScanner: calls: textColor: '
  'HTTPSocket class httpJpeg: calls: nextImage '
  'HTTPSocket class httpShowPage: calls: openLabel: '
  'HTTPSocket class httpShowChunk: calls: openLabel: '
  'HTTPSocket class md5Hash: calls: hashMessage: md5HashMessage: '
  'HTTPSocket class httpGetDocument:args:accept:request: calls: inspect '
  'HTTPSocket class httpGif: calls: nextImage '
  'SocketStream class finger: calls: getLine '
  'MIMEDocument class guessTypeFromName: calls:
  forURIReturnSingleMimeTypeOrDefault: '
  'POP3Client class example calls: inspect ' 'Password passwordFor:
  calls: typeWithDefault moniker '
  'UUIDGenerator makeSeedFromSound calls: randomBitsFromSoundInput: '
  'MailMessage viewBody calls: openLabel: ' 'MailMessage selfTest calls:
  addressesIn: '
  'MailMessage viewImageInBody calls: withForm: openInWorld drawingClass '
  'MailtoUrl composeText calls: userName '
  'MailtoUrl activate calls: sendMessage: '
  'FtpUrl retrieveContents calls: server servers isTypeFTP server:
 directory: '
  'URI openStream:forceNew:encoding: calls:
 openStream:mode:forceNew:encoding: '
  'URI mimeType calls: forExtension: '
  'POP3Client apopLogin calls: hashMessage: '
  'SMTPClient mailFrom: calls: addressesIn: ')
 
  -- Pavel
 

 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] Pharo problem with Windows 7

2010-10-22 Thread Mariano Martinez Peck
On Thu, Oct 21, 2010 at 10:44 PM, Alexandre Bergel alexan...@bergel.euwrote:

 This is really strange.
 We've tried for a while to save a rep on a local repository, on
 squeaksource, no success...

 Anyone experienced this already?


Yep, several times if you have an antivirus analizing .changes all the time
;)

From the Pharo FAQ

Pharo on Windows is terribly slow. What's wrong?

If you have an antivirus program like nod-32 running, exclude the directory
where you have your Pharo image. With Seaside/Aida, another known problem
(unrelated to Pharo) is that Firefox on Windows can be very slow if using
IPv6. Use 127.0.0.1 instead of localhost. For details see this mailing list
discussionhttp://lists.squeakfoundation.org/pipermail/seaside/2010-March/023005.html
.

HTH

mariano




 Cheers,
 Alexandre


 On 21 Oct 2010, at 17:30, Christian Eduardo Palomares Peralta wrote:

  Hi everyone
 
  I'm new on Pharo, i downloaded pharo for Windows (
 http://pharo-project.org/pharo-download), everything works fine until i
 try to save a package in the Monticello Browser, the Snapshotting Methods
 takes age. Several minutes pass and nothing is saved. Selecting a local
 repository does not help neither in case squeaksource would be down.
 
  I use the VM 4.0.2. I tried the Pharo1.1 one click image, the Windows
 Installer, and the Seaside One click image. Same result.
 
  When I press Alt-. the debugger always open on the  retryWithGC: in the
 method:
  MultiByteFileStreamopen: fileName forWrite: writeMode
Open the file with the given name. If writeMode is true, allow
 writing, otherwise open the file in read-only mode.
Changed to do a GC and retry before failing ar 3/21/98 17:25
| f |
f := fileName asVmPathName.
 
fileID := StandardFileStream retryWithGC:[self primOpen: f
 writable: writeMode]
until:[:id| id notNil]
forFileNamed: fileName.
 
  I disabled my antivirus, but the problem persist
 
  Does anyone can help me with this problem?
 
  Thxs
 
  --
  Christian Eduardo Palomares Peralta (ShinjiDev) -
 http://learningwebdev.blogspot.com
  Administrador del Grupo Python-Perú
  ___
  Pharo-project mailing list
  Pharo-project@lists.gforge.inria.fr
  http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

 --
 _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
 Alexandre Bergel  http://www.bergel.eu
 ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] Loading FFI into Pharo?

2010-10-22 Thread Friedrich Dominicus
Friedrich Dominicus fr...@q-software-solutions.de writes:

 Schwab,Wilhelm K bsch...@anest.ufl.edu writes:

 I haven't had much trouble with it.  You can look in the inbox for
 Migrate (for how I load it) and the DolphinCompatibility package for
 things that I have added to the ODBC support.  
 Are there any usage examples for ODBC and Pharo or is it go out and find
 out yourself? And another maybe stupid question has anyone used it for
 accessing .mdb databases from MS-Access?
Ok i'm probabla currently a bit confused. AFAIKT the Pharo I've running
here is 32-bit. My machine however is a 64-bit System, so to use the
unixodbc I probably would need the 32-bit version of the unixodbc
driver. Is that correct?

So do I have to build the unixodbc stuff myself? on a Debian 64-bit box?

Regards
Friedrich




-- 
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim 
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] Loading FFI into Pharo?

2010-10-22 Thread Mariano Martinez Peck
On Fri, Oct 22, 2010 at 10:05 AM, Friedrich Dominicus 
fr...@q-software-solutions.de wrote:

 Friedrich Dominicus fr...@q-software-solutions.de writes:

  Schwab,Wilhelm K bsch...@anest.ufl.edu writes:
 
  I haven't had much trouble with it.  You can look in the inbox for
  Migrate (for how I load it) and the DolphinCompatibility package for
  things that I have added to the ODBC support.
  Are there any usage examples for ODBC and Pharo or is it go out and find
  out yourself? And another maybe stupid question has anyone used it for
  accessing .mdb databases from MS-Access?
 Ok i'm probabla currently a bit confused. AFAIKT the Pharo I've running
 here is 32-bit. My machine however is a 64-bit System, so to use the
 unixodbc I probably would need the 32-bit version of the unixodbc
 driver. Is that correct?


Yes. Exactly. To compile ODBC you may want to try something like we did in
SqueakDBX:

http://www.squeakdbx.org/SqueakDBX%20in%2064%20bits


Orcheck if there is a binary for 32 bits.


 So do I have to build the unixodbc stuff myself? on a Debian 64-bit box?

 Regards
 Friedrich




 --
 Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
 Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus

 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] Loading FFI into Pharo?

2010-10-22 Thread Friedrich Dominicus
Mariano Martinez Peck marianop...@gmail.com writes:

 On Fri, Oct 22, 2010 at 10:05 AM, Friedrich Dominicus 
 fr...@q-software-solutions.de wrote:

 Friedrich Dominicus fr...@q-software-solutions.de writes:

  Schwab,Wilhelm K bsch...@anest.ufl.edu writes:
 
  I haven't had much trouble with it.  You can look in the inbox for
  Migrate (for how I load it) and the DolphinCompatibility package for
  things that I have added to the ODBC support.
  Are there any usage examples for ODBC and Pharo or is it go out and find
  out yourself? And another maybe stupid question has anyone used it for
  accessing .mdb databases from MS-Access?
 Ok i'm probabla currently a bit confused. AFAIKT the Pharo I've running
 here is 32-bit. My machine however is a 64-bit System, so to use the
 unixodbc I probably would need the 32-bit version of the unixodbc
 driver. Is that correct?


 Yes. Exactly. To compile ODBC you may want to try something like we did in
 SqueakDBX:

 http://www.squeakdbx.org/SqueakDBX%20in%2064%20bits
Thanks my confusion has not last that long. I just was puzzling why isql
does connect but Pharo won't. Sure the reason is clear, but it has
catched me. Fine, I'm trying to get unixodbc compiled an installed on my
64 bit box. I just wonder has anyone build a 64-bit Pharo?

Regards
Friedrich

-- 
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim 
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] What is a primitive method?

2010-10-22 Thread Mariano Martinez Peck
THanks Eliot for the explanation.
SoThe compiler checks and for these kind of special quick methods it
creates a CompiledMethod that has in its header, a primitive value ?

So...if I would be able to put a self halt (but I cannot do it becaue
otherwise it won't be quick anymore)  in NumberisNumber, the debugger
would never stop there?

Interesting!  Thanks Oscar for the question, it make me learn.

Mariano

2010/10/22 Eliot Miranda eliot.mira...@gmail.com

 Hi Oscar,

 see Object classwhatIsAPrimitive.  Further, most of the primitive
 methods you're seeing are methods that answer self, nil, true false or an
 inst var.  See the difference between these:

 SystemNavigation new browseAllSelect: [:m| m isQuick]

 SystemNavigation new browseAllSelect: [:m| m primitive  0 and: [m isQuick
 not]]

 SystemNavigation new browseAllSelect: [:m| m primitive  0 and: [m isQuick
 not and: [(#(117 120) includes: m primitive) not]]]

 HTH
 Eliot


 On Thu, Oct 21, 2010 at 9:18 AM, Oscar E A Callau 
 oalva...@dcc.uchile.clwrote:


 Hi all,

 I have a (basic) question:

 What is a primitive method?

 In pharo 1.1.1, we have CompiledMethodprimitive that basically return:

 0 if the method is not a primitive method
 0 otherwise

 But if you execute this on i.e. NumberisNumber or Morph#model compiled
 methods you get that these two are primitive methods. Are they primitive
 methods?

 Other (related) question is: When I executed the expression:

 SystemNavigation default allPrimitiveMethods

 , I get a OrderedCollection with 5581 elements. Are all those methods,
 primitive methods?


 Thanks in advance
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] Loading FFI into Pharo?

2010-10-22 Thread Mariano Martinez Peck
On Fri, Oct 22, 2010 at 10:33 AM, Friedrich Dominicus 
fr...@q-software-solutions.de wrote:

 Mariano Martinez Peck marianop...@gmail.com writes:

  On Fri, Oct 22, 2010 at 10:05 AM, Friedrich Dominicus 
  fr...@q-software-solutions.de wrote:
 
  Friedrich Dominicus fr...@q-software-solutions.de writes:
 
   Schwab,Wilhelm K bsch...@anest.ufl.edu writes:
  
   I haven't had much trouble with it.  You can look in the inbox for
   Migrate (for how I load it) and the DolphinCompatibility package
 for
   things that I have added to the ODBC support.
   Are there any usage examples for ODBC and Pharo or is it go out and
 find
   out yourself? And another maybe stupid question has anyone used it
 for
   accessing .mdb databases from MS-Access?
  Ok i'm probabla currently a bit confused. AFAIKT the Pharo I've
 running
  here is 32-bit. My machine however is a 64-bit System, so to use the
  unixodbc I probably would need the 32-bit version of the unixodbc
  driver. Is that correct?
 
 
  Yes. Exactly. To compile ODBC you may want to try something like we did
 in
  SqueakDBX:
 
  http://www.squeakdbx.org/SqueakDBX%20in%2064%20bits
 Thanks my confusion has not last that long. I just was puzzling why isql
 does connect but Pharo won't. Sure the reason is clear, but it has
 catched me. Fine, I'm trying to get unixodbc compiled an installed on my
 64 bit box. I just wonder has anyone build a 64-bit Pharo?


More or less. Because you need: a 64 bits VM, and a 64 bits image as much as
I understand.
In addition, there are certain bugs in FFI about using it in 64 bits.



 Regards
 Friedrich

 --
 Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
 Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus

 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] Loading FFI into Pharo?

2010-10-22 Thread Norbert Hartl

On 22.10.2010, at 10:40, Mariano Martinez Peck wrote:

 
 
 On Fri, Oct 22, 2010 at 10:33 AM, Friedrich Dominicus 
 fr...@q-software-solutions.de wrote:
 Mariano Martinez Peck marianop...@gmail.com writes:
 
  On Fri, Oct 22, 2010 at 10:05 AM, Friedrich Dominicus 
  fr...@q-software-solutions.de wrote:
 
  Friedrich Dominicus fr...@q-software-solutions.de writes:
 
   Schwab,Wilhelm K bsch...@anest.ufl.edu writes:
  
   I haven't had much trouble with it.  You can look in the inbox for
   Migrate (for how I load it) and the DolphinCompatibility package for
   things that I have added to the ODBC support.
   Are there any usage examples for ODBC and Pharo or is it go out and 
  find
   out yourself? And another maybe stupid question has anyone used it for
   accessing .mdb databases from MS-Access?
  Ok i'm probabla currently a bit confused. AFAIKT the Pharo I've running
  here is 32-bit. My machine however is a 64-bit System, so to use the
  unixodbc I probably would need the 32-bit version of the unixodbc
  driver. Is that correct?
 
 
  Yes. Exactly. To compile ODBC you may want to try something like we did in
  SqueakDBX:
 
  http://www.squeakdbx.org/SqueakDBX%20in%2064%20bits
 Thanks my confusion has not last that long. I just was puzzling why isql
 does connect but Pharo won't. Sure the reason is clear, but it has
 catched me. Fine, I'm trying to get unixodbc compiled an installed on my
 64 bit box. I just wonder has anyone build a 64-bit Pharo?
 
 More or less. Because you need: a 64 bits VM, and a 64 bits image as much as 
 I understand.
 In addition, there are certain bugs in FFI about using it in 64 bits. 
   
You don't need a 64 bit image. If you have a 64 bit operating system than you 
can only execute 64 bit executables. In linux there are 32 bit compatibility 
libraries. The offer a 32 bit interface and mediate this to 64 bit. So you can 
run a 32 bit vm with compat libraries or native 64 bit vm. The same goes for 
code that you want to link to the vm. It needs to fit. What the vm internally 
uses for its address space does not depend on this. I think that is confusing 
for a lot of people that you can have a 64 bit vm with a 32 bit image.

But does anyone know what is the state of 64 bit vm executables?

Norbert___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] Loading FFI into Pharo?

2010-10-22 Thread Friedrich Dominicus
Norbert Hartl norb...@hartl.name writes:


 You don't need a 64 bit image. If you have a 64 bit operating system than you
 can only execute 64 bit executables. In linux there are 32 bit compatibility
 libraries. The offer a 32 bit interface and mediate this to 64 bit. So you can
 run a 32 bit vm with compat libraries or native 64 bit vm. The same goes for
 code that you want to link to the vm,
Ok, but it means to use Pharo 32 -bit with unixodbc I better have the
32-bit files of unixodbc installed. I'm having that currently but, I
still can not connect to Postgres. I guess I will have to delve into
this quite a bit deeper.

Regards
Friedrich

-- 
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim 
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] Loading FFI into Pharo?

2010-10-22 Thread Mariano Martinez Peck
On Fri, Oct 22, 2010 at 12:42 PM, Friedrich Dominicus 
fr...@q-software-solutions.de wrote:

 Norbert Hartl norb...@hartl.name writes:

 
  You don't need a 64 bit image. If you have a 64 bit operating system than
 you
  can only execute 64 bit executables. In linux there are 32 bit
 compatibility
  libraries. The offer a 32 bit interface and mediate this to 64 bit. So
 you can
  run a 32 bit vm with compat libraries or native 64 bit vm. The same goes
 for
  code that you want to link to the vm,
 Ok, but it means to use Pharo 32 -bit with unixodbc I better have the
 32-bit files of unixodbc installed. I'm having that currently but, I
 still can not connect to Postgres.


Why not trying SqueakDBX or the native postgres driver ?


I guess I will have to delve into
 this quite a bit deeper.

 Regards
 Friedrich

 --
 Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
 Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus

 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

[Pharo-project] ObjectScanner

2010-10-22 Thread stephane ducasse
ObjectScanner does not have any user and I was wondering what was its exact 
purpose?
Apparently it is related to uniclasses and there are still some left over.

It is not available in CUIS.
Stef
___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


[Pharo-project] Looking for SmartRefStream tests

2010-10-22 Thread stephane ducasse
I thought that there were some tests that covers SmartRefStream. Does anybody 
have some?
because it would be good to have some?

Stef
___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


[Pharo-project] About Project

2010-10-22 Thread stephane ducasse
Hi guys

It would be good to take some decisions about Project. It seems that we need a 
place to host some information 
about the current graphical space but we should clean it. I was checking CUIS 
and Cuis only have 6 class side methods.

S. 
___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


[Pharo-project] Objectat:modify:???

2010-10-22 Thread stephane ducasse
I would like to deprecate the following method since nobody use it.
What do you think?

Stef

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


[Pharo-project] about Objectstep

2010-10-22 Thread stephane ducasse
Hi guys

ObjectstepIn: aWindow

^ self step

but step is not defined in Object.
I have the i

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


[Pharo-project] About Object and Model

2010-10-22 Thread stephane ducasse
Hi guys

I'm reading Object and I have the impression that some methods are in Object 
while there should be on Model.

when: anEventSelector
send: aMessageSelector
to: anObject
exclusive: aValueHolder

okToClose
taskbarIcon
taskbarLabel

May be some of these methods should grouped in traits, then applied to Model.
Then if the user wants something else than Model to play the game he can simply 
apply a trait.

I think that this hierarchical decomposition is often forcing us to stack 
methods in the wrong place
I think that the composition is way stronger and much more flexible than 
hierarchical ordering. 
tell me what you think. I would like to have a nice Object class.

Stef
___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


[Pharo-project] some patterns I would like to **kill**

2010-10-22 Thread stephane ducasse
Hi 

I was reading Pluggable and friends
I identified some patterns. 


The respondsTo plague
Examples:

color := self fillStyle asColor.
(self labelMorph respondsTo: #enabled:)
ifTrue: [self labelMorph enabled: self enabled].
(self labelMorph respondsTo: #interactionState:)
ifTrue: [self labelMorph interactionState: self 
interactionState]

(self labelMorph respondsTo: #enabled:) ifTrue: [
self labelMorph enabled: aBoolean].

(self enabled not and: [self label isMorph and: [(self label respondsTo: 
#enabled:) not]])


by construction a labelObject should be a morph and it should answer enabled: 
and the case where this is not the case should be fixed. 


Using submorphs to avoid one single inst var makes code quite ugly to read:


labelMorph
Answer the actual label morph.

self hasSubmorphs ifFalse: [^nil].
self firstSubmorph hasSubmorphs ifFalse: [^nil].
^self firstSubmorph firstSubmorph





___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] Looking for SmartRefStream tests

2010-10-22 Thread Mariano Martinez Peck
On Thu, Oct 21, 2010 at 8:12 PM, stephane ducasse
stephane.duca...@free.frwrote:

 I thought that there were some tests that covers SmartRefStream. Does
 anybody have some?
 because it would be good to have some?


No I didnt.
I saw just ReferenceStream  example2
DataStream  example
DataStream exampleWithPictures

Iremember you also commited something in PharoTaskForces,  but I cannot see
them now :(

Someone should do something like what I did with ImageSegment. Write tests
while learning it.

Cheers

Mariano




 Stef
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

[Pharo-project] Pharo article in linuxMag fr

2010-10-22 Thread Stéphane Ducasse
 
 
 Just to say that recently, there were/are 2 articles about Pharo in GNU Linux 
 Magazine (http://www.gnulinuxmag.com/), a french mag.
 One was publish in the n130, about a presentation of Pharo.
 One will be published in one week in the n132, about Gofer.
 
 Cheers,
 ---
 Jannik Laval
 

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] ObjectScanner

2010-10-22 Thread Mariano Martinez Peck
Seems to be used by SmartRefStream, but I don't know why. But it is easy to
test it.

This works:

FileStream forceNewFileNamed: 'test' do:
[ :stream |  stream fileOutClass: nil andObject: 'something'.
 ].

(FileStream oldFileNamed: 'test') fileInObjectAndCode.


Rename ObjectScanner, and you will get a compiler error.
This is because it is being written in:

SmartRefStream  appendClassDefns


The ObjectScanner class comment says:


An instance of this class is the compiler's context for filing in a
SmartRefStream containing instance-specific classes.  When the old name of a
new object's class conflicts with an existing class name, install a class
var in me.  It has the old name but points at the new class.  The compiler
uses it when compiling the code in the fileIn.  Fill the SmartRefStream's
renamed class dictionary.

An object fileout:
!ObjectScanner new initialize!  allow me to take control with
scanFrom:

Player subclass: Player23 instanceVariableNames: 'foo' classVariableNames:
''
poolDictionaries: nil category: 'Instance Specific'!
I prescan this and (self rename: #Player23 toBe: #Player30)

!Player23 methodsFor: 'all' stamp: 'tk 3/9/98 18:58'!actually sent to
Player30
foo
^ foo! !

!self smartRefStream!binary representation of the objects!



On Thu, Oct 21, 2010 at 8:10 PM, stephane ducasse
stephane.duca...@free.frwrote:

 ObjectScanner does not have any user and I was wondering what was its exact
 purpose?
 Apparently it is related to uniclasses and there are still some left over.

 It is not available in CUIS.
 Stef
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] Morphic application to production questions

2010-10-22 Thread Stéphane Ducasse
Yes we need to make progress on that level please let us know what you will 
find and build!


On Oct 22, 2010, at 12:29 AM, Esteban Lorenzano wrote:

 I need to disable the world menu too
 
 On 2010-10-21 19:20:48 -0300, Esteban Lorenzano esteba...@gmail.com said:
 
 Hi,
 Finally I managed to get one application made with morphic. I developed
 the app inside a StandardWindow, and that's ok, but now I want to move
 it to production, so I need to do some tasks, some of them easy to
 solve, and some of them not (at least for me).
 This is what I think is needed:
 1) remove all morphs (this is easy, already done)
 2) add morphs in world instead StandardWindow (easy too, and already done).
 3) disable control+click, cmd+., etc. (I don't know how to do this)
 4) disable morph drags (my morphs, placed inside the world, can be
 moved, I don't want that)
 5) change the behavior of quit when pressing close window (red button)
 6) disable debugger on errors
 ...and I don't know if there are other things.
 Can you help me with points 3-6?
 Do you know other tasks needed?
 Thanks,
 Esteban
 
 
 
 
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] ObjectScanner

2010-10-22 Thread Stéphane Ducasse

On Oct 22, 2010, at 1:47 PM, Mariano Martinez Peck wrote:

 Seems to be used by SmartRefStream, but I don't know why. But it is easy to 
 test it.
 
 This works:
 
 FileStream forceNewFileNamed: 'test' do: 
 [ :stream |  stream fileOutClass: nil andObject: 'something'. ].  
   
 
 (FileStream oldFileNamed: 'test') fileInObjectAndCode.
 
 
 Rename ObjectScanner, and you will get a compiler error. 
 This is because it is being written in:
 
 SmartRefStream  appendClassDefns


I removed that in my cleans

 
 
 The ObjectScanner class comment says:
 
 
 An instance of this class is the compiler's context for filing in a 
 SmartRefStream containing instance-specific classes.  When the old name of a 
 new object's class conflicts with an existing class name, install a class var 
 in me.  It has the old name but points at the new class.  The compiler uses 
 it when compiling the code in the fileIn.  Fill the SmartRefStream's renamed 
 class dictionary.
 
 An object fileout:
 !ObjectScanner new initialize!  allow me to take control with scanFrom:
 
 Player subclass: Player23 instanceVariableNames: 'foo' classVariableNames: '' 
 poolDictionaries: nil category: 'Instance Specific'!
 I prescan this and (self rename: #Player23 toBe: #Player30)
 
 !Player23 methodsFor: 'all' stamp: 'tk 3/9/98 18:58'!actually sent to 
 Player30
 foo
 ^ foo! !
 
 !self smartRefStream!binary representation of the objects!
 
 
 
 On Thu, Oct 21, 2010 at 8:10 PM, stephane ducasse stephane.duca...@free.fr 
 wrote:
 ObjectScanner does not have any user and I was wondering what was its exact 
 purpose?
 Apparently it is related to uniclasses and there are still some left over.
 
 It is not available in CUIS.
 Stef
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
 
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] ObjectScanner

2010-10-22 Thread Stéphane Ducasse


ObjectScanner.1.cs
Description: Binary data



 Seems to be used by SmartRefStream, but I don't know why. But it is easy to 
 test it.
 
 This works:
 
 FileStream forceNewFileNamed: 'test' do: 
 [ :stream |  stream fileOutClass: nil andObject: 'something'. ].  
   
 
 (FileStream oldFileNamed: 'test') fileInObjectAndCode.
 
 
 Rename ObjectScanner, and you will get a compiler error. 
 This is because it is being written in:
 
 SmartRefStream  appendClassDefns
 
 
 The ObjectScanner class comment says:
 
 
 An instance of this class is the compiler's context for filing in a 
 SmartRefStream containing instance-specific classes.  When the old name of a 
 new object's class conflicts with an existing class name, install a class var 
 in me.  It has the old name but points at the new class.  The compiler uses 
 it when compiling the code in the fileIn.  Fill the SmartRefStream's renamed 
 class dictionary.
 
 An object fileout:
 !ObjectScanner new initialize!  allow me to take control with scanFrom:
 
 Player subclass: Player23 instanceVariableNames: 'foo' classVariableNames: '' 
 poolDictionaries: nil category: 'Instance Specific'!
 I prescan this and (self rename: #Player23 toBe: #Player30)
 
 !Player23 methodsFor: 'all' stamp: 'tk 3/9/98 18:58'!actually sent to 
 Player30
 foo
 ^ foo! !
 
 !self smartRefStream!binary representation of the objects!
 
 
 
 On Thu, Oct 21, 2010 at 8:10 PM, stephane ducasse stephane.duca...@free.fr 
 wrote:
 ObjectScanner does not have any user and I was wondering what was its exact 
 purpose?
 Apparently it is related to uniclasses and there are still some left over.
 
 It is not available in CUIS.
 Stef
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
 
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

[Pharo-project] Smells looking at collections

2010-10-22 Thread Nicolás Paez
Hi, I was looking at collection packages and I found that the class
Association inherits from Magnitude.
It is really strange for me because inheritance represent a is-a relation.

So I looked that the documentation of each of these classes:

*Association:* I represent a pair of associated objects--a key and a value.
My instances can serve as entries in a dictionary.

*Magnitude:* I'm the abstract class Magnitude that provides common protocol
for objects that have
the ability to be compared along a linear dimension, such as dates or times.
Subclasses of Magnitude include Date, ArithmeticValue, and Time, as well as
Character and LookupKey.

Based on this, I think this relation is conceptually WRONG.
If the idea is to reuse code then composition should be used instead of
inheritance.

What do you think?

Saludos!
Nico.
blog: nicopaez.wordpress.com
___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] ObjectScanner

2010-10-22 Thread Stéphane Ducasse
http://code.google.com/p/pharo/issues/detail?id=3134

On Oct 22, 2010, at 1:47 PM, Mariano Martinez Peck wrote:

 Seems to be used by SmartRefStream, but I don't know why. But it is easy to 
 test it.
 
 This works:
 
 FileStream forceNewFileNamed: 'test' do: 
 [ :stream |  stream fileOutClass: nil andObject: 'something'. ].  
   
 
 (FileStream oldFileNamed: 'test') fileInObjectAndCode.
 
 
 Rename ObjectScanner, and you will get a compiler error. 
 This is because it is being written in:
 
 SmartRefStream  appendClassDefns
 
 
 The ObjectScanner class comment says:
 
 
 An instance of this class is the compiler's context for filing in a 
 SmartRefStream containing instance-specific classes.  When the old name of a 
 new object's class conflicts with an existing class name, install a class var 
 in me.  It has the old name but points at the new class.  The compiler uses 
 it when compiling the code in the fileIn.  Fill the SmartRefStream's renamed 
 class dictionary.
 
 An object fileout:
 !ObjectScanner new initialize!  allow me to take control with scanFrom:
 
 Player subclass: Player23 instanceVariableNames: 'foo' classVariableNames: '' 
 poolDictionaries: nil category: 'Instance Specific'!
 I prescan this and (self rename: #Player23 toBe: #Player30)
 
 !Player23 methodsFor: 'all' stamp: 'tk 3/9/98 18:58'!actually sent to 
 Player30
 foo
 ^ foo! !
 
 !self smartRefStream!binary representation of the objects!
 
 
 
 On Thu, Oct 21, 2010 at 8:10 PM, stephane ducasse stephane.duca...@free.fr 
 wrote:
 ObjectScanner does not have any user and I was wondering what was its exact 
 purpose?
 Apparently it is related to uniclasses and there are still some left over.
 
 It is not available in CUIS.
 Stef
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
 
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


[Pharo-project] Latest OB, category autocompletion does always a lowercase

2010-10-22 Thread Mariano Martinez Peck
Hi. In the latest OB code, when I put add category to a method, and I
start to type...it automatically finds several categories, but it always put
lowercase to the name.
For example, I have Package called *MyApp  and I want to create a method
category for thatwhen I type, the option showed is *myapp
Would be great if this is case sensitive.

Cheers

Mariano
___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

[Pharo-project] Monticello Browser does not answer to key position

2010-10-22 Thread Mariano Martinez Peck
Pharo core version: 12199

Steps to reproduce:
1. Open Monticello browse
2. Select a package
3. Type a letter, for example, 'm'

You will see that the selection doesnt move to the next package
starting with m. It would be cool to have the same behavior than when
browsing methods or classes.


http://code.google.com/p/pharo/issues/detail?id=3135

mariano
___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

[Pharo-project] Latest OB code, running single test erases the colors of the rest

2010-10-22 Thread Mariano Martinez Peck
Hi. I I have a TestCase, and with cmd + t, I run a particular test method,
all the little small bolls from the other test methods are lost and
initialized again with gray :(
they would be maintained.

thanks

mariano
___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

[Pharo-project] Explicit ordering of submorphs

2010-10-22 Thread Fernando olivero
Currently, the submorph order isn't explicit.

Which means that adding several submorphs in a certain order, is no guarantee 
that they will appear in the desired order when laid out using a LayoutPolicy. 
Because the #morphicLayoutNumber is used.


I've propose the following:

1. Add Morphprecedence
2. Add MorphorderedSubmorphs 
3. Modify the existing LayoutPolicies to use orderedSubmorphs instead of 
submorphsDo:


ISSUE 3136.

 
___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] Explicit ordering of submorphs

2010-10-22 Thread Fernando olivero
In order to provide compatibility with the existing Morphs, i've propose that 
the if any submorphs does not use #precedence, the behavior defaults to 
#submorphs.


MorphorderedSubmorphs
| usePrecedence morphs |
usePrecedence := submorphs anySatisfy:[:each| each precedence = 0 ].
usePrecedence not ifTrue:[ ^ submorphs ].
morphs := submorphs select: #visible.
morphs sort: [:a :b| a precedence = b precedence ].
^ morphs 

On Oct 22, 2010, at 2:35 PM, Fernando olivero wrote:

 Currently, the submorph order isn't explicit.
 
 Which means that adding several submorphs in a certain order, is no guarantee 
 that they will appear in the desired order when laid out using a 
 LayoutPolicy. Because the #morphicLayoutNumber is used.
 
 
 I've propose the following:
 
 1. Add Morphprecedence
 2. Add MorphorderedSubmorphs 
 3. Modify the existing LayoutPolicies to use orderedSubmorphs instead of 
 submorphsDo:
 
 
 ISSUE 3136.
 
 
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] Latest OB, category autocompletion does always a lowercase

2010-10-22 Thread Lukas Renggli
Protocols are lowercase by convention, that's why it suggests only
lowercase variants. You can still manually type something uppercase of
course.

Lukas

On Friday, October 22, 2010, Mariano Martinez Peck
marianop...@gmail.com wrote:
 Hi. In the latest OB code, when I put add category to a method, and I start 
 to type...it automatically finds several categories, but it always put 
 lowercase to the name.
 For example, I have Package called *MyApp  and I want to create a method 
 category for thatwhen I type, the option showed is *myapp
 Would be great if this is case sensitive.

 Cheers

 Mariano


-- 
Lukas Renggli
www.lukas-renggli.ch

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] Latest OB, category autocompletion does always a lowercase

2010-10-22 Thread Lukas Renggli
Protocols are lowercase by convention, that's why it suggests only
lowercase variants. You can still manually type something uppercase of
course.

Lukas

On Friday, October 22, 2010, Mariano Martinez Peck
marianop...@gmail.com wrote:
 Hi. In the latest OB code, when I put add category to a method, and I start 
 to type...it automatically finds several categories, but it always put 
 lowercase to the name.
 For example, I have Package called *MyApp  and I want to create a method 
 category for thatwhen I type, the option showed is *myapp
 Would be great if this is case sensitive.

 Cheers

 Mariano


-- 
Lukas Renggli
www.lukas-renggli.ch

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] Explicit ordering of submorphs

2010-10-22 Thread Fernando olivero
To evidence this problem:

red := Morph new.
red color: Color red.
yellow := Morph new.
yellow color: Color yellow.
green := Morph new.
green color: Color green.
semaphore := Morph new.
semaphore
changeTableLayout ;
addMorph: red ;
addMorph: yellow ;
addMorph: green.
semaphore openInWorld.  


You see that the semaphore is not correctly laid out.

Of course you could add them in inverse order, or play with the 
#morphicLayerNumberbut i think that this ordering should be explicit.




On Oct 22, 2010, at 2:45 PM, Fernando olivero wrote:

 In order to provide compatibility with the existing Morphs, i've propose that 
 the if any submorphs does not use #precedence, the behavior defaults to 
 #submorphs.
 
 
 MorphorderedSubmorphs
   | usePrecedence morphs |
   usePrecedence := submorphs anySatisfy:[:each| each precedence = 0 ].
   usePrecedence not ifTrue:[ ^ submorphs ].
   morphs := submorphs select: #visible.
   morphs sort: [:a :b| a precedence = b precedence ].
   ^ morphs 
 
 On Oct 22, 2010, at 2:35 PM, Fernando olivero wrote:
 
 Currently, the submorph order isn't explicit.
 
 Which means that adding several submorphs in a certain order, is no 
 guarantee that they will appear in the desired order when laid out using a 
 LayoutPolicy. Because the #morphicLayoutNumber is used.
 
 
 I've propose the following:
 
 1. Add Morphprecedence
 2. Add MorphorderedSubmorphs 
 3. Modify the existing LayoutPolicies to use orderedSubmorphs instead of 
 submorphsDo:
 
 
 ISSUE 3136.
 
 
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
 
 
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] Latest OB, category autocompletion does always a lowercase

2010-10-22 Thread Mariano Martinez Peck
On Fri, Oct 22, 2010 at 2:46 PM, Lukas Renggli reng...@gmail.com wrote:

 Protocols are lowercase by convention,


But is this still true for packages extensions??  I always keep case
sensitive for *MyPackage (I think this is because before monticello have
problems with this)

Maybe just a little change that for those categories with * it doesn't apply
the lowercase would be nice.


that's why it suggests only
 lowercase variants. You can still manually type something uppercase of
 course.


yes, sure.


 Lukas

 On Friday, October 22, 2010, Mariano Martinez Peck
 marianop...@gmail.com wrote:
  Hi. In the latest OB code, when I put add category to a method, and I
 start to type...it automatically finds several categories, but it always put
 lowercase to the name.
  For example, I have Package called *MyApp  and I want to create a method
 category for thatwhen I type, the option showed is *myapp
  Would be great if this is case sensitive.
 
  Cheers
 
  Mariano
 

 --
 Lukas Renggli
 www.lukas-renggli.ch

 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] Smells looking at collections

2010-10-22 Thread Levente Uzonyi

On Fri, 22 Oct 2010, Nicolás Paez wrote:


Hi, I was looking at collection packages and I found that the class
Association inherits from Magnitude.
It is really strange for me because inheritance represent a is-a relation.

So I looked that the documentation of each of these classes:

*Association:* I represent a pair of associated objects--a key and a value.
My instances can serve as entries in a dictionary.

*Magnitude:* I'm the abstract class Magnitude that provides common protocol
for objects that have
the ability to be compared along a linear dimension, such as dates or times.
Subclasses of Magnitude include Date, ArithmeticValue, and Time, as well as
Character and LookupKey.

Based on this, I think this relation is conceptually WRONG.
If the idea is to reuse code then composition should be used instead of
inheritance.

What do you think?


This was the original hierarchy: Magnitude - LookupKey - Association. 
Someone removed LookupKey from the chain. This was LookupKey's comment:


I represent a key for looking up entries in a data structure. Subclasses 
of me, such as Association, typically represent dictionary entries.



Levente



Saludos!
Nico.
blog: nicopaez.wordpress.com
___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] Latest OB, category autocompletion does always a lowercase

2010-10-22 Thread Lukas Renggli
On Friday, October 22, 2010, Mariano Martinez Peck
marianop...@gmail.com wrote:

 On Fri, Oct 22, 2010 at 2:46 PM, Lukas Renggli reng...@gmail.com wrote:

 Protocols are lowercase by convention,
 But is this still true for packages extensions??  I always keep case 
 sensitive for *MyPackage (I think this is because before monticello have 
 problems with this)

PackageInfo always matched category names case-sensitive and protocols
case-insensitive.

 Maybe just a little change that for those categories with * it doesn't apply 
 the lowercase would be nice.

The way it currently works is intentional. It helps people to adhere
to the convention and reduces future inconsistencies.

Lukas



-- 
Lukas Renggli
www.lukas-renggli.ch

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] Pharo article in linuxMag fr

2010-10-22 Thread Serge Stinckwich
Great !

2010/10/22 Stéphane Ducasse stephane.duca...@inria.fr:


 Just to say that recently, there were/are 2 articles about Pharo in GNU
 Linux Magazine (http://www.gnulinuxmag.com/), a french mag.
 One was publish in the n130, about a presentation of Pharo.
 One will be published in one week in the n132, about Gofer.
 Cheers,
 ---
 Jannik Laval


 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project




-- 
Serge Stinckwich
UMI UMMISCO 209 (IRD/UPMC), Hanoi, Vietnam
Every DSL ends up being Smalltalk
http://doesnotunderstand.org/

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] Smells looking at collections

2010-10-22 Thread Mariano Martinez Peck
Maybe I am so naive, but what are the advantages of such Inheritance?

The only thing I see is that in all your code of Association you can do
self  and access to all the behavior of Magnitude.
But it is not that difficult to use composition, and write self aMagnitude
replace aMagnitude for whatever name you want.

Cheers

mariano

2010/10/22 Levente Uzonyi le...@elte.hu

 On Fri, 22 Oct 2010, Nicolás Paez wrote:

  Hi, I was looking at collection packages and I found that the class
 Association inherits from Magnitude.
 It is really strange for me because inheritance represent a is-a
 relation.

 So I looked that the documentation of each of these classes:

 *Association:* I represent a pair of associated objects--a key and a
 value.
 My instances can serve as entries in a dictionary.

 *Magnitude:* I'm the abstract class Magnitude that provides common
 protocol
 for objects that have
 the ability to be compared along a linear dimension, such as dates or
 times.
 Subclasses of Magnitude include Date, ArithmeticValue, and Time, as well
 as
 Character and LookupKey.

 Based on this, I think this relation is conceptually WRONG.
 If the idea is to reuse code then composition should be used instead of
 inheritance.

 What do you think?


 This was the original hierarchy: Magnitude - LookupKey - Association.
 Someone removed LookupKey from the chain. This was LookupKey's comment:

 I represent a key for looking up entries in a data structure. Subclasses
 of me, such as Association, typically represent dictionary entries.


 Levente



 Saludos!
 Nico.
 blog: nicopaez.wordpress.com


 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] Pharo article in linuxMag fr

2010-10-22 Thread Germán Arduino
Yes, very interesting.

Here at Argentina we have an annual event about free software, this
year schedule is:

http://www.jornadasregionales.org/jrsl2010v2/schedule/index

Could be interesting to present Pharo/Seaside/Pier here, may be next year.


2010/10/22 Serge Stinckwich serge.stinckw...@gmail.com:
 Great !

 2010/10/22 Stéphane Ducasse stephane.duca...@inria.fr:


 Just to say that recently, there were/are 2 articles about Pharo in GNU
 Linux Magazine (http://www.gnulinuxmag.com/), a french mag.
 One was publish in the n130, about a presentation of Pharo.
 One will be published in one week in the n132, about Gofer.
 Cheers,
 ---
 Jannik Laval


 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project




 --
 Serge Stinckwich
 UMI UMMISCO 209 (IRD/UPMC), Hanoi, Vietnam
 Every DSL ends up being Smalltalk
 http://doesnotunderstand.org/

 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


Re: [Pharo-project] What is a primitive method?

2010-10-22 Thread Eliot Miranda
2010/10/22 Mariano Martinez Peck marianop...@gmail.com

 THanks Eliot for the explanation.
 SoThe compiler checks and for these kind of special quick methods it
 creates a CompiledMethod that has in its header, a primitive value ?


A number, yes.  The number answered by CompiledMethodprimitive.


 So...if I would be able to put a self halt (but I cannot do it becaue
 otherwise it won't be quick anymore)  in NumberisNumber, the debugger
 would never stop there?




The way to put a break-point around a primitive is to rewrite it as a
wrapper method around the actual primitive, e.g.

SmallInteger+ aNumber
primitive: 1
^super + aNumber

= SmallIntegerprimitivePlus: aNumber
primitive: 1
^super + aNumber

SmallInteger+ aNumber
FirstTime == nil ifTrue: [FirstTime := false. self halt].
^self primitivePlus: aNumber

you absolutely need the FirstTime approach (where FirstTie is some global
you define for the purpose)  to cause the halt to fire once if you're trying
to break-point a method that is in wide-spread use.  Otherwise the system
will die a recursive death ;)

best
Eliot



 Interesting!  Thanks Oscar for the question, it make me learn.

 Mariano

 2010/10/22 Eliot Miranda eliot.mira...@gmail.com

 Hi Oscar,

 see Object classwhatIsAPrimitive.  Further, most of the primitive
 methods you're seeing are methods that answer self, nil, true false or an
 inst var.  See the difference between these:

 SystemNavigation new browseAllSelect: [:m| m isQuick]

 SystemNavigation new browseAllSelect: [:m| m primitive  0 and: [m isQuick
 not]]

 SystemNavigation new browseAllSelect: [:m| m primitive  0 and: [m isQuick
 not and: [(#(117 120) includes: m primitive) not]]]

 HTH
 Eliot


 On Thu, Oct 21, 2010 at 9:18 AM, Oscar E A Callau oalva...@dcc.uchile.cl
  wrote:


 Hi all,

 I have a (basic) question:

 What is a primitive method?

 In pharo 1.1.1, we have CompiledMethodprimitive that basically return:

 0 if the method is not a primitive method
 0 otherwise

 But if you execute this on i.e. NumberisNumber or Morph#model
 compiled methods you get that these two are primitive methods. Are they
 primitive methods?

 Other (related) question is: When I executed the expression:

 SystemNavigation default allPrimitiveMethods

 , I get a OrderedCollection with 5581 elements. Are all those methods,
 primitive methods?


 Thanks in advance
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] What is a primitive method?

2010-10-22 Thread Mariano Martinez Peck
2010/10/22 Eliot Miranda eliot.mira...@gmail.com



 2010/10/22 Mariano Martinez Peck marianop...@gmail.com

 THanks Eliot for the explanation.
 SoThe compiler checks and for these kind of special quick methods it
 creates a CompiledMethod that has in its header, a primitive value ?


 A number, yes.  The number answered by CompiledMethodprimitive.


Ok...thanks Eliot.



 So...if I would be able to put a self halt (but I cannot do it becaue
 otherwise it won't be quick anymore)  in NumberisNumber, the debugger
 would never stop there?




 The way to put a break-point around a primitive is to rewrite it as a
 wrapper method around the actual primitive, e.g.

 SmallInteger+ aNumber
 primitive: 1
 ^super + aNumber

 = SmallIntegerprimitivePlus: aNumber
 primitive: 1
 ^super + aNumber

 SmallInteger+ aNumber
 FirstTime == nil ifTrue: [FirstTime := false. self halt].
 ^self primitivePlus: aNumber


Ahhh that's true :)
I forget about that...once I did exactly this for FFI calls.



 you absolutely need the FirstTime approach (where FirstTie is some global
 you define for the purpose)  to cause the halt to fire once if you're trying
 to break-point a method that is in wide-spread use.  Otherwise the system
 will die a recursive death ;)


I guess  we can also use self haltOnce ?   which implementations does
exactly that you suggested :)

Thanks!

mariano


 best
 Eliot



 Interesting!  Thanks Oscar for the question, it make me learn.

 Mariano

 2010/10/22 Eliot Miranda eliot.mira...@gmail.com

 Hi Oscar,

 see Object classwhatIsAPrimitive.  Further, most of the primitive
 methods you're seeing are methods that answer self, nil, true false or an
 inst var.  See the difference between these:

 SystemNavigation new browseAllSelect: [:m| m isQuick]

 SystemNavigation new browseAllSelect: [:m| m primitive  0 and: [m
 isQuick not]]

 SystemNavigation new browseAllSelect: [:m| m primitive  0 and: [m
 isQuick not and: [(#(117 120) includes: m primitive) not]]]

 HTH
 Eliot


 On Thu, Oct 21, 2010 at 9:18 AM, Oscar E A Callau 
 oalva...@dcc.uchile.cl wrote:


 Hi all,

 I have a (basic) question:

 What is a primitive method?

 In pharo 1.1.1, we have CompiledMethodprimitive that basically return:

 0 if the method is not a primitive method
 0 otherwise

 But if you execute this on i.e. NumberisNumber or Morph#model
 compiled methods you get that these two are primitive methods. Are they
 primitive methods?

 Other (related) question is: When I executed the expression:

 SystemNavigation default allPrimitiveMethods

 , I get a OrderedCollection with 5581 elements. Are all those methods,
 primitive methods?


 Thanks in advance
 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



 ___
 Pharo-project mailing list
 Pharo-project@lists.gforge.inria.fr
 http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Re: [Pharo-project] some patterns I would like to **kill**

2010-10-22 Thread Schwab,Wilhelm K
Stef,

#respondsTo: - no argument.  More defensive programming (aka masked bugs).  
Tests like this have their place, but are over-used in Squeak.

Using #submorphs *might* be easier to defend.  Morphs were designed to be 
usable in large numbers, and one might argue (playing Devil's Advocate here) 
that lookups are cheaper than the additional gc load.  An instance variable 
could also cache stale information.  Of course, for something that is accessed 
frequently, an instance variable avoids the lookup and I agree that it is 
cleaner and easier to read.

Bill




From: pharo-project-boun...@lists.gforge.inria.fr 
[pharo-project-boun...@lists.gforge.inria.fr] On Behalf Of stephane ducasse 
[stephane.duca...@free.fr]
Sent: Thursday, October 21, 2010 4:47 PM
To: Pharo Development
Subject: [Pharo-project] some patterns I would like to **kill**

Hi

I was reading Pluggable and friends
I identified some patterns.


The respondsTo plague
Examples:

color := self fillStyle asColor.
(self labelMorph respondsTo: #enabled:)
ifTrue: [self labelMorph enabled: self enabled].
(self labelMorph respondsTo: #interactionState:)
ifTrue: [self labelMorph interactionState: self 
interactionState]

(self labelMorph respondsTo: #enabled:) ifTrue: [
self labelMorph enabled: aBoolean].

(self enabled not and: [self label isMorph and: [(self label respondsTo: 
#enabled:) not]])


by construction a labelObject should be a morph and it should answer enabled: 
and the case where this is not the case should be fixed.


Using submorphs to avoid one single inst var makes code quite ugly to read:


labelMorph
Answer the actual label morph.

self hasSubmorphs ifFalse: [^nil].
self firstSubmorph hasSubmorphs ifFalse: [^nil].
^self firstSubmorph firstSubmorph





___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

___
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project