[Newbies] storeString equivalent without duplicates

Mateusz Grotek unoduetre at poczta.onet.pl
Wed Apr 15 03:47:04 UTC 2015


Hi,
Is there any ready-made solution for the following problem.
I'd like to generate the source code which when evaluated returns an  
object in a similar way to what storeString does.
The difference is, that currently storeString creates duplicates.
For example, let's say I have created an array in the following way:

   element := Object new.
   array := {element. element}.

Now if I print:

   array storeString

it shows:

   '((Array new: 2) at: 1 put: (Object basicNew yourself); at: 2 put:  
(Object basicNew yourself); yourself)'

so there is the following inconsistency:

   array2 := Compiler evaluate: array storeString.
   array first == array second. "true"
   array2 first == array2 second. "false"

If there is no ready-made solution, I'll have to hack one myself.

Best wishes,
Mateusz


More information about the Beginners mailing list