-
-
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
while loop #2189
Comments
Could you show a use case? I guess a JS plugin would be better suited for this task. |
I will admit I'm pushing CSS to the limits here, but I'm attempting to make it easier for designers to use e.g. spring animations in CSS using keyframe animations. I've written up the math and a JS version here: https://medium.com/analytic-animations/the-spring-factory-4c3d988e7129#.d3xdphwx0 I'm not confident that stylus needs a while loop as I'm a bit of an edge case, but I figured I'd show you guys a use case that maybe you hadn't seen. In Listing 1 below, I use an anonymous function, I could go and rewrite that part again, it's only laziness that's holding me back, but a while loop in this case helps prevent laziness from winning. ;) In Listing 2, you can see a prototype (it's not fully designed yet) of how someone might use the output of my spring function. Listing 3 shows sample output. There might be a few bugs still in the code, but I think it should be illustrative. Thank you for your consideration. :)
Here's a gist of the full thing: https://gist.github.com/william-silversmith/8e9b89a0eaad9d168bb9343b1f13df19 |
so its been two years and this issue is still open? WOW! |
Feature Request
I was attempting to write some numerical code, and looping until a condition is met is a typical thing to do for that sort of thing. I can accomplish the same thing with recursion, but the number of parameters I have to pass back and forth is icky.
I guess having a while loop means that stylus won't necessarily ever halt, which might not be so good for people that aren't developers, but you can still do that with recursion (though it halts by blowing up the stack ;) ).
The text was updated successfully, but these errors were encountered: