Overriding idea.

About Monkey 2 Forums Monkey 2 Development Overriding idea.

This topic contains 1 reply, has 2 voices, and was last updated by  nerobot 2 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3617

    degac
    Participant

    Ok, time for a stupid question!

    In MX we can have overriding methods. So something like this is ok

    But, if I call like this

    it reports an error – because you need to ‘pass’ the ‘rights’ parameters (in the last line : 1.0 2.5)

    I was thinking, there’s a way to ‘force’ the compiler to use a determinate method? Maybe a special keyword like ‘Use 1’ (where’s the number refers to the method #1), or a sort of ‘Default’ keyword to makes it the preferred one.

    I know it’s redundant (it’s faster to type 1.0,2.5 ) but maybe something like

    should be implemented to ‘force’  to use this in case of misinterpretation – maybe with a ‘warning’ that a ‘conversion from INT to FLOAT to match the overriding method is done…)

    Just an idea (and maybe it’s already implemented !)

    Cheers

    #3633

    nerobot
    Participant

    Pass correct parameters (1.0,2.5) is the best way! )

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.