On Monday 12 June 2017 22:13:32 Sieghard wrote:
> Hallo Martin,
>
> [functions & procedures]
>
> > "function" in C always has a type identifier. As you write, a
> > mathematical function returns something. So "procedure" like in Wirth's
> > Modula2.
>
> Or so. In any case, you lose the ability to immediately recognize whether
> such a thing can be used in an expression (returning a value) or has to be
> used standing alone (classical Pascal "PROCEDURE").

IIRC you proposed to use "function" for both? Sometimes I have the impression 
you are against anything.

> Yes, that _is_ ugly. But it is never needed within the context of an
> object, it is _only_ used (needed) for the declaration of a type referring
> to an object method. You could just as well specify the containing object
> type as a qualifier, like this:
>
>   SomeObjectMethod = SomeObject.procedure (a, b: int32);
>
> or, like your example, which defines the type only implicitely:
>
>   ObjectMethodVariable: SomeObject.procedure (a, b: int32);
>
> if it refers to a method of a different object type, or just omit the
> qualifier if it refers to the currently defined object type. I think this
> should be unmistakable.
>
I probably understand wrong, but do "SomeObjectMethod" 
and "SomeMethodVariable" work with "SomeObject" only? That's not how Delphi 
and MSElang method variables work.

> [WITH]
>
> > MSElang provides a safe "with" statement with mandatory local qualifier.
>
> Something like the "Modula" version?
> I.e. effectively variable (object) renaming, without opening a new scope?

Yes.

> I definitely dislike this kind. This aliasing makes reading the code much
> more difficult than the Pascal version of "WITH".

Maybe MSElang will support this version too, not yet decided.

> The Modula variant might reduce typing a bit, because the alias names can
> be shorter, but it still requires explicit qualification of each
> identifier, whereas the Pascal variant, while still stating each referred
> object instance, completely does away with qualification where the
> reference is unique and still allows for explicit resolution if conflicts
> can occur.
>
You probably know what the problem with the Pascal variant is, don't you?. 
IIRC you even wrote about it:
"
> Alternatively, you might consider to do
> away with "WITH", as some even say they consider it harmful.
"
The problem is that if there are members added to the referenced "with" 
container they override elements with the same name and type in existing 
code.

> > [...]
> >
> > > > It has the advantage that procedure and method names are aligned.
> > > > More
> > >
> > > That _might_ be a disadvantage at times, as it might make reading the
> > > source text more difficult.
> >
> > Please explain.
>
> Citing you in "<201706101259.59446.mse00...@gmail.com>":
> > "
> > proc test1(a: int32): flo64;
> > proc test2(const a: string8);
> > meth objty.test3(a: int32): flo64;
> > meth objty.test4(const a: string8);
> > meth ctest.test3(a: int32): flo64;
> > meth ctest.test4(const a: string8);
> > "
> > It has the advantage that procedure and method names are aligned. More
> > experiments are needed.
>
> It looks ugly.
> "
> You said.
>
That's not "it might make reading the source text more difficult".

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