-
Notifications
You must be signed in to change notification settings - Fork 48
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
Cascade implicit block hides missing do
syntax errors
#179
Comments
Also regarding the last example, it only works because
var _;
_ = require('underscore');
_ = thing.create();
_.foo();
_.map([1, 2, 3], function(it){
return it.toString();
}); |
Or maybe ditch this syntax and stick with
That's just a naming issue. You should be doing |
Using Perhaps for the minimal case of cascading when you don't need the cascadee as the result,
x$ = program = this.createProgram()
this.attachShader(x$, vertexShader));
this.attachShader(x$, fragmentShader);
this.linkProgram(x$);
if (!this.getProgramParameter(x$, LINK_STATUS)) {
throw new Error("couldn't intialize shader program!");
}
this.useProgram(x$); The need to wrap But hey, if the issues with
Maybe do LiveScript's |
The two don't merge well. Pipe returns the right hand result where cascade the cascadee (#172).
That's a no-no. We want no more cognitive overhead against JS. |
But the cascade in it's current form is essentially the statement version of the pipe:
var thing_pipe, thing_cascade;
thing_pipe = function(){
var _;
_ = thing;
return _.stuff, foo(_), bar(_, baz);
};
thing_cascade = function(){
var x$;
return (x$ = thing, x$.stuff, foo(x$), bar(x$, baz));
}; The Here's another thought: Change the cascadee and pipee to
|
Not in the next version. See the conclusion of #172.
Seems way too complicated. |
But more, or less complicated than
? It's pretty hard to say. In any case, the main issue of this bug is the tendency of the cascade's implicit block to hide missing
Do you want separate issues for these? |
Was & really the best symbol ? I thought about *, which has sense too. Else, well', there's still % or ^ or § or ... |
Only syntactically complicated.
Nope, as this proposal is resolved.
Yup, as they surely are separate.
Overused already.
|
compiles to
even though the cascadee isn't used. This hides some typos involving a missing
do
that were previously caught at compile time, such as:and even though this works when run, it hides the fact that
|>
doesn't actually accept an implicit block:Proposal: cascade blocks in which the cascadee isn't used at least once should be invalid syntax. The error message should be similar to "Unexpected INDENT on line xx:xx, did you forget a 'do' or a cascade usage?"
The text was updated successfully, but these errors were encountered: