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

Is it legal to modify the value of parameters passed to a function #42

Closed
brice-morin opened this issue Mar 6, 2014 · 0 comments
Closed

Comments

@brice-morin
Copy link
Collaborator

We have a test:

 function sendInt(i : Int16) do
        var hundreds : Int8 = i / 100
        i = i - (100 * hundreds)
        var tens : Int8 = i / 10
        i = i - (10 * tens)
        harness!testOut( intToChar(hundreds) )
        harness!testOut( intToChar(tens) )
        harness!testOut( intToChar(i) )
    end

It seems that ThingML allows i to be modified. But It seems the Scala compiler assumes i cannot be modified, where the C compiler allows it.

Should it really be legal in ThingML? Or is it a but in the Scala compiler?

@brice-morin brice-morin added this to the ThingML v1 milestone Mar 6, 2014
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