On Sunday 11 June 2017 02:36:46 Sieghard wrote: > Hallo Martin, > > Du schriebst am Sat, 10 Jun 2017 06:54:15 +0200: > > I don't like "sub" much but found nothing better up to now. I think that > > "sub" seems to me to imply you're about to create a new BASIC variant. > Why not use "function" for all such things, if you don't like to > explicitely state that some won't return a value. Looks like C then, > but Delphi and fpc allow for discarding a return value already anyway. > The separate names of Wirth's Pascal _did_ have a reason, and that was to > discern between real functions, which ought to _only_ calculate something > and return the result of the calculation, like a mathematical function > does, and a multiply used sequence of commands that produce a "side > effect", something the programm doesn't really need internally, but that > provides "useful" information for its environment (e.g. the user). > Considering the implementation of "VAR" parameters, i.e. parameters that > can transport a value from within a procedure to its program surroundings, > this difference has been blurred quite a lot by careless use(ers). > "function" in C always has a type identifier. As you write, a mathematical function returns something. So "procedure" like in Wirth's Modula2.
> > 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 the need of the ugly " var meth1: procedure (a,b: int32) of object; " construct. > You might argue with "WITH" > here, but even that is strictly defined in Pascal as to imply the scope of > the referenced object as the outermost one, and therefore has to be used > in case of multiple candidates. Alternatively, you might consider to do > away with "WITH", as some even say they consider it harmful. You should > remember, though, that this may mean a lot more typing (all those > qualifiers that are otherwise implied). > MSElang provides a safe "with" statement with mandatory local qualifier. [...] > > 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. 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