Bug or not for struct Extension

About Monkey 2 Forums Monkey 2 Development Bug or not for struct Extension

Tagged: 

This topic contains 6 replies, has 2 voices, and was last updated by  gcmartijn 2 years, 7 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #3881

    gcmartijn
    Participant

    Using this for example

    Output

    Vec2(3,4)
    Self.X 3
    Self.X 3
    _x 10
    Self.X 10
    Self.X 10
    Vec2(10,10)
    3 < wrong ?
    3 < wrong ?
    Vec2(3,4) < wrong ?

    Or is it oke because its a struct and I need to return not Self but a new Vec2f() ?

    And what is the best thing to use in all the programs:
    The vec2f.X or vec2f.x (property or field) they are both the ‘same’

    #3882

    Mark Sibly
    Keymaster

    Ok, it turns out you can’t currently write to a struct via an extension method.

    I’ll have a look into possibly allowing this later, but for now I’ve added an error message when you attempt to do this.

    #3883

    Mark Sibly
    Keymaster

    Fixed! Needs more testing but I think it’s doable – take that c#!

    #3887

    gcmartijn
    Participant

    cool, then a new module for the community is on the way.

    #3906

    gcmartijn
    Participant

    Downloaded the latest version, but its still give the wrong Return Self back.

    The output is the same.

    What I expect was

    Vec2(3,4)
    Self.X 3
    Self.X 3
    _x 10
    Self.X 10
    Self.X 10
    Vec2(10,10)
    3 < wrong ?  >>> 10
    3 < wrong ?  >>> 10
    Vec2(3,4) < wrong ? >>> Vec2(10,10)

    #3910

    Mark Sibly
    Keymaster

    It’s working here as long as I ‘./updatemx2cc.sh’ and ‘./rebuildall.sh’ after that.

    Perhaps best to wait until the next binaries update – I’ll do one today.

    #3915

    gcmartijn
    Participant

    oke, works here now.
    I din’t know that ‘updatemx2cc.sh’ did something more then ‘rebuildall.sh’

    What I do is not using git, but
    1. delete the whole monkey directory.
    2. download the git zipfile
    3. run rebuildall.sh

    but as I can see now, updatemx2cc.sh does the trick and does something more.

    And about my other question, I a other topic someone said that using a Field is faster than accessing a Property. With that in mind I will use fields first and then property’s.

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

You must be logged in to reply to this topic.