-
Notifications
You must be signed in to change notification settings - Fork 11
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
An imperative block without a return statement returns null #2
Comments
(Let me know if me answering these ever gets unhelpful) The design was that it should return null. Whilst this is a little bit annoying and slightly harms exploration, it does mean that it's less fragile to changes in the ordering of the code and makes it slightly more predictable. It's tangled to a broader issue that I now consider a mistake that DesignScript has statements at all rather than everything being an expression. Consequently if we had it return the last expression there'd be all sorts of ugly things to deal with:
Which is the 'last expression'? I think valid arguments could be made for '2', 'false' and "Meow". This all got far too messy, so we went with null. |
That sounds very reasonable. Thanks @lukechurch! |
No description provided.
The text was updated successfully, but these errors were encountered: