operator overloading

View: New views
5 Messages — Rating Filter:   Alert me  

operator overloading

by horace3d@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,
op_Multiply
op_Addition
why are some operators verbs and some nouns? shouldn't this be consistent?

like op_Add and op_Multiply or op_Addition and op_Multiplication?

just curious... :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: operator overloading

by Sandeep-32 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Sun, Sep 20, 2009 at 1:08 PM, horace <horace3d@...> wrote:
hi,
op_Multiply
op_Addition
why are some operators verbs and some nouns? shouldn't this be consistent?

like op_Add and op_Multiply or op_Addition and op_Multiplication?

just curious... :)

Actually, I like the C# syntax more so it can be like,
static def operator *(x as myNum, j as int):
x.i = x.i * j
return x


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: operator overloading

by Rodrigo B. de Oliveira :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sun, Sep 20, 2009 at 4:38 AM, horace <horace3d@...> wrote:
> hi,
>
> op_Multiply
> op_Addition
>
> why are some operators verbs and some nouns?

Compatibility with C#.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: operator overloading

by horace3d@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Sun, Sep 20, 2009 at 10:43 PM, Rodrigo B. de Oliveira <rodrigobamboo@...> wrote:

On Sun, Sep 20, 2009 at 4:38 AM, horace <horace3d@...> wrote:
> hi,
>
> op_Multiply
> op_Addition
>
> why are some operators verbs and some nouns?

Compatibility with C#.


how does this affect c# compatibility? isn't the c# syntax "operator *" like in the previous example by sandeep pai?






--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: operator overloading

by Cedric Vivier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Mon, Sep 21, 2009 at 5:33 PM, horace <horace3d@...> wrote:
On Sun, Sep 20, 2009 at 10:43 PM, Rodrigo B. de Oliveira <rodrigobamboo@...> wrote:
On Sun, Sep 20, 2009 at 4:38 AM, horace <horace3d@...> wrote:
> hi,
>
> op_Multiply
> op_Addition
>
> why are some operators verbs and some nouns?

Compatibility with C#.


how does this affect c# compatibility? isn't the c# syntax "operator *" like in the previous example by sandeep pai?


Rodrigo meant CLR compatibility.
Operator overloadings are actually special name methods like op_Multiply/op_Addition in an assembly metadata.

csc/gmcs compiles the C# syntax (using the actual operator symbols) to these methods.





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Boo Programming Language" group.
To post to this group, send email to boolang@...
To unsubscribe from this group, send email to boolang+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/boolang?hl=en
-~----------~----~----~----~------~----~------~--~---