Le 09/01/2015 00:56, Lewis Balentine a écrit :
> On 01/08/2015 07:19 AM, Tobias Boege wrote:
>> Array.Sort() is a *method* :-)
>
> The basic (pun intended) elements of all OOP languages are classes
> constructed of properties and methods.
> --- you got me on that one
>
> In GAMBAS there seem to be several class methods defined that sometimes
> require parenthesis and sometimes do not. I was trying to
> determine/define the conditions that delimit when those parenthesis are
> required using familiar BASIC terms ... as in:
>       Public/Private Function  foo () as data type
>       Public/Private Sub  foo ()
> both of which I believe are appropriately considered methods in OOP
> languages.
>
> I believe my second formal computer class was MBASIC on a Osborn CPM
> computer (4 inch green screen). I am trying to recall if the term
> "Function" was defined in that language but those gray cells are no
> longer responding reliably. The other option was "Go to" that eventually
> evolved into "Public/Private Sub". At the time we called those
> "procedures".  I still call them "procedures" to distinguish them from a
> "function" that by definition is supposed to return something.
>
> Take a look at what I put in the WiKi and let me know if I should change it.
> http://gambaswiki.org/wiki/comp/gb/string[]/sort
> ... and if someone insists I will go back and change the variables to
> Hungarian notation but personally I find it more confusing than enlighting.
>
> Cheers,
>
> Lewis
>

It's simple:

You can omit the "()" at the end of function call statement only. It's a 
compiler shortcut that comes from Visual Basic.

I said "statement", not "procedure", because the interpreter makes no 
difference between a procedure (that returns nothing) and a function 
(that returns something) in the sense that it discovers that behaviour 
at runtime during the execution ; contrary to you, that knows that in 
advance.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to