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

Peculiar treatment of statements within parentheses #93

Closed
meijeru opened this issue Jun 13, 2011 · 3 comments
Closed

Peculiar treatment of statements within parentheses #93

meijeru opened this issue Jun 13, 2011 · 3 comments
Labels
status.built A change in codebase has been done to address the ticket. status.tested The change in code has been manually tested and verified to fix the issue.

Comments

@meijeru
Copy link
Contributor

meijeru commented Jun 13, 2011

One is not supposed to put statements within parentheses. Still, I tried the following (printf == print form)

s: 1 (printf s) ; OK compiles and runs as if () were not there
(s: 1) printf s ; idem
(s: 1 printf s) ; "undefined symbol s"
s: 1 (s: s + 1 printf s) ; prints 1, not 2

It looks like only the last of a series of statements and expressions within parenthesis is executed. The others are ignored without warning.

@dockimbel
Copy link
Member

Now parentheses are limited to one expression only, more will raise a compilation error. The purpose of parentheses is to mark execution priority in expressions. This behaviour needs to be documented in the upcoming "Expressions" section of the specification.

I am leaving the issue open until the specification is updated.

@meijeru
Copy link
Contributor Author

meijeru commented Jun 14, 2011

The fix is not complete: the following compiles OK while I think it should not

i: 1 (i: i + 1) printf i ; result is 2

dockimbel added a commit that referenced this issue Jun 18, 2011
@dockimbel
Copy link
Member

Tested OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status.built A change in codebase has been done to address the ticket. status.tested The change in code has been manually tested and verified to fix the issue.
Projects
None yet
Development

No branches or pull requests

2 participants