## September 20, 2013

### For Versus Repeat

I have been teaching my 5-year-old to draw pictures with turtlebits, and I have concluded that the `for` statement is too difficult to teach as the first looping construct at that age. It would be fine as a second construct.

For example, he wrote this:

`play 'abcdefg'`

And he came to me saying "Dad, help me make it repeat 10 times." I told him to try to figure out a `for` statement to do that, but he could not figure it out. In CoffeeScript, the shortest way to do it would have been

```for p in [1..10]
play 'abcdefg'
```

But after we typed that, he clearly didn't understand what `p` was for. It is an unnecessary variable, and it is not the way you actually think about what is going on. It also has the disadvantage that the whole looping construct involves four pieces of punctuation: two brackets and two dots.

We can eliminate the p and reduce it to three pieces of punctuation if we define a 'repeat' function:

```repeat 10, ->
play 'abcdefg'
```

However, in the ideal world, `repeat` would just be a keyword in the language and he could write, punctuation-free:

```repeat 10
play 'abcdefg'
```

I am thinking that maybe a a couple of these types of pedagogical insights should be accumulated into a fork of Iced Coffeescript. Anybody interested in helping me build a Coffeescript variant?

Posted by David at September 20, 2013 08:32 AM

You can envision having the repeat syntax:
. repeat 10
.. play 'abcdefg'
evolve later to:
. repeat 10 with index
.. play 'abcdefg' + index

Posted by: Cezar at September 20, 2013 11:42 AM

(Iced)CoffeeScript supports this index-less variant of the for-loop:

for [1..10] then play 'abcdefg'

Posted by: Marc at November 29, 2013 04:16 AM

Whoa, thanks for pointing that out Marc!

That's a bit easier.

Posted by: David at November 29, 2013 10:02 AM

http://www.redbottomshoesforwomen.us.com/
http://www.ultra-boost.us.com/
http://www.kd10.com.co/
http://www.birkenstock-shoes.us.com/
http://www.timberlandbootsshoes.us.com/
http://www.pandoracharm-jewelry.us.com/
http://www.pandora-outlets.us/
http://www.nike-cortez.org/
http://www.kyrie-irvingshoes.us.com/
http://www.christianlouboutinshoesdiscount.us.com/
http://www.pandora--jewelry.us.com/
http://www.yeezybeluga.us.com/
http://www.longchampshandbags.us.com/
http://www.birkenstockoutletsale.us.com/
http://www.jordans11.us.com/
http://www.monclerukoutllet.org.uk/
http://www.ralphlauren-outlet-online.us.com/
http://www.jamesharden-shoes.us.com/
http://www.longchampcom.us.com/
http://www.curry-shoes.us.com/
http://www.huarachesnike.us.com/
http://www.nike--shoes.us.com/
http://www.vanscom.us.com/
http://www.yeezy.us.org/
http://www.northfaceoutletoff.us.com/
http://www.clarks-shoes.org/
http://www.coachoutletfactorys.us.com/
http://www.nike-vapormax.us.com/
http://www.skechersuk.org.uk/
http://www.pandorascharms.us.com/
http://www.pandoras.us.com/
http://www.coachoutletonlinehandbags.us.com/
http://www.airmax-95.us.com/
http://www.northfacesjackets.us.com/
http://www.air-jordans11.us.com/
http://www.pandorasjewelry.us.com/
http://www.kyrie4.com.co/
http://www.kd-shoes.us.com/
http://www.ralphlaurenoutlet-store.us.com/
http://www.kyrieirving-shoes.com/
http://www.yeezysboost-350.us.com/
http://www.pandorainc.us.com/
http://www.goyards.us.com/
http://www.christianlouboutininc.us.com/
http://www.airmaxs.us.com/
http://www.red-bottomsshoes.us.com/
http://www.jimmychoooutletshoes.us.com/
http://www.ralphlaurenoutletpoloonline.us.com/
http://www.lebron-15.us/
http://www.rihannafentypuma.us.com/
http://www.officialpandorajewelry.us.com/
http://www.jordanretro-11.us.com/
http://www.nike--outlet.us.com/
http://www.lebron-shoes.us.com/
http://www.new-jordans.us.com/
http://www.kd10shoes.us.com/
http://www.yeezysboost350v2.us.com/
http://www.jordan11space-jam.us/
http://www.christianlouboutinshoesinc.us.com/
http://www.yeezys-shoes.us.com/
http://www.poloralphlaurenoutlet-store.us.com/
http://www.timberlandbootsofficial.us.com/
http://www.ralph--lauren.us.com/
http://www.nikeairforce1.com.co/
http://www.nike-uptempo.com/
http://www.monclers.org.uk/
http://www.curry-4.us.com/
http://www.jordan11red.us.com/
http://www.puma--shoes.us.com/
http://www.coachoutlet-official.us.com/
http://www.air-maxfr.fr/
http://www.pandorabraceletjewelry.us.com/
http://www.pandoraringsofficial.us.com/
http://www.jameshardenshoes.com.co/
http://www.soccercleats.us.com/
http://www.louboutinshoesheels.us.com/
http://www.air-max90.us.com/
http://www.pandorarings.us.com/
http://www.louboutinsshoes.us.com/
http://www.yeezy350v2boost.us/
http://www.yeezys.com.co/
http://www.pandorajewelryoff.us.com/
http://www.nikeairvapormax.us.com/
http://www.pandorajewelryofficialsite.us.com/
http://www.nikeairmax2018.us/
http://www.yeezybluetint.us/
http://www.kyrie3.com.co/
http://www.birkenstocks-sandals.us.com/
http://www.vansoutlet-store.us.com/
http://www.kyrie3shoes.us.com/
http://www.birkenstockcom.us.com/
http://www.lebron15.com.co/
http://www.airmax90chaussure.fr/
http://www.longchampoutletsale.us.com/
http://www.nikeoutlet--store.us.com/
http://www.nike-airmax2018.us.com/
http://www.nmd.us.com/

