If memory serves me right, Erik Bågfors wrote:
> > >>  would a be able to modify itself ? (unfortunately C# allows that)
> > >

To clarify here's my example ...

=cut

using System;
public struct MyStruct
{
        int val;
        public MyStruct(int x){ val=x; }
        public void Modify(){ val=42; }
        public override String ToString(){ return val.ToString(); }
}
public class FooBar
{
        public static void Main()
        {
                MyStruct m1=new MyStruct(10);
                MyStruct m2=m1;
                m1.Modify();
                Console.WriteLine(m1);
                Console.WriteLine(m2);
        }
}

=end cut

Which gives 

42
10

If in anycase Parrot wants to avoid this , we could always add a special
case to the ILNode_Assign to generate an explicit copy step in parrot for
valuetypes...

So, workarounds are possible .. and neither the host nor the compiler 
is there yet ;) ... 

Gopal
-- 
The difference between insanity and genius is measured by success

Reply via email to