On Monday 08 May 2017 04:01:02 Marcos Douglas B. Santos wrote:
> >
> > Currently it can be defined in "var" section
> > "
> > var
> >  obj1: TObj;  //on stack
> >  obj2: ^TObj; //on heap
> > begin
> >  //obj1 does not need to be created
> >  obj2:= tobj.create();
> >  obj2.destroy();
> > "
> > or in "type" section
> > "
> > type
> >  TObj = object
> >  end;
> >  PObj = ^TObj;
> > var
> >  obj1 = TObj;
> >  obj2 = PObj;
> > begin
> >  //obj1 does not need to be created
> >  obj2:= tobj.create();
> >  obj2.destroy();
> > "
>
> Two ways to define the same thing.
> Do you think this is good?
>
Yes.

> > One does not need to use "class", it can be removed. I thought that
> > people comming from Free Pascal will like it. ;-)
>
> You could be right, but I think they will like more if not exist ambiguity.
> :)

Other opinions? Should "class" be removed?

[...]
>
> >> 3. Ancestor class:
> >>
> >>  obj9ty = object(,testintf) [virtual] //no ancestor
> >>
> >> Q: Why this ugly syntax? You are simplifying some Pascal syntax (eg:
> >> every line should have a ";", every block has an "end", etc) but here
> >> you are committing a mistake, IMHO.
> >>
> >> If you allow this:
> >>
> >>   obj4ty = object" << without ancestor
> >>
> >> you should allow this:
> >>   obj9ty = object(testintf) << not an acestor, but an interface
> >>
> >> ...and the compiler should know that is an interface, not a class.
> >
> > For me code structures should always look the same. An object header is
> > (ancestor,interface1,interface2...), I don't like to have an interface at
> > the first position where normally the ancestor is placed.
>
> So, is not better to do this?
>
> 1. obj4ty = object(tobject)
> 2. obj9ty = object(tobject, testintf)
>
> I mean, we always need to write the ancestor.
> It will always look the same.
>
MSElang supports objects with interfaces but no ancestor. TObject is no part 
of language but part of the RTL for Free Pascal compatibility.
The syntax has been be changed to
"
type
 obj9ty = object(nil,testinf)
 end;
"
Reading https://github.com/yegor256/eo I fear you are against NIL too. ;-)

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