On Monday 08 May 2017 18:12:19 Marcos Douglas B. Santos wrote:
> On Mon, May 8, 2017 at 12:40 PM, Martin Schreiber <mse00...@gmail.com> 
wrote:
> > "
> > "ini" and "fini" work for stack and heap.
>
> In fact, this is a good idea. But why don't use [initialization] and
> [finalization]?
> The IDE has code-completion so, is better to see a code more readable,
> don't you think?
>
MSEide has no code-completion, I don't like automatism which fiddle with my 
code and I don't like popping-up windows which disturb the flow of thoughts 
while programming. ;-)

>
> You've already answered "No, obj2 is a pointer." but what about if the
> compiler change this by itself, putting a "^" because the variable
> declaration has one?
>
> var
>  obj1: objty;  //an instance on stack, needs no create() or destroy()
>  obj2: ^objty; //on heap
> begin
>  obj1.f1:= 123;
>
>  obj2:= objty.create();
>  try
>   // I did not write the '^' but the compiler will use because the
> declaration in VAR
>   obj2.f1:= 123;
>  finally
>   obj2.destroy();
>  end;
> end;
>
It contradicts the usual Pascal and MSElang pointer notation:
"
type
 recty: record
  a: int32;
  b: int32;
 end;
 precty = ^recty;

 objty: object
  a: int32;
  b: int32;
  constructor create();
 end;
 pobjty = ^objty;

var
 rec1: recty;
 rec2: precty;
 rect3: ^recty;
 obj1:= objty;
 obj2:= pobjty;
 obj3:= ^objty;
begin
 new(rec2); //new is probably not available in MSElang
 rec3:= @rec1;
 rec1.a:= 123;
 rec2^.a:= 123;
 rec3^.b:= 456;
 obj2:= objty.create();
 obj3:= @obj1;
 obj1.a:= 123;
 obj2^.a:= 123;
// obj2.a:= 123; inconsequent!
 obj3^.b:= 456;
// obj3.b:= 456; inconsequent!
"
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