[Gambas-user] Suggestions 4 new keywords

Fabián Flores Vadell fabianfloresvadell at ...626...
Fri Sep 17 14:41:16 CEST 2010


2010/9/17 Rolf-Werner Eilert <eilert-sprachen at ...221...>:
> I think this could lead to misunderstanding if you keep the BASIC
> concept of "free" indention:
>
>> But if you want less keywords, you can do:
>>
>> PUBLIC '(a.k.a. Interface)
>>    Age AS Byte
>>
>>    setAge(Value AS Byte)
>>      IF Value>= MinAge AND Value<= MaxAge THEN Age = Value
>>    END
>>
>> Because, I think than, a method (procedure or function) is defined by
>> its signature, not by the prefix keywords FUNCTION, PROCEDURE or SUB.
>>
>> May be, you want to do optionals these keywords.
>>
>
> I can understand what you mean, but it's true what was said here
> earlier: Just imagine a few hundred codelines instead of these 3 in your
> example - at the end of the procedure (where your END stands) you maybe
> wouldn't know by heart if there was a PUBLIC somewhere or whatever.

Ok, you can put a END (or whatever) keyword to close the initial
PUBLIC. But, I think that the PUBLIC keyword ends when the PRIVATE
keyword appears or at the end line, and PRIVATE ends at the end line.
Anyway, if a class have a few hundred of lines, possibily the problem
is a bad modularizing.

> If you want to get rid of the "bracketing" the keyword SUB does, you
> should either provide an intelligent editor which presents this piece of
> code as one piece (some color or whatever), or you come to a concept of
> indention like - what was it, Ruby?

I'm not proposing that Gambas imitate to Haskell/Python on using
indentation to delimit structures.

> But if you really want to get rid of something useless, why not change
> SELECT CASE into SELECT? I don't know the history of this keyword, but
> it smells like it was planned to allow for further combinations.
> However, nobody ever implemented them, and it stayed as it was. If we
> don't revive the old idea, why not allowing the programmer to write it
> like SWITCH? You could make it an option:
>
> SELECT myExpression
> CASE 0
> CASE 1
> CASE 2,3
> CASE ELSE
> END SELECT
>
> Regards
>
> Rolf

I agree. But I think that is less important, because not have a major impact.

-- 
Fabián Flores Vadell
www.speedbooksargentina.blogspot.com




More information about the User mailing list