Hallo Martin,

Du schriebst am Mon, 12 Jun 2017 06:55:23 +0200:

[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").

> > > object methods deserve an own token "method" because of the implicit
> > > "self" parameter.  
> >
> > This _might_ be considered a valid argument, except that _any_ method
> > _must_ always be specified in conjunction with its containing object so
> > that there shouldn't be room for uncertainty.  
> 
> A "method" combines a code address and a data pointer which is different 
> from "procedure" which is a code address only. "method" also eliminates

But a "method" cannot be defined and cannot be used by itself, there must
_always_ be an object context "around" any use of such a thing.

> from "procedure" which is a code address only. "method" also eliminates
> the need of the ugly
,,,
>  meth1: procedure (a,b: int32) of object;
...
> construct.

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.

[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?
I definitely dislike this kind. This aliasing makes reading the code much
more difficult than the Pascal version of "WITH".
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.

> [...]
> 
> > > 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.

-- 
-- 
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
-----------------------------------------------------------
Mit freundlichen Grüßen, S. Schicktanz
-----------------------------------------------------------



------------------------------------------------------------------------------
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