|
| 28 Oct 2016 02:44 AM |
What does this loop do?
do --stuff end |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
|
| 28 Oct 2016 02:46 AM |
| limits the scope of variables |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
| |
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 28 Oct 2016 03:14 AM |
"We can delimit a block explicitly, bracketing it with the keywords do-end. These do blocks can be useful when you need finer control over the scope of one or more local variables" lua. org /pil /4.2 .html
|
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Oct 2016 03:54 AM |
It is a loop
- 𝓣𝓱𝓮𝓐𝓭𝓭𝓲𝓬𝓽𝓟𝓵𝓪𝔂𝓮𝓻 | Current RAP: R$371 | #DownWithSift |
|
|
| Report Abuse |
|
|
Cheater
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 5258 |
|
|
| 28 Oct 2016 03:58 AM |
| It is not a loop indeed but I'd say we call this a block? As the first guy already wrote, it limits the scope of variables. |
|
|
| Report Abuse |
|
|
|
| 28 Oct 2016 04:42 AM |
| So it's not a loop but it's a block that doesn't really do anything and allows you to store local variables inside it? |
|
|
| Report Abuse |
|
|
Cheater
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 5258 |
|
|
| 31 Oct 2016 07:26 AM |
| Basically you can create variables in there, that are only available in that block. Once that block reaches the end, the variables are gone. Probably for some performance measures helpful. |
|
|
| Report Abuse |
|
|