On Tue, May 9, 2017 at 3:24 AM, Martin Schreiber <[email protected]> wrote: > On Monday 08 May 2017 22:44:39 Marcos Douglas B. Santos wrote: >> On Mon, May 8, 2017 at 4:05 PM, Sieghard <[email protected]> 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;
I understand your point of view but I think this could be confusing... Well, first of all we should understand the proposal this new language: 1. Is it a low level language that will works like C to make libs, OS and so on? 2. Is it a high level language that abstract the details, but allow us to use these details *if* we wish? I see Object Pascal inside second option. >> 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. Sounds good. Marcos Douglas ------------------------------------------------------------------------------ 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 [email protected] https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

