Stuff related to the LOLCODE language.
- Posts: 2
- Joined: Thu Oct 16, 2014 9:47 pm
» Sun Nov 16, 2014 1:19 pm
Copy pasted from the lci GitHub issue
I am sorely missing a "continue" operator, something that allows me to immediately go to the next iteration of a loop. At the moment I have to put everything in a O RLY? statement.
Here are my suggestions:
- Code: Select all
IM IN YR LOOP UPPIN YR N WILE DIFFRINT N 101
BOTH SAEM MOD OF N 10 0, O RLY?, YA RLY, NEVERMIND, OIC
BTW DO STUFF HERE WHEN N IS NOT DIVISIBLE BY 10
IM OUTTA YR LOOP
What do you think?
- Posts: 25
- Joined: Sun Apr 27, 2014 3:44 am
» Sun Nov 16, 2014 9:12 pm
I agree, this is something that definitely needs to be added to the language.
I'll let others comment on the particular syntax used, but one thing I've thought about for the continue operator in LOLCODE is whether it has C-style semantics and continues the innermost loop or whether it has Perl-style semantics and allows you to specify the loop identifier (the part from IM IN YR ___) to continue?
It seems reasonable to have the loop identifier be optional and by default continue the inner-most loop. What do you think?
Who is online
Users browsing this forum: No registered users and 1 guest