Procedural Programming Just Like C (with pointers)

About Monkey 2 Forums Monkey 2 Code Library Procedural Programming Just Like C (with pointers)

This topic contains 0 replies, has 1 voice, and was last updated by  cocon 1 month, 1 week ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #15578

    cocon
    Participant

    Some notes on programming with pointers in Monkey. In some cases where you want to send an object to a function and change it. However there are some reasons of why this not happens out of the box. Structs are passed by value which means that the object is copied each time is sent to a function. Classes are a little bit different because they are sent as references which means that changes can be made, however the object itself can’t be allocated (which makes them not pure references but copy to references actually).

    Jumping straight to example.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.