Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUESTION: has gravity support to pass arguments by value or ref? #296

Closed
PaTiToMaSteR opened this issue Jun 10, 2020 · 1 comment
Closed

Comments

@PaTiToMaSteR
Copy link

Hi there gravity community.

I'm not sure if:

  • From C++ I can bind references or pointers, how are those managed in gravity script? Are wrapped objects?
  • Writing gravity scripts, are all pass by value? or references? I know you have a garbage collector but I'm not sure is suppose all are ref counted objects

So basically from C/C++ <-> Gravity, by value or reference/deference?

Thanks!

@marcobambini
Copy link
Owner

marcobambini commented Jun 10, 2020

Hi @PaTiToMaSteR,
between C++ and Gravity all objects are passed by reference.

You can find a complete cpp example in the examples folder:
https://github.com/marcobambini/gravity/blob/master/examples/GravityCpp/GravityCpp/main.cpp

P.S. there is a preliminary support for the Struct keyword so I plan to add support for pass by value types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants