Add a times() method to complement <cfloop times>

Description

As per: http://blog.adamcameron.me/2015/04/lucee-5-beta-misc-1.html

Probably like this:

5.times(function(current){});

Another CFScript syntax option could be:

for (5){ // stuff here }

Although perhaps implementing ranges and then have:

for(range){ // where the range might be {{[5]}} or {{[5..5]}} to be analogous to the above // stuff here }

Activity

Show:

Zac Spitzer 15 April 2018 at 13:57

this has been implemented and can be closed?

http://docs.lucee.org/guides/lucee-5/times.html

Michael Offner 6 October 2015 at 10:07

i like the idea with both examples

+1

Adam Cameron 19 April 2015 at 14:05

Adam Cameron 19 April 2015 at 14:05

Adam Cameron 18 April 2015 at 16:18

Well: whatever the name of the argument to the callback is is is up to you, isn't it?

FWIW calling an argument `it` is really undescriptive.

And Lucee hasn't implemented `final` variables yet (go and vote: 286), so they'd need to do that before you could specify that your callback argument is final. But again: that's down do you, it's nothing to do with the `times()` method itself. But given it's your own code that you're writing in the callback, I wonder why you'd do that?

Details

Assignee

Reporter

Labels

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Priority

Created 16 April 2015 at 14:05
Updated 15 April 2018 at 13:57