Permalink
...
Comparing changes
Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
jashkenas/coffeescript
CDR2003/coffee-script-lua
CreamCoderz/coffee-script
Crylock/coffee-script
GeoffreyBooth/coffeescript
Gregg/coffee-script
JulianBirch/coffee-script-1
JustinTulloss/coffee-script
LittleForker/coffee-script
MichaelBlume/coffee-script
NightMigera/coffeescript
PandaWood/coffee-script
ProximaMonkey/coffee-script
Remcoman/coffee-script
RicardoSaracino/coffee-script
SE7ENSKY/matescript
STRd6/coffee-script
StanAngeloff/coffee-script
Xepo/coffee-script
abi/coffee-script
agnoster/coffee-script
ahjohannessen/coffee-script
akiellor/coffee-script
alanning/coffee-script
allanberger/coffee-script
almost/coffee-script
alubbe/coffee-script
andrehjr/coffee-script
andrewschaaf/coffee-script
andreypopp/coffee-script
apanda/coffee-script
baoshitang/coffee-script
barberboy/coffee-script
benatkin/coffee-script
benbria/coffee-script
benekastah/coffee-script
bjouhier/coffee-script
blahutka/coffee-script
blossom/coffee-script
bolinfest/coffee-script
breckinloggins/coffee-script
carmelyne/contracts.coffee
chajath/coffee-script
charliesome/coffee-script
chetan51/coffee-script
chip/coffee-script
codelahoma/coffee-script
coffee-js/coffee-script
coffee-void/coffeescript
danemorgridge/coffee-script
daveclarke/coffee-script
daveyoon/coffee-script
dbrans/coffee-script
deadprogram/coffee-script
devongovett/coffee-script
dget/coffee-script
disnet/contracts.coffee
dmohl/coffee-script
dohse/coffee-script
dpritchett/coffee-script
dqminh/coffee-script
drewlesueur/coffee-script
emmalemma/coffee-script
eventualbuddha/coffee-script
evilpie/coffee-script
excellentdrums/coffee-script
fitzgen/coffee-script
fizx/coffee-script
geraldalewis/coffee-script
germanocaldeira/coffee-script
gfodor/coffee-script
ghuntley/coffee-script
goodwink/coffee-script
gxela/coffee-script
hayeah/coffee-script
hbt/coffee-script
helixbass/copheescript
hleumas/coffee-script
holmsand/coffee-script
holtwick/moccacino
hugs/coffee-script
ianthehenry/protoscript
ich/caffeine
janlelis/angular-coffee-script
jaredwy/coffee-script
jasonyandell/coffee-script
jawj/coffee-script
jbca/coffeescript
jiangmiao/toffee-script
jlstr/coffee-script
joelturnbull/coffee-script
johnsang/coffee-script
joliss/coffee-script
jondistad/coffee-script
joshprice/coffee-script
jstrachan/coffee-script
jugglinmike/irene-script
juilyoon/coffee-script
jwalgran/coffee-script
keichii/coffee-script
keithnorm/coffee-script
kewinwang/coffee-script
khaled/coffee-script
kiddphunk/coffee-script
leeight/coffee-script
lfendy/coffee-script
loganfsmyth/coffee-script
loopinfinito/coffeescript.com.br
lorensr/coffee-script
loveencounterflow/coffy-script
lukhnos/doubleshot
lynaghk/coffee-script
martco/coffee-script
maxtaco/coffee-script
mbbx6spp/coffee-script
mblinn/coffee-script
mehmeta/coffee-script
melcher/coffee-script
mental/coffee-script
mhart/coffee-script
michaelficarra/coffee-script
misfo/coffee-script
mizchi/coffee-script
mlinderm/coffee-script
mrlauer/coffee-script-monads
muratmeran/coffee-script
myang/coffee-script
nanqiu/coffee-script
neobine/coffee-script
netconstructor/coffee-script
nihar/coffee-script
onilabs/coffee-script
paiq/blackcoffee
parkerl/coffee-script
paulmars/coffee-script
peick/coffee-script
pjaspers/coffee-script
plambert/coffee-script
poutyface/coffee-script
pschyska/coffee-script
ptoomey3/coffee-script
quangv/coffee-script
revence27/coffee-script
rkJun/coffee-script
robarondaz/coffee-script
robotlolita/coffee-script
rolftimmermans/coffee-script
rpl/coffee-script
rwaldron/coffee-script
rymohr/coffee-script
ryszard/coffee-script
samcday/coffee-script
sarang25491/coffee-script
satyr/coffee-script
seedjs/coffee-script
sequoiar/coffee-script
sgraham/coffee-script
shariefsk/coffee-script
shesek/coffee-script
shimaore/cake
siefkenj/gjscoffee-script
smhanov/coffee-script
soutaro/coffee-script
spaghetticode/coffee-script
sparecycles/coffee-script
spencerelliott/coffee-script
sstephenson/coffee-script
stephank/coffee-script
strangemonad/coffee-script
swistak/coffee-script
syg/heap.coffee
taku0/coffee-script
tanob/coffee-script
tglines/coffee-script
thdtjsdn/coffee-script
theIntuitionist/coffee-script
thedeeno/coffee-script
thejh/coffee-script
timruffles/coffee-script
tkpage/coffee-script
tlrobinson/coffee-script
tmishra/coffee-script
tobee/coffee-script
tomelam/coffee-script
tosh/coffee-script
tswicegood/coffee-script
ttilley/coffee-script
twilson63/coffee-script
up2u0609/coffee-script
vanviegen/coffee-script
vjpr/coffee-script
vol4ok/coffee-script
walski/coffee-script
wearefractal/yerbascript
willmoffat/coffee-script
xixixao/coffee-script
yihuang/coffee-script
zaach/coffee-script
zmthy/coffee-script
zot/coffee-script
Nothing to show
Choose a base branch
Choose a Head Repository
jashkenas/coffeescript
CDR2003/coffee-script-lua
CreamCoderz/coffee-script
Crylock/coffee-script
GeoffreyBooth/coffeescript
Gregg/coffee-script
JulianBirch/coffee-script-1
JustinTulloss/coffee-script
LittleForker/coffee-script
MichaelBlume/coffee-script
NightMigera/coffeescript
PandaWood/coffee-script
ProximaMonkey/coffee-script
Remcoman/coffee-script
RicardoSaracino/coffee-script
SE7ENSKY/matescript
STRd6/coffee-script
StanAngeloff/coffee-script
Xepo/coffee-script
abi/coffee-script
agnoster/coffee-script
ahjohannessen/coffee-script
akiellor/coffee-script
alanning/coffee-script
allanberger/coffee-script
almost/coffee-script
alubbe/coffee-script
andrehjr/coffee-script
andrewschaaf/coffee-script
andreypopp/coffee-script
apanda/coffee-script
baoshitang/coffee-script
barberboy/coffee-script
benatkin/coffee-script
benbria/coffee-script
benekastah/coffee-script
bjouhier/coffee-script
blahutka/coffee-script
blossom/coffee-script
bolinfest/coffee-script
breckinloggins/coffee-script
carmelyne/contracts.coffee
chajath/coffee-script
charliesome/coffee-script
chetan51/coffee-script
chip/coffee-script
codelahoma/coffee-script
coffee-js/coffee-script
coffee-void/coffeescript
danemorgridge/coffee-script
daveclarke/coffee-script
daveyoon/coffee-script
dbrans/coffee-script
deadprogram/coffee-script
devongovett/coffee-script
dget/coffee-script
disnet/contracts.coffee
dmohl/coffee-script
dohse/coffee-script
dpritchett/coffee-script
dqminh/coffee-script
drewlesueur/coffee-script
emmalemma/coffee-script
eventualbuddha/coffee-script
evilpie/coffee-script
excellentdrums/coffee-script
fitzgen/coffee-script
fizx/coffee-script
geraldalewis/coffee-script
germanocaldeira/coffee-script
gfodor/coffee-script
ghuntley/coffee-script
goodwink/coffee-script
gxela/coffee-script
hayeah/coffee-script
hbt/coffee-script
helixbass/copheescript
hleumas/coffee-script
holmsand/coffee-script
holtwick/moccacino
hugs/coffee-script
ianthehenry/protoscript
ich/caffeine
janlelis/angular-coffee-script
jaredwy/coffee-script
jasonyandell/coffee-script
jawj/coffee-script
jbca/coffeescript
jiangmiao/toffee-script
jlstr/coffee-script
joelturnbull/coffee-script
johnsang/coffee-script
joliss/coffee-script
jondistad/coffee-script
joshprice/coffee-script
jstrachan/coffee-script
jugglinmike/irene-script
juilyoon/coffee-script
jwalgran/coffee-script
keichii/coffee-script
keithnorm/coffee-script
kewinwang/coffee-script
khaled/coffee-script
kiddphunk/coffee-script
leeight/coffee-script
lfendy/coffee-script
loganfsmyth/coffee-script
loopinfinito/coffeescript.com.br
lorensr/coffee-script
loveencounterflow/coffy-script
lukhnos/doubleshot
lynaghk/coffee-script
martco/coffee-script
maxtaco/coffee-script
mbbx6spp/coffee-script
mblinn/coffee-script
mehmeta/coffee-script
melcher/coffee-script
mental/coffee-script
mhart/coffee-script
michaelficarra/coffee-script
misfo/coffee-script
mizchi/coffee-script
mlinderm/coffee-script
mrlauer/coffee-script-monads
muratmeran/coffee-script
myang/coffee-script
nanqiu/coffee-script
neobine/coffee-script
netconstructor/coffee-script
nihar/coffee-script
onilabs/coffee-script
paiq/blackcoffee
parkerl/coffee-script
paulmars/coffee-script
peick/coffee-script
pjaspers/coffee-script
plambert/coffee-script
poutyface/coffee-script
pschyska/coffee-script
ptoomey3/coffee-script
quangv/coffee-script
revence27/coffee-script
rkJun/coffee-script
robarondaz/coffee-script
robotlolita/coffee-script
rolftimmermans/coffee-script
rpl/coffee-script
rwaldron/coffee-script
rymohr/coffee-script
ryszard/coffee-script
samcday/coffee-script
sarang25491/coffee-script
satyr/coffee-script
seedjs/coffee-script
sequoiar/coffee-script
sgraham/coffee-script
shariefsk/coffee-script
shesek/coffee-script
shimaore/cake
siefkenj/gjscoffee-script
smhanov/coffee-script
soutaro/coffee-script
spaghetticode/coffee-script
sparecycles/coffee-script
spencerelliott/coffee-script
sstephenson/coffee-script
stephank/coffee-script
strangemonad/coffee-script
swistak/coffee-script
syg/heap.coffee
taku0/coffee-script
tanob/coffee-script
tglines/coffee-script
thdtjsdn/coffee-script
theIntuitionist/coffee-script
thedeeno/coffee-script
thejh/coffee-script
timruffles/coffee-script
tkpage/coffee-script
tlrobinson/coffee-script
tmishra/coffee-script
tobee/coffee-script
tomelam/coffee-script
tosh/coffee-script
tswicegood/coffee-script
ttilley/coffee-script
twilson63/coffee-script
up2u0609/coffee-script
vanviegen/coffee-script
vjpr/coffee-script
vol4ok/coffee-script
walski/coffee-script
wearefractal/yerbascript
willmoffat/coffee-script
xixixao/coffee-script
yihuang/coffee-script
zaach/coffee-script
zmthy/coffee-script
zot/coffee-script
Nothing to show
Choose a head branch
2
contributors
Commits on Jan 17, 2010
|
|
jashkenas |
doc updates -- widened the code segments for the sake of the JavaScript
|
b9c09bf
|
Commits on Jan 19, 2010
|
|
jashkenas |
fixing bug with multiple linebreaks in heredocs
|
a8ae37a
|
Commits on Jan 21, 2010
|
|
jashkenas |
fixing comments as the last line of a block
|
791d874
|
Commits on Jan 23, 2010
|
|
jashkenas |
adding the compiled parser back into the repo (after all that) so tha…
…t it can be used as the source for the narwhal package |
5f94186
|
|||
|
|
jashkenas |
added automatic safety closure wrapper for functions declared within …
…for loops. |
c3ce2ea
|
Commits on Jan 24, 2010
|
|
jashkenas |
removing 'this' rewriting in favor of correctly calling generated clo…
…sures |
9160500
|
|||
|
|
jashkenas |
added existence chains with '?.' -- soaks up attempts to access undef…
…ined properties, returning 'undefined' |
d728c3d
|
|||
|
|
jashkenas |
adding soaked method calls, with caching
|
817e8de
|
|||
|
|
jashkenas |
added test for lexical scope sharing through generated closure wrappe…
…rs, something uncommonly used, but that was a regression |
af53a04
|
|||
|
|
jashkenas |
adding more examples to the computer_science folder, and fiddling wit…
…h operator precedence |
e6f010b
|
Commits on Jan 25, 2010
Commits on Jan 26, 2010
Commits on Jan 27, 2010
Unified
Split
Showing
with
4,191 additions
and 1,152 deletions.
- +0 −1 .gitignore
- +3 −1 Rakefile
- +4 −3 coffee-script.gemspec
- +3 −3 documentation/coffee/arguments.coffee
- +1 −1 documentation/coffee/array_comprehensions.coffee
- +0 −4 documentation/coffee/blocks.coffee
- +1 −1 documentation/coffee/expressions.coffee
- +1 −1 documentation/coffee/expressions_try.coffee
- +6 −0 documentation/coffee/fat_arrow.coffee
- +2 −2 documentation/coffee/functions.coffee
- +0 −6 documentation/coffee/long_arrow.coffee
- +2 −2 documentation/coffee/multiple_return_values.coffee
- +6 −6 documentation/coffee/overview.coffee
- +2 −2 documentation/coffee/range_comprehensions.coffee
- +1 −1 documentation/coffee/scope.coffee
- +1 −0 documentation/coffee/soaks.coffee
- +5 −5 documentation/coffee/splats.coffee
- +13 −13 documentation/coffee/super.coffee
- +1 −1 documentation/coffee/try.coffee
- +2 −0 documentation/coffee/while.coffee
- +2 −2 documentation/css/docs.css
- +1 −0 documentation/css/idle.css
- +83 −82 documentation/index.html.erb
- +1 −1 documentation/js/array_comprehensions.js
- +0 −8 documentation/js/blocks.js
- +1 −1 documentation/js/expressions_comprehension.js
- +2 −2 documentation/js/expressions_try.js
- 0 documentation/js/{long_arrow.js → fat_arrow.js}
- +1 −1 documentation/js/object_comprehensions.js
- +1 −1 documentation/js/overview.js
- +2 −2 documentation/js/range_comprehensions.js
- +4 −0 documentation/js/soaks.js
- +3 −3 documentation/js/splats.js
- +3 −1 documentation/js/while.js
- +306 −297 documentation/underscore.html
- +1 −1 examples/beautiful_code/binary_search.coffee
- +1 −1 examples/beautiful_code/quicksort_runtime.coffee
- +3 −3 examples/beautiful_code/regular_expression_matcher.coffee
- +17 −17 examples/code.coffee
- +4 −0 examples/computer_science/README
- +25 −0 examples/computer_science/binary_search.coffee
- +11 −0 examples/computer_science/bubble_sort.coffee
- +106 −0 examples/computer_science/linked_list.coffee
- +36 −0 examples/computer_science/luhn_algorithm.coffee
- +19 −0 examples/computer_science/merge_sort.coffee
- +23 −0 examples/computer_science/selection_sort.coffee
- +0 −72 examples/documents.coffee
- +45 −12 examples/poignant.coffee
- +11 −11 examples/potion.coffee
- +0 −20 examples/syntax_errors.coffee
- +124 −115 examples/underscore.coffee
- 0 {lib/coffee_script → extras}/CoffeeScript.tmbundle/Preferences/CoffeeScript.tmPreferences
- +11 −26 {lib/coffee_script → extras}/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage
- 0 {lib/coffee_script → extras}/CoffeeScript.tmbundle/info.plist
- +20 −0 extras/EXTRAS
- +111 −0 extras/coffee.vim
- +176 −176 index.html
- +1 −1 lib/coffee-script.rb
- +6 −4 lib/coffee_script/command_line.rb
- +26 −17 lib/coffee_script/grammar.y
- +31 −13 lib/coffee_script/lexer.rb
- +6 −6 lib/coffee_script/narwhal/coffee-script.coffee
- +1 −1 lib/coffee_script/narwhal/lib/coffee-script.js
- +3 −3 lib/coffee_script/narwhal/loader.coffee
- +48 −32 lib/coffee_script/nodes.rb
- +5 −5 lib/coffee_script/parse_error.rb
- +2,529 −0 lib/coffee_script/parser.rb
- +80 −10 lib/coffee_script/rewriter.rb
- +1 −1 package.json
- +7 −7 test/fixtures/execution/test_arguments.coffee
- +22 −5 test/fixtures/execution/test_array_comprehension.coffee
- +4 −4 test/fixtures/execution/test_assignment.coffee
- +2 −2 test/fixtures/execution/test_blocks.coffee
- +15 −15 test/fixtures/execution/test_calling_super.coffee
- +5 −4 test/fixtures/execution/test_chained_calls.coffee
- +11 −11 test/fixtures/execution/test_destructuring_assignment.coffee
- +4 −4 test/fixtures/execution/test_everything.coffee
- +26 −4 test/fixtures/execution/test_existence.coffee
- +5 −5 test/fixtures/execution/test_expressions.coffee
- +7 −1 test/fixtures/execution/test_fancy_if_statement.coffee
- +48 −18 test/fixtures/execution/test_functions.coffee
- +6 −2 test/fixtures/execution/test_funky_comments.coffee
- +14 −5 test/fixtures/execution/test_heredocs.coffee
- +8 −1 test/fixtures/execution/test_lexical_scope.coffee
- +9 −9 test/fixtures/execution/test_literals.coffee
- +3 −3 test/fixtures/execution/test_nested_comprehensions.coffee
- +1 −1 test/fixtures/execution/test_newline_escaping.coffee
- +6 −6 test/fixtures/execution/test_operations.coffee
- +3 −3 test/fixtures/execution/test_range_comprehension.coffee
- +2 −2 test/fixtures/execution/test_ranges_and_slices.coffee
- +10 −10 test/fixtures/execution/test_splats.coffee
- +1 −3 test/fixtures/execution/test_splices.coffee
- +6 −7 test/fixtures/execution/test_switch.coffee
- +3 −3 test/fixtures/execution/test_while.coffee
- +1 −1 test/fixtures/generation/each.coffee
- +1 −1 test/fixtures/generation/each.tokens
- +1 −1 test/fixtures/generation/statements_as_expressions.coffee
- +6 −6 test/fixtures/generation/whitespace.coffee
- +2 −1 test/unit/test_execution.rb
- +6 −5 test/unit/test_lexer.rb
- +1 −1 test/unit/test_parser.rb
View
1
.gitignore
| @@ -1,7 +1,6 @@ | ||
| presentation | ||
| test.coffee | ||
| parser.output | ||
| -lib/coffee_script/parser.rb | ||
| test/fixtures/underscore | ||
| examples/beautiful_code/parse.coffee | ||
| *.gem |
View
4
Rakefile
| @@ -25,7 +25,7 @@ namespace :build do | ||
| desc "Compile and install the Ultraviolet syntax highlighter" | ||
| task :ultraviolet do | ||
| - sh "plist2syntax lib/coffee_script/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage" | ||
| + sh "plist2syntax extras/CoffeeScript.tmbundle/Syntaxes/CoffeeScript.tmLanguage" | ||
| sh "sudo mv coffeescript.yaml /usr/local/lib/ruby/gems/1.8/gems/ultraviolet-0.10.2/syntax/coffeescript.syntax" | ||
| end | ||
| @@ -58,6 +58,8 @@ namespace :gem do | ||
| desc 'Build and install the coffee-script gem' | ||
| task :install do | ||
| + verbose = "lib/coffee_script/parser.output" | ||
| + FileUtils.rm(verbose) if File.exists?(verbose) | ||
| sh "gem build coffee-script.gemspec" | ||
| sh "sudo gem install #{Dir['*.gem'].join(' ')} --local --no-ri --no-rdoc" | ||
| end | ||
View
7
coffee-script.gemspec
| @@ -1,7 +1,7 @@ | ||
| Gem::Specification.new do |s| | ||
| s.name = 'coffee-script' | ||
| - s.version = '0.2.6' # Keep version in sync with coffee-script.rb | ||
| - s.date = '2010-1-17' | ||
| + s.version = '0.3.0' # Keep version in sync with coffee-script.rb | ||
| + s.date = '2010-1-26' | ||
| s.homepage = "http://jashkenas.github.com/coffee-script/" | ||
| s.summary = "The CoffeeScript Compiler" | ||
| @@ -22,5 +22,6 @@ Gem::Specification.new do |s| | ||
| s.require_paths = ['lib'] | ||
| s.executables = ['coffee'] | ||
| - s.files = Dir['bin/*', 'examples/*', 'lib/**/*', 'coffee-script.gemspec', 'LICENSE', 'README', 'package.json'] | ||
| + s.files = Dir['bin/*', 'examples/*', 'extras/**/*', 'lib/**/*', | ||
| + 'coffee-script.gemspec', 'LICENSE', 'README', 'package.json'] | ||
| end | ||
View
6
documentation/coffee/arguments.coffee
| @@ -1,4 +1,4 @@ | ||
| -backwards: => | ||
| - alert(arguments.reverse()) | ||
| +backwards: -> | ||
| + alert arguments.reverse() | ||
| -backwards("stairway", "to", "heaven") | ||
| +backwards "stairway", "to", "heaven" |
View
2
documentation/coffee/array_comprehensions.coffee
| @@ -4,4 +4,4 @@ lunch: eat(food) for food in ['toast', 'cheese', 'wine'] | ||
| # Naive collision detection. | ||
| for roid in asteroids | ||
| for roid2 in asteroids when roid isnt roid2 | ||
| - roid.explode() if roid.overlaps(roid2) | ||
| + roid.explode() if roid.overlaps roid2 | ||
View
4
documentation/coffee/blocks.coffee
| @@ -1,4 +0,0 @@ | ||
| -$('table.list').each() table => | ||
| - $('tr.account', table).each() row => | ||
| - row.show() | ||
| - row.highlight() |
View
2
documentation/coffee/expressions.coffee
| @@ -1,4 +1,4 @@ | ||
| -grade: student => | ||
| +grade: (student) -> | ||
| if student.excellent_work | ||
| "A+" | ||
| else if student.okay_stuff | ||
View
2
documentation/coffee/expressions_try.coffee
| @@ -2,5 +2,5 @@ alert( | ||
| try | ||
| nonexistent / undefined | ||
| catch error | ||
| - "Caught an error: " + error | ||
| + "And the error is ... " + error | ||
| ) | ||
View
6
documentation/coffee/fat_arrow.coffee
| @@ -0,0 +1,6 @@ | ||
| +Account: (customer, cart) -> | ||
| + this.customer: customer | ||
| + this.cart: cart | ||
| + | ||
| + $('.shopping_cart').bind 'click', (event) => | ||
| + this.customer.purchase this.cart |
View
4
documentation/coffee/functions.coffee
| @@ -1,2 +1,2 @@ | ||
| -square: x => x * x | ||
| -cube: x => square(x) * x | ||
| +square: (x) -> x * x | ||
| +cube: (x) -> square(x) * x |
View
6
documentation/coffee/long_arrow.coffee
| @@ -1,6 +0,0 @@ | ||
| -Account: customer, cart => | ||
| - this.customer: customer | ||
| - this.cart: cart | ||
| - | ||
| - $('.shopping_cart').bind('click') event ==> | ||
| - this.customer.purchase(this.cart) |
View
4
documentation/coffee/multiple_return_values.coffee
| @@ -1,5 +1,5 @@ | ||
| -weather_report: location => | ||
| +weather_report: (location) -> | ||
| # Make an Ajax request to fetch the weather... | ||
| [location, 72, "Mostly Sunny"] | ||
| -[city, temp, forecast]: weather_report("Berkeley, CA") | ||
| +[city, temp, forecast]: weather_report "Berkeley, CA" |
View
12
documentation/coffee/overview.coffee
| @@ -6,7 +6,7 @@ opposite_day: true | ||
| number: -42 if opposite_day | ||
| # Functions: | ||
| -square: x => x * x | ||
| +square: (x) -> x * x | ||
| # Arrays: | ||
| list: [1, 2, 3, 4, 5] | ||
| @@ -15,15 +15,15 @@ list: [1, 2, 3, 4, 5] | ||
| math: { | ||
| root: Math.sqrt | ||
| square: square | ||
| - cube: x => x * square(x) | ||
| + cube: (x) -> x * square x | ||
| } | ||
| # Splats: | ||
| -race: winner, runners... => | ||
| - print(winner, runners) | ||
| +race: (winner, runners...) -> | ||
| + print winner, runners | ||
| # Existence: | ||
| -alert("I knew it!") if elvis? | ||
| +alert "I knew it!" if elvis? | ||
| # Array comprehensions: | ||
| -cubed_list: math.cube(num) for num in list | ||
| +cubed_list: math.cube num for num in list | ||
View
4
documentation/coffee/range_comprehensions.coffee
| @@ -1,6 +1,6 @@ | ||
| countdown: num for num in [10..1] | ||
| -egg_delivery: => | ||
| +egg_delivery: -> | ||
| for i in [0...eggs.length] by 12 | ||
| dozen_eggs: eggs[i...i+12] | ||
| - deliver(new egg_carton(dozen)) | ||
| + deliver new egg_carton(dozen) |
View
2
documentation/coffee/scope.coffee
| @@ -1,5 +1,5 @@ | ||
| num: 1 | ||
| -change_numbers: => | ||
| +change_numbers: -> | ||
| new_num: -1 | ||
| num: 10 | ||
| new_num: change_numbers() |
View
1
documentation/coffee/soaks.coffee
| @@ -0,0 +1 @@ | ||
| +lottery.draw_winner()?.address?.zipcode |
View
10
documentation/coffee/splats.coffee
| @@ -1,6 +1,6 @@ | ||
| gold: silver: the_field: "unknown" | ||
| -medalists: first, second, rest... => | ||
| +award_medals: (first, second, rest...) -> | ||
| gold: first | ||
| silver: second | ||
| the_field: rest | ||
| @@ -18,8 +18,8 @@ contenders: [ | ||
| "Usain Bolt" | ||
| ] | ||
| -medalists(contenders...) | ||
| +award_medals contenders... | ||
| -alert("Gold: " + gold) | ||
| -alert("Silver: " + silver) | ||
| -alert("The Field: " + the_field) | ||
| +alert "Gold: " + gold | ||
| +alert "Silver: " + silver | ||
| +alert "The Field: " + the_field | ||
View
26
documentation/coffee/super.coffee
| @@ -1,21 +1,21 @@ | ||
| -Animal: => | ||
| -Animal::move: meters => | ||
| - alert(this.name + " moved " + meters + "m.") | ||
| +Animal: -> | ||
| +Animal::move: (meters) -> | ||
| + alert this.name + " moved " + meters + "m." | ||
| -Snake: name => this.name: name | ||
| +Snake: (name) -> this.name: name | ||
| Snake extends Animal | ||
| -Snake::move: => | ||
| - alert("Slithering...") | ||
| - super(5) | ||
| +Snake::move: -> | ||
| + alert "Slithering..." | ||
| + super 5 | ||
| -Horse: name => this.name: name | ||
| +Horse: (name) -> this.name: name | ||
| Horse extends Animal | ||
| -Horse::move: => | ||
| - alert("Galloping...") | ||
| - super(45) | ||
| +Horse::move: -> | ||
| + alert "Galloping..." | ||
| + super 45 | ||
| -sam: new Snake("Sammy the Python") | ||
| -tom: new Horse("Tommy the Palomino") | ||
| +sam: new Snake "Sammy the Python" | ||
| +tom: new Horse "Tommy the Palomino" | ||
| sam.move() | ||
| tom.move() | ||
View
2
documentation/coffee/try.coffee
| @@ -2,6 +2,6 @@ try | ||
| all_hell_breaks_loose() | ||
| cats_and_dogs_living_together() | ||
| catch error | ||
| - print(error) | ||
| + print error | ||
| finally | ||
| clean_up() | ||
View
2
documentation/coffee/while.coffee
| @@ -1,7 +1,9 @@ | ||
| +# Econ 101 | ||
| if this.studying_economics | ||
| while supply > demand then buy() | ||
| while supply < demand then sell() | ||
| +# Nursery Rhyme | ||
| num: 6 | ||
| lyrics: while num -= 1 | ||
| num + " little monkeys, jumping on the bed. | ||
View
4
documentation/css/docs.css
| @@ -6,7 +6,7 @@ body { | ||
| font-family: Arial, Helvetica, sans-serif; | ||
| } | ||
| div.container { | ||
| - width: 850px; | ||
| + width: 950px; | ||
| margin: 50px 0 50px 50px; | ||
| } | ||
| p { | ||
| @@ -77,7 +77,7 @@ div.code { | ||
| } | ||
| div.code pre { | ||
| float: left; | ||
| - width: 410px; | ||
| + width: 450px; | ||
| border-left: 1px dotted #559; | ||
| padding: 0 0 0 12px; | ||
| margin: 0; | ||
View
1
documentation/css/idle.css
| @@ -28,6 +28,7 @@ pre.idle .LibraryConstant { | ||
| color: #A535AE; | ||
| } | ||
| pre.idle .FunctionArgument { | ||
| + color: #0076ad; | ||
| } | ||
| pre.idle .BuiltInConstant { | ||
| color: #A535AE; | ||
Oops, something went wrong.