[Newbies] Re: Questions about primitives - how to avoid one ?

2008-02-18 Thread Klaus D. Witzel
Hi C'edrick, on Mon, 18 Feb 2008 01:10:41 +0100, you wrote: David T. Lewis wrote: If you comment out the primitive like this is should definitely work: If I comment out the primitive, in Float= ... and put a self halt after, the halt point has no effect. This is correct, both your

Re: [Newbies] How to empty a collection?

2008-02-18 Thread Bert Freudenberg
On Feb 18, 2008, at 20:41 , itsme213 wrote: I want to clear its contents (size goes back to zero), and can't seem to find something like #clear or #empty. Cannot use a new collection as there are shared references to it. myCollection removeAllSuchThat: [:each | true] - Bert -

[Newbies] Loading Rome SVG package

2008-02-18 Thread Marcin Tustin
I can load the following packages out of the squeaksource repository: Rome-Balloon Rome-Base Rome-PluginCanvas Rome-SVG Rome-Strike Rome-Tests Rome-Reference Rome-BalloonCanvas The rest give me errors about lacking other classes, which I reproduce below. Are the packages that load enough to be

Re: [Newbies] How to empty a collection?

2008-02-18 Thread cdrick
Isn't Cedrick's aida solution going to be significantly faster? this is not mine :) butI'd interested to see if it's a good use of #become:... Does it keep references ? is it safe ? Thanks ___ Beginners mailing list

Re: [Newbies] How to empty a collection?

2008-02-18 Thread Marcin Tustin
Isn't Cedrick's aida solution going to be significantly faster? On Feb 19, 2008 1:02 AM, Ron Teitelbaum [EMAIL PROTECTED] wrote: Hi Sophie, aCollection copy do: [:anElement | aCollection remove: anElement ]. Why copy? If you start removing items from the collection, increasing the

Re: [Newbies] How to empty a collection?

2008-02-18 Thread Brian Murphy-Dye
My understanding as well is that this is the purpose of #become:, but also that it is not very efficient in some versions of Smalltalk. If you are using an OrderedCollection, this is probably a reasonably efficient method as it doesn't need to search through the whole list every time it removes an

RE: [Newbies] How to empty a collection?

2008-02-18 Thread Ron Teitelbaum
Hi Marcin, I'm not a fan of using #become. I will use it for very specific behavior when I need to retain pointers to an object. For example for implementing a proxy. In that case become is a very useful tool. I think that #become is overkill for this situation, but I won't argue that it

[Newbies] 1-way #become: ?

2008-02-18 Thread itsme213
#become: apparently (effectively) swaps object ids. Is there anything like x oneWayBecome: y that would pass this test: testOneWayBecome: x to: y | a b | a := x. b := y. x oneWayBecome: y. self assert: [x == y]. self assert: [a == y]. self assert: [b == y]. (Not

Re: [Newbies] 1-way #become: ?

2008-02-18 Thread Michael van der Gulik
See becomeForward: Gulik. On Feb 19, 2008 4:59 PM, itsme213 [EMAIL PROTECTED] wrote: #become: apparently (effectively) swaps object ids. Is there anything like x oneWayBecome: y that would pass this test: testOneWayBecome: x to: y | a b | a := x. b := y. x

[Newbies] Re: How to empty a collection?

2008-02-18 Thread Klaus D. Witzel
On Tue, 19 Feb 2008 02:35:34 +0100, Marcin Tustin wrote: Isn't Cedrick's aida solution going to be significantly faster? No, solutions based on #become: are the slowest possible. The VM has to sweep the whole memory, for all variables in the system, to find all references during #become:,