On Monday 08 May 2017 22:44:39 Marcos Douglas B. Santos wrote:
> On Mon, May 8, 2017 at 4:05 PM, Sieghard <s_c_...@arcor.de> wrote:
> > Hallo Marcos,
> >
> > Du schriebst am Mon, 8 May 2017 13:12:19 -0300:
> >> >> 2. In this case:
> >> >>  obj2: ^objty; //on heap
> >> >>
> >> >> Is it possible to remove the "^"?
> >> >> obj2.f1:= 123;
> >> >
> >> > No, obj2 is a pointer.
> >> >
> >> >> I think this distinction exists because "class" exists, right?
> >
> > How does that behave in case of _nested objects_, possibly with
> > identically named fields, which might even be of different types? Is that
> > manageable, or will the construct break down, at least on "pathological"
> > casses?
> >
> > (I'm afraid it _will_ break down.)
>
> For me it would be the same as today, using classes.

But classes always are a pointer to a memory area on heap. Objects can be in 
global static memory, on stack or on heap so I think it should be visible at 
element access if the object reference is an address or the content.
"
type
 tcla = class
 end;
 objty = object
  f1: int32;
 end;
 pobjty = ^objty;

var
 cla1: tcla;
 cla2: tcla;
 obj1: objty;
 obj2: objty;
 obj3: ^objty; //or pobjty
 obj4: ^objty; //or pobjty
begin
 obj1: objty;
 cla1:= cla2; //copies the address of content
 obj1:= obj2; //copies the content
 obj1.f1:= 123;
 obj3:= obj4; //copies the address of content
 obj3:= @obj2;//copies the address of content
 obj3^.f1:= 123;
  //or
 with o: obj3^ do
  o.f1:= 123;
 end;

> But Martin have already disagreed about this single syntax.
>
I must work some time with "object"s in order to decide if an 
additional "class" type is rectified.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to