summaryrefslogtreecommitdiffhomepage
path: root/es-es
diff options
context:
space:
mode:
Diffstat (limited to 'es-es')
-rw-r--r--es-es/c-es.html.markdown2
-rw-r--r--es-es/coffeescript-es.html.markdown57
2 files changed, 58 insertions, 1 deletions
diff --git a/es-es/c-es.html.markdown b/es-es/c-es.html.markdown
index b109f761..5d3aae0c 100644
--- a/es-es/c-es.html.markdown
+++ b/es-es/c-es.html.markdown
@@ -284,7 +284,7 @@ for (xx=0; xx<20; xx++) {
// impredecibles
printf("%d\n", *(my_ptr + 21)); // => Prints who-knows-what?
-// Cuando hallas acabado con el bloque de memoría malloc, necesitas
+// Cuando hayas acabado con el bloque de memoría malloc, necesitas
// liberarlo o sino nadie más podrá usarlo hasta que tu programa se cierre
free(my_ptr);
diff --git a/es-es/coffeescript-es.html.markdown b/es-es/coffeescript-es.html.markdown
new file mode 100644
index 00000000..78bb9be5
--- /dev/null
+++ b/es-es/coffeescript-es.html.markdown
@@ -0,0 +1,57 @@
+---
+language: coffeescript
+lang: es-es
+contributors:
+ - ["Tenor Biel", "http://github.com/L8D"]
+translators:
+ - ["Pablo Elices", "http://github.com/pabloelices"]
+filename: coffeescript-es.coffee
+---
+
+``` coffeescript
+# CoffeeScript es un lenguaje hipster.
+# Tiene convenciones de muchos lenguajes modernos.
+# Los comentarios son como en Ruby y Python, usan almohadillas.
+
+###
+Los comentarios en bloque son como estos, y se traducen directamente a '/*' y '*/'
+para el código JavaScript resultante.
+
+Deberías entender la mayor parte de la semántica de JavaScript antes de continuar.
+###
+
+# Asignación:
+number = 42 #=> var number = 42;
+opposite = true #=> var opposite = true;
+
+# Condiciones:
+number = -42 if opposite #=> if(opposite) { number = -42; }
+
+# Funciones:
+square = (x) -> x * x #=> var square = function(x) { return x * x; }
+
+# Rangos:
+list = [1..5] #=> var list = [1, 2, 3, 4, 5];
+
+# Objetos:
+math =
+ root: Math.sqrt
+ square: square
+ cube: (x) -> x * square x
+#=> var math = {
+# "root": Math.sqrt,
+# "square": square,
+# "cube": function(x) { return x * square(x); }
+#}
+
+# Símbolos:
+race = (winner, runners...) ->
+ print winner, runners
+
+# Existencia:
+alert "I knew it!" if elvis?
+#=> if(typeof elvis !== "undefined" && elvis !== null) { alert("I knew it!"); }
+
+# Colecciones por comprensión:
+cubes = (math.cube num for num in list) #=> ...
+```