-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Out of order var declaration doesn't work with complex expressions #1085
Comments
it should not work at all, imho. |
I'm suppose that you should declare variables before using them (like in other popular languages). |
This doesn't make any sense. Why would that be allowed? |
I guess, it's somewhat late to fix the current behavior (while someone could find it useful and it could break things for those), but it could be fixed (== the second example shouldn't work too) in 1.0 to make things more consistent and more logical. |
Thank you. |
Bootstrap not making sense certainly is sad, but not worth creating bad behaviors in a language |
Stylus is a declarative language. Not imperative. So, order of declarations within the same flat scope should not matter. Because we exile the notion of order of execution. It appears natural and obvious to me. My 50 cent of example to this discussion:
-- Works.
-- cannot coerce null to unit Kindly do consider considering this syntax correct. |
The following snippet:
results in
while
compiles well (note the plain
a = b
instead ofa = b * 2
in the first snippet).The text was updated successfully, but these errors were encountered: