• Overview
    • euler
    • false
    • null
    • pi
    • true
    • Overview
    • break
    • c_for
    • call
    • continue
    • exit
    • for
    • if
    • import
    • loop
    • outer
    • return
    • then
    • throw
    • try
    • while
    • Overview
    • - difference()
    • != unique()
    • * product()
    • / quotient()
    • && and()
    • %
    • ^
    • + sum()
    • < increasing()
    • <= nondecreasing()
    • == equal()
    • > decreasing()
    • >= nonincreasing()
    • || or()
    • bitwise_and()
    • bitwise_arithmetic_shift_right()
    • bitwise_not()
    • bitwise_or()
    • bitwise_popcount()
    • bitwise_roll_left()
    • bitwise_roll_right()
    • bitwise_shift_left()
    • bitwise_shift_right()
    • bitwise_xor()
    • double_to_long_bits()
    • long_to_double_bits()
    • Overview
    • Bool
    • List
    • Map
    • Number
    • String
  1. Scarpet
  2. Syntax
  3. Control Flow
  4. c_for

c_for

View on GitHub

Syntax

c_for(init, condition, increment, body)

Mimics a C-Style for loop for (init; condition; increment) { body }

for (int i = 0; i < 5; i += 1) {
    printf("%d\n", i);
}
c_for(i = 0, i < 5, i += 1, print(i));

Found a problem with this page?

  • View the source on GitHub
  • Edit this page on GitHub