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

Returning mathematical or logical expressions is not supported? #66

Open
ghost opened this issue Aug 14, 2020 · 1 comment
Open

Returning mathematical or logical expressions is not supported? #66

ghost opened this issue Aug 14, 2020 · 1 comment
Labels
feature request New feature or request question Further information is requested

Comments

@ghost
Copy link

ghost commented Aug 14, 2020

@mertyildiran @melihs
Is return broken?

num def sum(num x, num y)
        return x + y
end

error:

Syntax error:                                                           
    Module: /Users/lewek/Desktop/chaos-master/__interactive__.kaos     
    Line: 1                                                               
    Cause: + 

Maybe I should make:

num def sum(num x, num y)
        num z = x + y
        return z
end
@mertyildiran
Copy link
Member

@lewek I've implemented return chaining(see) in such a way that; you need to return a variable name rather than a mathematical expression or a logical expression. Because of that, your first example is not supported in the grammar. Though it's probably my fault to not implement it in a better way. Maybe you would like to reimplement that part with covering cases like this?

@mertyildiran mertyildiran added feature request New feature or request question Further information is requested labels Aug 14, 2020
@mertyildiran mertyildiran changed the title [Bug] return bug Returning mathematical or logical expressions is not supported? Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant