forloop
Two very simple for-loop macros for crystal.
Installation
-
Add the dependency to your
shard.yml
:dependencies: forloop: github: iainmon/forloop.cr
-
Run
shards install
Usage
require "forloop"
# Regular for loop
for x = 0, x < 5, x += 1 do
puts x
end
# For-in loop
for x in 1..5 do
puts x
end
Contributing
- Fork it (https://github.com/iainmon/forloop.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Iain Moncrief - creator and maintainer