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

size() still executes in misspelled 'setupe()' #3799

Closed
RectangleWorld opened this Issue Sep 15, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@RectangleWorld

RectangleWorld commented Sep 15, 2015

A student accidentally misspelled setup as setupe, and oddly enough the size() function within it still executed!

Here is an example:
Of course the short program

void setup() {
  size(800, 600);
  background(0xFFFF0000);
}

results in a 800x600 red window. But surprisingly,

void setupe() {
  size(800, 600);
  background(0xFFFF0000);
}

(note the misspelling) results in a 800x600 gray window!

Bug or feature, you decide. Not sure if this illustrates an issue that might create problems in another context.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Sep 15, 2015

Member

Hm, so this is causing a problem because it sees that you have no setup() method, so it assumes you're in a static mode sketch. It's a new problem caused by fixing #533, so we'd have to decide which is worse, this or that other one. (Or come up with a smarter parser...)

Member

benfry commented Sep 15, 2015

Hm, so this is causing a problem because it sees that you have no setup() method, so it assumes you're in a static mode sketch. It's a new problem caused by fixing #533, so we'd have to decide which is worse, this or that other one. (Or come up with a smarter parser...)

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Sep 17, 2015

Contributor

Took the "smarter parser" route...

Contributor

JakubValtar commented Sep 17, 2015

Took the "smarter parser" route...

@benfry benfry closed this in #3810 Sep 17, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment