default.txt 783 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. grade = (student, period=(if b? then 7 else 6), messages={"A": "Excellent"}) ->
  2. if student.excellentWork
  3. "A+"
  4. else if student.okayStuff
  5. if student.triedHard then "B" else "B-"
  6. else
  7. "C"
  8. square = (x) -> x * x
  9. two = -> 2
  10. math =
  11. root: Math.sqrt
  12. square: square
  13. cube: (x) -> x * square x
  14. race = (winner, runners...) ->
  15. print winner, runners
  16. class Animal extends Being
  17. constructor: (@name) ->
  18. move: (meters) ->
  19. alert @name + " moved #{meters}m."
  20. hi = `function() {
  21. return [document.title, "Hello JavaScript"].join(": ");
  22. }`
  23. heredoc = """
  24. CoffeeScript subst test #{ 010 + 0xf / 0b10 + "nested string #{ /\n/ }"}
  25. """
  26. ###
  27. CoffeeScript Compiler v1.2.0
  28. Released under the MIT License
  29. ###
  30. OPERATOR = /// ^ (
  31. ?: [-=]> # function
  32. ) ///