On Thu, Nov 21, 2013 at 3:21 AM, Martin Schreiber <[email protected]> wrote:
> On Wednesday 20 November 2013 23:01:52 Marcos Douglas wrote:
>> On Wed, Nov 20, 2013 at 1:01 PM, Martin Schreiber <[email protected]>
> wrote:
>> > Hi,
>> >
>> > '()' for procedure header and procedure calling is mandatory.
>> > "
>> > procedure noparams();
>> > begin
>> > end;
>> >
>> > procedure test();
>> > begin
>> >  noparams();
>> > end;
>> > "
>>
>> No, no, no...please!  :(
>> I know that you want to make a language more ortogonal but exceptions
>> could exist! If you do not have parameters, why I need use this '()'?
>>
> In order to show that it is a subroutine call. In FPC it is sometimes
> necessary anyway to distinguish address, value and call of procedure
> variables. Can you elaborate in more detail why you don't want to write '()'?

Just style. For me is ugly to see a procedure call like Foo(). Sorry,
I don't have a logic reason to not use this.


>> > There will be no extra reserved name for functions, functions are defined
>> > by ':' TYPE. Return values are supplied by 'return' statement. A 'return'
>> > statement before 'end;' is mandatory.
>> > "
>> > procedure func(a: bool8): int32;
>> > begin
>> >  if a then
>> >   return 123;
>> >  end;
>> >  return 458;
>> > end;
>> > "
>> >
>> > Opinions?
>>
>> I agree that not needs to exist procedure and function keywords, but
>> if one them will be excluded then "procedure" keyword is the best
>> choice.
>> The most languages uses "function" so why MSElang can't uses that keyword
>> too?
>>
> Because a 'function' always returns a value. C resolves the problem by
> the 'void' type, I don't like that approach. Oberon uses 'procedure' too.

Maybe:

a) New sintaxe for "procedure":
function func(a: bool8);
begin
  // do not need the return keyword
end;

b) New sintaxe for "function":
function func(a: bool8): int32;
begin
 // do need the return keyword
 return 123;
end;

--
Marcos Douglas

PS: Do you will continue using "begin" for procedures/functions/methods?
Maybe you need to cut in these cases too.  ;-)
Eg:
function func(a: bool8): int32;
  return 123;
end;

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to