Posted by: Lisa at November 20, 2018 02:34 AM

http://www.christian-louboutinshoesuk.org.uk/
http://www.redbottomslouboutin.us.org/
http://www.pandorajewelry-officialsite.us.com/
http://www.jordan14.us.com/
http://www.nike-sneakers.us.com/
http://www.yeezys-shoes.us.com/
http://www.goyardsbags.us.com/
http://www.pandora-charmsoutlet.us.org/
http://www.monclerofficial.us.com/
http://www.jordan11space-jam.us/
http://www.pandorasjewelry.us.com/
http://www.nikeshoes-formen.us/
http://www.skecherscom.us.com/
http://www.nikefactory-store.us.com/
http://www.nikeshoes-cheap.us.com/
http://www.fjallraven-kanken.us.com/
http://www.ferragamos.us.org/
http://www.jordan11low.us.com/
http://www.airmax-95.us.com/
http://www.pandoracom.us/
http://www.nike-cortez.org/
http://www.nikevapor-max.us.com/
http://www.airforce-1.us.com/
http://www.fitflop-saleclearance.us.com/
http://www.balenciagas.us.org/
http://www.nikeairforce1.com.co/
http://www.redbottomshoesforwomen.us.com/
http://www.northfaceoutletoff.us.com/
http://www.pandoraa.us.com/
http://www.yeezy.us.org/
http://www.bottegaveneta-handbags.us.com/
http://www.outletnikestore.us.com/
http://www.pandorabracelet-clearance.us.com/
http://www.valentinosshoes.us.org/
http://www.birkenstockoutletsale.us.com/
http://www.jewelrypandora.us.org/
http://www.yeezys-boost.us.org/
http://www.nikesoutlet.us.com/
http://www.yeezys.com.co/
http://www.christianlouboutininc.us.com/
http://www.mbt-shoes.us.org/
http://www.pandoracharmsbracelets.us.com/
http://www.nikeoutletstoresonlineshopping.us.com/
http://www.airmax270.us.org/
http://www.pandora-braceletcharms.us/
http://www.air-jordans11.us.com/
http://www.vapormax-plus.us.com/
http://www.balenciagaofficial.us.com/
http://www.lebron15.com.co/
http://www.curry-shoes.us.com/
http://www.airjordan11s.us.com/
http://www.moncler-outlets.org.uk/
http://www.kyrieirving-shoes.us.org/
http://www.fitflopsaleclearances.us.com/
http://www.yeezys-shoes.us.org/
http://www.louboutinsshoes.us.com/
http://www.monclers.org.uk/
http://www.jordan11red.us.com/
http://www.airmaxs.us.com/
http://www.rihannafentypuma.us.com/
http://www.retro-jordans.us/
http://www.air-maxfr.fr/
http://www.nike--shoes.us.com/
http://www.officialpandorajewelry.us.com/
http://www.pandora-bracelet.us.org/
http://www.airforceoneshoes.us.com/
http://www.jordans-sneakers.us.com/
http://www.pandorascharms.us.com/
http://www.jameshardenshoes.com.co/
http://www.jimmychoooutletshoes.us.com/
http://www.nikeoutlet--store.us.com/
http://www.shoeslouboutin.us.com/
http://www.pandorajewelrybracelets.us.com/
http://www.pandora-online.us.com/
http://www.northfacesjackets.us.com/
http://www.fitflopsclearance.us.com/
http://www.pandorajewelryoff.us.com/
http://www.nikeoutletsonline.us.com/
http://www.pandoraringssite.us/
http://www.puma--shoes.us.com/
http://www.ralphlauren-outlet-online.us.com/
http://www.nike-presto.us/
http://www.jordan9.us.com/
http://www.monclersjackets.us.com/
http://www.yeezysboost350v2.us.com/
http://www.jordans11.us.com/
http://www.nikeairmaxs-270.us.com/
http://www.christianlouboutinshoesinc.us.com/
http://www.pandoras-outlet.us.com/
http://www.nikeclearances.us.com/
http://www.roshenike.us.com/
http://www.nikeclearancestores.us.com/
http://www.pandorascharms.us.org/
http://www.jordan-4.us.com/
http://www.moncleroutlet-jackets.us.com/
http://www.birkin-bag.us.com/
http://www.fitflop-shoes.us.org/
http://www.goyardshandbags.us.com/
http://www.pandorajewelrycz.us.com/
http://www.kd-shoes.us.com/
http://www.kyrieirving-shoes.com/
http://www.birkenstocks-sandals.us.com/
http://www.birkenstocks-outletonline.us.com/
http://www.moncleroutletstoreonline.us.com/
http://www.nikeairmax2018.us/
http://www.pandoraoutletjewelry.us.org/
http://www.jordan-8.us/
http://www.isabel-marant.us.com/
http://www.air-maxplus.us/
http://www.kyrie-irvingshoes.us.com/
http://www.airjordansneakers.us.com/
http://www.louboutinshoes-uk.org.uk/
http://www.red-bottomsshoes.us.com/
http://www.pandoraringsofficial.us.com/
http://www.nikeroshe-run.us.com/
http://www.soccercleats.us.com/
http://www.pandorainc.us.com/
http://www.nikeairmax98.us/
http://www.ralph-laurenpolos.us.com/
http://www.yeezy-sneakers.us.com/
http://www.nike--outlet.us.com/
http://www.longchampoutlet-online.us.com/
http://www.jamesharden-shoes.us.org/
http://www.pandoras.us.com/
http://www.nike-shoxs.us/
http://www.nikeoutletsale.us.com/
http://www.airmax270flyknit.us/
http://www.timberlandbootsofficial.us.com/
http://www.pandora--jewelry.us.com/
http://www.new-jordans.us.com/
http://www.pandoraofficialsite.us.com/
http://www.nike-epicreact.us.com/
http://www.pandorajewelrycharms.us.org/
http://www.newjordansshoes.us.com/
http://www.huarachesnike.us.com/
http://www.airjordanretro11.us.com/
http://www.ralph--lauren.us.com/
http://www.jordanretros.us.com/
http://www.moncler-outletjackets.us.com/
http://www.pandorascharm.us.org/
http://www.ultra-boost.us.com/
http://www.jordan10.us.com/
http://www.pandora-jewelry-charms.us.com/
http://www.birkenstock-sandals.us.org/
http://www.pandoras-jewelry.ca/
http://www.burberryshandbags.us.com/
http://www.christianlouboutin-outlets.us.com/
http://www.birkenstock-shoes.us.com/
http://www.pandorajewellery.us.com/
http://www.birkenstock-shoes.us/
http://www.ukair-max.org.uk/
http://www.pandoras.us.org/
http://www.jamesharden-shoes.us.com/
http://www.ralphlaurenoutletpoloonline.us.com/
http://www.nikeairmax270s.us.com/
http://www.pandoracharmsjewelry.us.org/
http://www.nike-vapormax.us.com/
http://www.pandora-jewelryofficialsite.us.com/
http://www.ecco-shoes.us.com/
http://www.pandorajewelrywebsite.us.com/
http://www.redbottomshoeslouboutin.us.com/
http://www.eccos.us.com/
http://www.timberlands-outlet.us.com/
http://www.lebron-shoes.us.com/
http://www.jordanshoess.us.com/
http://www.pandorasjewelry.ca/
http://www.nikeshoesforwomens.us/
http://www.skechers.us.com/
http://www.nmdxr1.us/
http://www.nikeairjordan.us.com/
http://www.pandoraonline.us/
http://www.christianlouboutin-heels.us.com/
http://www.pandorajewelryofficialsite.us.com/
http://www.balenciagatriples.us.org/
http://www.nike-roshes.us/
http://www.monclerukoutllet.org.uk/
http://www.ralph-laurenukoutlet.org.uk/
http://www.air-max90.us.com/
http://www.ralphlaurenoutlet-store.us.com/
http://www.pandoraoutlet-charms.us.com/
http://www.nike-uptempo.com/
http://www.nikeairvapormax.us.com/
http://www.curry5.us.org/
http://www.yeezyonline.us.com/
http://www.pandoracharmsjewelrys.us.com/
http://www.ferragamo-belts.us.com/
http://www.louboutinshoesheels.us.com/
http://www.disneypandoracharms.us/
http://www.pandorabraceletjewelry.us.com/
http://www.pandoracharms-clearance.us.com/
http://www.balenciagassneakers.us.com/
http://www.nmd.us.com/
http://www.christianlouboutinshoesdiscount.us.com/
http://www.shoes-jordan.us.com/
http://www.lebron-15.us/
http://www.outletbirkenstock.us.com/
http://www.christian-louboutinsshoes.us.com/
http://www.edhardys.us.com/
http://www.jordan11winlike96.us/
http://www.pandorashop.us.com/
http://www.kyrie4.com.co/
http://www.yeezysboost-350.us.com/
http://www.nike-airvapormaxflyknit.us/
http://www.vans-shoes.us/
http://www.pandoracharm-jewelry.us.com/
http://www.pandora-outlets.us/
http://www.poloralphlaurenoutlet-store.us.com/
http://www.jordan-shoesformen.us.com/
http://www.nikeair-maxs.us.com/
http://www.valentinooutletshoes.us.com/
http://www.pandorajewelryofficial-site.us.com/
http://www.nike-airmax2018.us.com/
http://www.longchampcom.us.com/
http://www.kyrie4.us.org/
http://www.vanscom.us.com/
http://www.timberlandbootsshoes.us.com/
http://www.pandorabracelets.us.com/
http://www.birkenstocksandalsoutlet.us.com/
http://www.nikeoutletsfactory.us.com/
http://www.nmds.us.com/
http://www.monclerjacket.us.org/
http://www.nikeairforce1.us.org/
http://www.jordanretro-11.us.com/
http://www.jordan-12.us.com/
http://www.pandorajewelry-outlets.us.com/
http://www.pandorarings.us.com/
http://www.goyards.us.com/
http://www.ferragamo-outlets.us/
http://www.jordanshoesretro.us.com/
http://www.birkenstockcom.us.com/
http://www.longchampshandbags.us.com/
http://www.nikeairmax-shoes.us.com/
http://www.fitflop-outlet.us.com/
http://www.christianlouboutinsshoes.us.com/
http://www.pandorajewelryofficial-site.us/
http://www.monclers.me.uk/
http://www.sandalsfitflop.us.com/
http://www.kankenbackpacks.us/

Posted by: Lisa at January 29, 2019 11:56 PM