Sha256: b4d74c92a22ce7ff473a6cfb2faad0f5aef96082bad9f4b7e4388f34a9955cb9

Contents?: true

Size: 795 Bytes

Versions: 24

Compression:

Stored size: 795 Bytes

Contents

sum(nums...)
  sum = 0
  for n in nums
    sum += n

sum2(nums...)
  sum = 0
  for n in nums
    sum += n
  sum * 2

sum3(nums...)
  sum = 0
  sum += n for n in nums

body
  foo sum(1,2,3,4)
  foo sum2(1,2,3,4)
  foo sum3(1,2,3,4)

join(delim, args)
  buf = ''
  for arg, i in args
    buf += i ? delim + arg : arg

join2(delim, args)
  buf = ''
  buf += i ? delim + arg : arg for arg, i in args

body
  foo join(' ', foo bar baz)
  foo join(', ', foo bar baz)
  foo join2(' ', 1 2 3)
  foo join2(', ', 1 2 3)

body
  fonts = Impact Arial sans-serif
  for font, i in fonts
    foo i font

last-even(nums...)
  ret = n if n % 2 == 0 for n in nums
  ret

first-even(nums...)
  return n if n % 2 == 0 for n in nums

body
  foo last-even(1,3,30,5,6,12,2,24,3)
  foo first-even(1,3,30,5,6,12,2,24,3)

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
stylus-source-0.23.0 vendor/test/cases/for.function.styl
stylus-source-0.22.6 vendor/test/cases/for.function.styl
stylus-source-0.22.5 vendor/test/cases/for.function.styl
stylus-source-0.22.4 vendor/test/cases/for.function.styl
stylus-source-0.22.3 vendor/test/cases/for.function.styl
stylus-source-0.22.2 vendor/test/cases/for.function.styl
stylus-source-0.22.1 vendor/test/cases/for.function.styl
stylus-source-0.22.0 vendor/test/cases/for.function.styl
stylus-source-0.21.2 vendor/test/cases/for.function.styl
stylus-source-0.21.1 vendor/test/cases/for.function.styl
stylus-source-0.21.0 vendor/test/cases/for.function.styl
stylus-source-0.20.1 vendor/test/cases/for.function.styl
stylus-source-0.20.0 vendor/test/cases/for.function.styl
stylus-source-0.19.8 vendor/test/cases/for.function.styl
stylus-source-0.19.7 vendor/test/cases/for.function.styl
stylus-source-0.19.6 vendor/test/cases/for.function.styl
stylus-source-0.19.5 vendor/test/cases/for.function.styl
stylus-source-0.19.4 vendor/test/cases/for.function.styl
stylus-source-0.19.3 vendor/test/cases/for.function.styl
stylus-source-0.19.2 vendor/test/cases/for.function.styl