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

new Object #12

Closed
huynhminhson opened this issue Jan 3, 2014 · 2 comments
Closed

new Object #12

huynhminhson opened this issue Jan 3, 2014 · 2 comments
Assignees
Labels

Comments

@huynhminhson
Copy link

I have an issue as creating new object. Please help.

Obj = new Data
Fatal error: Uncaught exception 'Exception' with message 'Unable to parse input: given input is no T_EXPRESSIONS:
@ghost ghost assigned AndCake Jan 3, 2014
@AndCake
Copy link
Owner

AndCake commented Jan 3, 2014

Please try using the brackets for instanciation. The Snow language can do three different ways of calling functions:

do myfunc
myfunc()
myfunc params

In case of using the new keyword to create an instance you cannot use the do (due to the new being there instead). Since you have no parameters to pass over, you cannot use the version without brackets, so the only option left is to use

obj = new Data()

Hope this helps.

@huynhminhson
Copy link
Author

Thank you very much for the explanation :)

@AndCake AndCake closed this as completed Jan 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants