Working towards new versions of the examples.

This commit is contained in:
Jeremy Ashkenas 2010-10-24 21:11:15 -04:00
parent c2da8c2d54
commit 13f6b037e2
4 changed files with 583 additions and 588 deletions

View File

@ -128,10 +128,6 @@ activity = switch day
# Semicolons can optionally be used instead of newlines.
wednesday = -> eat_breakfast(); go_to_work(); eat_dinner()
# Array slice literals.
zero_to_nine = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
three_to_six = zero_to_nine[3..6]
# Multiline strings with inner quotes.
story = "Lorem ipsum dolor \"sit\" amet, consectetuer adipiscing elit,
sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna

View File

@ -177,5 +177,5 @@ wipe_mutterings_from = (sentence) ->
while sentence.indexOf('(') >= 0
open = sentence.indexOf('(') - 1
close = sentence.indexOf(')') + 1
sentence = sentence[0..open] + sentence[close..sentence.length]
sentence = sentence.slice(0, open) + sentence.slice(close, sentence.length)
sentence

View File

@ -2,7 +2,7 @@
# 5 times: "Odelay!" print.
print "Odelay!" for [1..5]
print "Odelay!" for i from 1 to 5
# add = (x, y): x + y.
@ -166,7 +166,7 @@ while count > 0
# 1 to 5 (a):
# a string print.
print a for a in [1..5]
print a for a from 1 to 5
# if (3 ?gender):

File diff suppressed because it is too large Load Diff