summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CHICKEN.html.markdown4
-rw-r--r--angularjs.html.markdown8
-rw-r--r--awk.html.markdown2
-rw-r--r--c.html.markdown4
-rw-r--r--chapel.html.markdown6
-rw-r--r--cmake.html.markdown4
-rw-r--r--crystal.html.markdown2
-rw-r--r--csharp.html.markdown6
-rw-r--r--cypher.html.markdown6
-rw-r--r--edn.html.markdown4
-rw-r--r--elixir.html.markdown4
-rw-r--r--elm.html.markdown2
-rw-r--r--es-es/go-es.html.markdown12
-rw-r--r--fa-ir/java-fa.html.markdown2
-rw-r--r--fortran95.html.markdown4
-rw-r--r--fr-fr/scala.html.markdown2
-rw-r--r--git.html.markdown18
-rw-r--r--go.html.markdown2
-rw-r--r--hack.html.markdown4
-rw-r--r--haml.html.markdown2
-rw-r--r--haxe.html.markdown2
-rw-r--r--hy.html.markdown2
-rw-r--r--ja-jp/php-jp.html.markdown2
-rw-r--r--java.html.markdown2
-rw-r--r--json.html.markdown1
-rw-r--r--kdb+.html.markdown20
-rw-r--r--kotlin.html.markdown2
-rw-r--r--lfe.html.markdown459
-rw-r--r--matlab.html.markdown2
-rw-r--r--nim.html.markdown4
-rw-r--r--objective-c.html.markdown2
-rw-r--r--perl6.html.markdown22
-rw-r--r--php.html.markdown12
-rw-r--r--pl-pl/bf-pl.html.markdown2
-rw-r--r--pl-pl/haskell-pl.html.markdown6
-rw-r--r--pl-pl/json-pl.html.markdown3
-rw-r--r--pl-pl/perl-pl.html.markdown4
-rw-r--r--pt-br/c-pt.html.markdown2
-rw-r--r--pythonstatcomp.html.markdown2
-rw-r--r--qt.html.markdown4
-rw-r--r--r.html.markdown4
-rw-r--r--red.html.markdown2
-rw-r--r--ru-ru/c++-ru.html.markdown2
-rw-r--r--ru-ru/c-ru.html.markdown2
-rw-r--r--ru-ru/elixir-ru.html.markdown467
-rw-r--r--ru-ru/objective-c-ru.html.markdown2
-rw-r--r--ru-ru/php-ru.html.markdown41
-rw-r--r--ruby-ecosystem.html.markdown2
-rw-r--r--shutit.html.markdown8
-rw-r--r--smalltalk.html.markdown2
-rw-r--r--solidity.html.markdown9
-rw-r--r--standard-ml.html.markdown4
-rw-r--r--swift.html.markdown2
-rw-r--r--tcl.html.markdown15
-rw-r--r--tcsh.html.markdown2
-rw-r--r--tr-tr/c-tr.html.markdown2
-rw-r--r--typescript.html.markdown2
-rw-r--r--vim.html.markdown6
-rw-r--r--visualbasic.html.markdown2
-rw-r--r--yaml.html.markdown4
-rw-r--r--zh-cn/visualbasic-cn.html.markdown2
61 files changed, 1070 insertions, 165 deletions
diff --git a/CHICKEN.html.markdown b/CHICKEN.html.markdown
index 080527a9..5d1daa4c 100644
--- a/CHICKEN.html.markdown
+++ b/CHICKEN.html.markdown
@@ -235,12 +235,12 @@ sqr ;; => #<procedure (sqr x)>
(= 2 1) ;; => #f
;; 'eq?' returns #t if two arguments refer to the same object in memory
-;; In other words, it's a simple pointer comparision.
+;; In other words, it's a simple pointer comparison.
(eq? '() '()) ;; => #t ;; there's only one empty list in memory
(eq? (list 3) (list 3)) ;; => #f ;; not the same object
(eq? 'yes 'yes) ;; => #t
(eq? 3 3) ;; => #t ;; don't do this even if it works in this case
-(eq? 3 3.0) ;; => #f ;; it's better to use '=' for number comparisions
+(eq? 3 3.0) ;; => #f ;; it's better to use '=' for number comparisons
(eq? "Hello" "Hello") ;; => #f
;; 'eqv?' is same as 'eq?' all datatypes except numbers and characters
diff --git a/angularjs.html.markdown b/angularjs.html.markdown
index 737b99c7..9156490e 100644
--- a/angularjs.html.markdown
+++ b/angularjs.html.markdown
@@ -699,10 +699,10 @@ app.controller('myCtrl', function($scope) {
**Examples**
-- http://www.w3schools.com/angular/angular_examples.asp
+- [http://www.w3schools.com/angular/angular_examples.asp](http://www.w3schools.com/angular/angular_examples.asp)
**References**
-- http://www.w3schools.com/angular/angular_ref_directives.asp
-- http://www.w3schools.com/angular/default.asp
-- https://teamtreehouse.com/library/angular-basics/
+- [http://www.w3schools.com/angular/angular_ref_directives.asp](http://www.w3schools.com/angular/angular_ref_directives.asp)
+- [http://www.w3schools.com/angular/default.asp](http://www.w3schools.com/angular/default.asp)
+- [https://teamtreehouse.com/library/angular-basics/](https://teamtreehouse.com/library/angular-basics/)
diff --git a/awk.html.markdown b/awk.html.markdown
index 90f88b1a..8a9b4fd7 100644
--- a/awk.html.markdown
+++ b/awk.html.markdown
@@ -264,7 +264,7 @@ function io_functions( localvar) {
# automatically for you.
# You can probably guess there are other $ variables. Every line is
- # implicitely split before every action is called, much like the shell
+ # implicitly split before every action is called, much like the shell
# does. And, like the shell, each field can be access with a dollar sign
# This will print the second and fourth fields in the line
diff --git a/c.html.markdown b/c.html.markdown
index 18503eab..637311ca 100644
--- a/c.html.markdown
+++ b/c.html.markdown
@@ -336,10 +336,10 @@ int main (int argc, char** argv)
goto error;
}
error :
- printf("Error occured at i = %d & j = %d.\n", i, j);
+ printf("Error occurred at i = %d & j = %d.\n", i, j);
/*
https://ideone.com/GuPhd6
- this will print out "Error occured at i = 52 & j = 99."
+ this will print out "Error occurred at i = 52 & j = 99."
*/
///////////////////////////////////////
diff --git a/chapel.html.markdown b/chapel.html.markdown
index 68ce49cd..96ddc69d 100644
--- a/chapel.html.markdown
+++ b/chapel.html.markdown
@@ -242,7 +242,7 @@ do {
} while (j <= 10000);
writeln(jSum);
-// for loops are much like those in python in that they iterate over a
+// for loops are much like those in Python in that they iterate over a
// range. Ranges (like the 1..10 expression below) are a first-class object
// in Chapel, and as such can be stored in variables.
for i in 1..10 do write(i, ", ");
@@ -1064,14 +1064,14 @@ proc main() {
}
}
-// Heres an example using atomics and a sync variable to create a
+// Here's an example using atomics and a sync variable to create a
// count-down mutex (also known as a multiplexer).
var count: atomic int; // our counter
var lock$: sync bool; // the mutex lock
count.write(2); // Only let two tasks in at a time.
lock$.writeXF(true); // Set lock$ to full (unlocked)
- // Note: The value doesnt actually matter, just the state
+ // Note: The value doesn't actually matter, just the state
// (full:unlocked / empty:locked)
// Also, writeXF() fills (F) the sync var regardless of its state (X)
diff --git a/cmake.html.markdown b/cmake.html.markdown
index 45cf0585..c705beea 100644
--- a/cmake.html.markdown
+++ b/cmake.html.markdown
@@ -28,8 +28,8 @@ are used in the usual way.
# - cmake ..
# - make
#
-# With those steps, we will follow the best pratice to compile into a subdir
-# and the second line will request to CMake to generate a new OS-dependant
+# With those steps, we will follow the best practice to compile into a subdir
+# and the second line will request to CMake to generate a new OS-dependent
# Makefile. Finally, run the native Make command.
#------------------------------------------------------------------------------
diff --git a/crystal.html.markdown b/crystal.html.markdown
index 1449ff81..15cbc0b1 100644
--- a/crystal.html.markdown
+++ b/crystal.html.markdown
@@ -215,7 +215,7 @@ Range.new(1, 10).class #=> Range(Int32, Int32)
# possibly different types.
{1, "hello", 'x'}.class #=> Tuple(Int32, String, Char)
-# Acces tuple's value by its index
+# Access tuple's value by its index
tuple = {:key1, :key2}
tuple[1] #=> :key2
tuple[2] #=> syntax error : Index out of bound
diff --git a/csharp.html.markdown b/csharp.html.markdown
index cca99fb0..78f9db34 100644
--- a/csharp.html.markdown
+++ b/csharp.html.markdown
@@ -593,7 +593,7 @@ on a new line! ""Wow!"", the masses cried";
Console.WriteLine(bikeSummary.Name);
// ASPARALLEL
- // And this is where things get wicked - combines linq and parallel operations
+ // And this is where things get wicked - combine linq and parallel operations
var threeWheelers = bikes.AsParallel().Where(b => b.Wheels == 3).Select(b => b.Name);
// this will happen in parallel! Threads will automagically be spun up and the
// results divvied amongst them! Amazing for large datasets when you have lots of
@@ -613,7 +613,7 @@ on a new line! ""Wow!"", the masses cried";
.ThenBy(b => b.Name)
.Select(b => b.Name); // still no query run
- // Now the query runs, but opens a reader, so only populates are you iterate through
+ // Now the query runs, but opens a reader, so only populates as you iterate through
foreach (string bike in query)
Console.WriteLine(result);
@@ -711,7 +711,7 @@ on a new line! ""Wow!"", the masses cried";
// Before .NET 4: (aBike.Accessories & Bicycle.BikeAccessories.Bell) == Bicycle.BikeAccessories.Bell
public BikeAccessories Accessories { get; set; }
- // Static members belong to the type itself rather then specific object.
+ // Static members belong to the type itself rather than specific object.
// You can access them without a reference to any object:
// Console.WriteLine("Bicycles created: " + Bicycle.bicyclesCreated);
public static int BicyclesCreated { get; set; }
diff --git a/cypher.html.markdown b/cypher.html.markdown
index 44db26ae..b7be544a 100644
--- a/cypher.html.markdown
+++ b/cypher.html.markdown
@@ -20,7 +20,7 @@ Nodes
It's an empty *node*, to indicate that there is a *node*, but it's not relevant for the query.
```(n)```
-It's a *node* refered by the variable **n**, reusable in the query. It begins with lowercase and uses camelCase.
+It's a *node* referred by the variable **n**, reusable in the query. It begins with lowercase and uses camelCase.
```(p:Person)```
You can add a *label* to your node, here **Person**. It's like a type / a class / a category. It begins with uppercase and uses camelCase.
@@ -53,7 +53,7 @@ Relationships (or Edges)
It's a *relationship* with the *label* **KNOWS**. It's a *label* as the node's label. It begins with uppercase and use UPPER_SNAKE_CASE.
```[k:KNOWS]```
-The same *relationship*, refered by the variable **k**, reusable in the query, but it's not necessary.
+The same *relationship*, referred by the variable **k**, reusable in the query, but it's not necessary.
```[k:KNOWS {since:2017}]```
The same *relationship*, with *properties* (like *node*), here **since**.
@@ -244,6 +244,6 @@ Special hints
---
- There is just single-line comments in Cypher, with double-slash : // Comments
-- You can execute a Cypher script stored in a **.cql** file directly in Neo4j (it's an import). However, you can't have multiple statements in this file (separed by **;**).
+- You can execute a Cypher script stored in a **.cql** file directly in Neo4j (it's an import). However, you can't have multiple statements in this file (separated by **;**).
- Use the Neo4j shell to write Cypher, it's really awesome.
- The Cypher will be the standard query language for all graph databases (known as **OpenCypher**).
diff --git a/edn.html.markdown b/edn.html.markdown
index ca04df89..79107269 100644
--- a/edn.html.markdown
+++ b/edn.html.markdown
@@ -32,7 +32,7 @@ false
"hungarian breakfast"
"farmer's cheesy omelette"
-; Characters are preceeded by backslashes
+; Characters are preceded by backslashes
\g \r \a \c \e
; Keywords start with a colon. They behave like enums. Kind of
@@ -42,7 +42,7 @@ false
:olives
; Symbols are used to represent identifiers. They start with #.
-; You can namespace symbols by using /. Whatever preceeds / is
+; You can namespace symbols by using /. Whatever precedes / is
; the namespace of the name.
#spoon
#kitchen/spoon ; not the same as #spoon
diff --git a/elixir.html.markdown b/elixir.html.markdown
index 9dfffc41..a74baa38 100644
--- a/elixir.html.markdown
+++ b/elixir.html.markdown
@@ -4,6 +4,7 @@ contributors:
- ["Joao Marques", "http://github.com/mrshankly"]
- ["Dzianis Dashkevich", "https://github.com/dskecse"]
- ["Ryan Plant", "https://github.com/ryanplant-au"]
+ - ["Ev Bogdanov", "https://github.com/evbogdanov"]
filename: learnelixir.ex
---
@@ -127,7 +128,8 @@ rem(10, 3) #=> 1
# These operators expect a boolean as their first argument.
true and true #=> true
false or true #=> true
-# 1 and true #=> ** (ArgumentError) argument error
+# 1 and true
+#=> ** (BadBooleanError) expected a boolean on left-side of "and", got: 1
# Elixir also provides `||`, `&&` and `!` which accept arguments of any type.
# All values except `false` and `nil` will evaluate to true.
diff --git a/elm.html.markdown b/elm.html.markdown
index 99c23980..23ae9eeb 100644
--- a/elm.html.markdown
+++ b/elm.html.markdown
@@ -286,7 +286,7 @@ leftmostElement tree =
-- Put this at the top of the file. If omitted, you're in Main.
module Name where
--- By default, everything is exported. You can specify exports explicity.
+-- By default, everything is exported. You can specify exports explicitly.
module Name (MyType, myValue) where
-- One common pattern is to export a union type but not its tags. This is known
diff --git a/es-es/go-es.html.markdown b/es-es/go-es.html.markdown
index c41d693d..78267695 100644
--- a/es-es/go-es.html.markdown
+++ b/es-es/go-es.html.markdown
@@ -26,7 +26,7 @@ Es rápido compilando y rápido al ejecutar, añade una concurrencia fácil de
entender para las CPUs de varios núcleos de hoy día, y tiene
características que ayudan con la programación a gran escala.
-Go viene con una biblioteca estándar muy buena y una entusiasta comunidad.
+Go viene con una biblioteca estándar muy buena y una comunidad entusiasta.
```go
// Comentario de una sola línea
@@ -52,7 +52,7 @@ import (
// para el ejecutable. Te guste o no, Go utiliza llaves.
func main() {
// Println imprime una línea a stdout.
- // Cualificalo con el nombre del paquete, fmt.
+ // Llámalo con el nombre del paquete, fmt.
fmt.Println("¡Hola mundo!")
// Llama a otra función de este paquete.
@@ -90,12 +90,12 @@ saltos de línea.` // mismo tipo cadena
g := 'Σ' // Tipo rune, un alias de int32, alberga un carácter unicode.
f := 3.14195 // float64, el estándar IEEE-754 de coma flotante 64-bit.
c := 3 + 4i // complex128, representado internamente por dos float64.
- // Sintaxis Var con iniciadores.
+ // Sintaxis var con iniciadores.
var u uint = 7 // Sin signo, pero la implementación depende del tamaño
// como en int.
var pi float32 = 22. / 7
- // Sintáxis de conversión con una declaración corta.
+ // Sintaxis de conversión con una declaración corta.
n := byte('\n') // byte es un alias para uint8.
// Los Arreglos tienen un tamaño fijo a la hora de compilar.
@@ -377,8 +377,8 @@ func aprendeConcurrencia() {
go func() { c <- 84 }() // Inicia una nueva rutinago solo para
// enviar un valor.
go func() { cs <- "verboso" }() // Otra vez, para cs en esta ocasión.
- // Select tiene una sintáxis parecida a la instrucción switch pero cada
- // caso involucra una operacion con un canal. Selecciona un caso de
+ // Select tiene una sintaxis parecida a la instrucción switch pero cada
+ // caso involucra una operación con un canal. Selecciona un caso de
// forma aleatoria de los casos que están listos para comunicarse.
select {
case i := <-c: // El valor recibido se puede asignar a una variable,
diff --git a/fa-ir/java-fa.html.markdown b/fa-ir/java-fa.html.markdown
index e8182e81..cb965fc4 100644
--- a/fa-ir/java-fa.html.markdown
+++ b/fa-ir/java-fa.html.markdown
@@ -54,7 +54,7 @@ public class LearnJava {
///////////////////////////////////////
/*
- * Ouput
+ * Output
*/
// Use System.out.println() to print lines.
diff --git a/fortran95.html.markdown b/fortran95.html.markdown
index 8479fef8..c256bb38 100644
--- a/fortran95.html.markdown
+++ b/fortran95.html.markdown
@@ -6,7 +6,7 @@ filename: learnfortran.f95
---
Fortran is one of the oldest computer languages. It was developed in the 1950s
-by IBM for numeric calculations (Fortran is an abreviation of "Formula
+by IBM for numeric calculations (Fortran is an abbreviation of "Formula
Translation"). Despite its age, it is still used for high-performance computing
such as weather prediction. However, the language has changed considerably over
the years, although mostly maintaining backwards compatibility; well known
@@ -242,7 +242,7 @@ program example !declare a program called example.
close(12)
! There are more features available than discussed here and alternative
- ! variants due to backwards compatability with older Fortran versions.
+ ! variants due to backwards compatibility with older Fortran versions.
! Built-in Functions
diff --git a/fr-fr/scala.html.markdown b/fr-fr/scala.html.markdown
index c6d06361..c6a61745 100644
--- a/fr-fr/scala.html.markdown
+++ b/fr-fr/scala.html.markdown
@@ -276,7 +276,7 @@ i // Montre la valeur de i. Notez que while est une boucle au sens classique.
i = 0
// La boucle do while
do {
- println("x is still less then 10");
+ println("x is still less than 10");
i += 1
} while (i < 10)
diff --git a/git.html.markdown b/git.html.markdown
index 01dc92c1..088c109f 100644
--- a/git.html.markdown
+++ b/git.html.markdown
@@ -8,6 +8,7 @@ contributors:
- ["Bruno Volcov", "http://github.com/volcov"]
- ["Andrew Taylor", "http://github.com/andrewjt71"]
- ["Jason Stathopulos", "http://github.com/SpiritBreaker226"]
+ - ["Milo Gilad", "http://github.com/Myl0g"]
filename: LearnGit.txt
---
@@ -23,7 +24,7 @@ manage your source code.
Version control is a system that records changes to a file(s), over time.
-### Centralized Versioning VS Distributed Versioning
+### Centralized Versioning vs. Distributed Versioning
* Centralized version control focuses on synchronizing, tracking, and backing
up files.
@@ -157,6 +158,7 @@ $ git init --help
To intentionally untrack file(s) & folder(s) from git. Typically meant for
private & temp files which would otherwise be shared in the repository.
+
```bash
$ echo "temp/" >> .gitignore
$ echo "private_key" >> .gitignore
@@ -189,6 +191,9 @@ $ git add /path/to/file/HelloWorld.c
# Regular Expression support!
$ git add ./*.java
+
+# You can also add everything in your working directory to the staging area.
+$ git add -A
```
This only adds a file to the staging area/index, it doesn't commit it to the
@@ -226,7 +231,7 @@ Manage your tags
$ git tag
# Create a annotated tag
-# The -m specifies a tagging message,which is stored with the tag.
+# The -m specifies a tagging message, which is stored with the tag.
# If you don’t specify a message for an annotated tag,
# Git launches your editor so you can type it in.
$ git tag -a v2.0 -m 'my version 2.0'
@@ -427,7 +432,7 @@ Stashing takes the dirty state of your working directory and saves it on a
stack of unfinished changes that you can reapply at any time.
Let's say you've been doing some work in your git repo, but you want to pull
-from the remote. Since you have dirty (uncommited) changes to some files, you
+from the remote. Since you have dirty (uncommitted) changes to some files, you
are not able to run `git pull`. Instead, you can run `git stash` to save your
changes onto a stack!
@@ -516,7 +521,7 @@ $ git reset --hard
$ git reset 31f2bb1
# Moves the current branch tip backward to the specified commit
-# and makes the working dir match (deletes uncommited changes and all commits
+# and makes the working dir match (deletes uncommitted changes and all commits
# after the specified commit).
$ git reset --hard 31f2bb1
```
@@ -526,12 +531,13 @@ $ git reset --hard 31f2bb1
Reflog will list most of the git commands you have done for a given time period,
default 90 days.
-This give you the a change to reverse any git commands that have gone wrong
-for instance if a rebase is has broken your application.
+This give you the chance to reverse any git commands that have gone wrong
+(for instance, if a rebase has broken your application).
You can do this:
1. `git reflog` to list all of the git commands for the rebase
+
```
38b323f HEAD@{0}: rebase -i (finish): returning to refs/heads/feature/add_git_reflog
38b323f HEAD@{1}: rebase -i (pick): Clarify inc/dec operators
diff --git a/go.html.markdown b/go.html.markdown
index 50692f9c..e5263cf6 100644
--- a/go.html.markdown
+++ b/go.html.markdown
@@ -99,7 +99,7 @@ can include line breaks.` // Same string type.
// Arrays have size fixed at compile time.
var a4 [4]int // An array of 4 ints, initialized to all 0.
- a5 := [...]int{3, 1, 5, 10, 100} // An array initialized with a fixed size of fize
+ a5 := [...]int{3, 1, 5, 10, 100} // An array initialized with a fixed size of five
// elements, with values 3, 1, 5, 10, and 100.
// Slices have dynamic size. Arrays and slices each have advantages
diff --git a/hack.html.markdown b/hack.html.markdown
index b3d19f8e..fb6af8e1 100644
--- a/hack.html.markdown
+++ b/hack.html.markdown
@@ -257,7 +257,7 @@ class InvalidFooSubclass extends ConsistentFoo
// ...
}
- // Using the __Override annotation on a non-overriden method will cause a
+ // Using the __Override annotation on a non-overridden method will cause a
// type checker error:
//
// "InvalidFooSubclass::otherMethod() is marked as override; no non-private
@@ -299,7 +299,7 @@ $cat instanceof KittenInterface === true; // True
## More Information
Visit the [Hack language reference](http://docs.hhvm.com/manual/en/hacklangref.php)
-for detailed explainations of the features Hack adds to PHP, or the [official Hack website](http://hacklang.org/)
+for detailed explanations of the features Hack adds to PHP, or the [official Hack website](http://hacklang.org/)
for more general information.
Visit the [official HHVM website](http://hhvm.com/) for HHVM installation instructions.
diff --git a/haml.html.markdown b/haml.html.markdown
index 0948e9ef..5dd4cb6d 100644
--- a/haml.html.markdown
+++ b/haml.html.markdown
@@ -36,7 +36,7 @@ $ haml input_file.haml output_file.html
To write a multi line comment, indent your commented code to be
wrapped by the forward slash
--# This is a silent comment, which means it wont be rendered into the doc at all
+-# This is a silent comment, which means it won't be rendered into the doc at all
/ -------------------------------------------
diff --git a/haxe.html.markdown b/haxe.html.markdown
index 03b3099e..e811031e 100644
--- a/haxe.html.markdown
+++ b/haxe.html.markdown
@@ -466,7 +466,7 @@ class LearnHaxe3{
The untyped keyword operates on entire *blocks* of code, skipping
any type checks that might be otherwise required. This keyword should
be used very sparingly, such as in limited conditionally-compiled
- situations where type checking is a hinderance.
+ situations where type checking is a hindrance.
In general, skipping type checks is *not* recommended. Use the
enum, inheritance, or structural type models in order to help ensure
diff --git a/hy.html.markdown b/hy.html.markdown
index 79c16c23..1287095f 100644
--- a/hy.html.markdown
+++ b/hy.html.markdown
@@ -102,7 +102,7 @@ True ; => True
(apply something-fancy ["My horse" "amazing"] { "mane" "spectacular" })
; anonymous functions are created using `fn' or `lambda' constructs
-; which are similiar to `defn'
+; which are similar to `defn'
(map (fn [x] (* x x)) [1 2 3 4]) ;=> [1 4 9 16]
;; Sequence operations
diff --git a/ja-jp/php-jp.html.markdown b/ja-jp/php-jp.html.markdown
index 112916f4..a02ae56a 100644
--- a/ja-jp/php-jp.html.markdown
+++ b/ja-jp/php-jp.html.markdown
@@ -119,7 +119,7 @@ echo 'Multiple', 'Parameters', 'Valid';
define("FOO", "something");
// 定義した名前をそのまま($はつけずに)使用することで、定数にアクセスできます
-// access to a constant is possible by direct using the choosen name
+// access to a constant is possible by direct using the chosen name
echo 'This outputs '.FOO;
diff --git a/java.html.markdown b/java.html.markdown
index a27a68ca..fa1ff3d1 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -57,7 +57,7 @@ public class LearnJava {
///////////////////////////////////////
/*
- * Ouput
+ * Output
*/
// Use System.out.println() to print lines.
diff --git a/json.html.markdown b/json.html.markdown
index a612cffe..cd42d42d 100644
--- a/json.html.markdown
+++ b/json.html.markdown
@@ -11,6 +11,7 @@ contributors:
JSON is an extremely simple data-interchange format. As [json.org](http://json.org) says, it is easy for humans to read and write and for machines to parse and generate.
A piece of JSON must represent either:
+
* A collection of name/value pairs (`{ }`). In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
* An ordered list of values (`[ ]`). In various languages, this is realized as an array, vector, list, or sequence.
an array/list/sequence (`[ ]`) or a dictionary/object/associated array (`{ }`).
diff --git a/kdb+.html.markdown b/kdb+.html.markdown
index 099d1529..5ae86a4f 100644
--- a/kdb+.html.markdown
+++ b/kdb+.html.markdown
@@ -6,7 +6,7 @@ contributors:
filename: learnkdb.q
---
-The q langauge and its database component kdb+ were developed by Arthur Whitney
+The q language and its database component kdb+ were developed by Arthur Whitney
and released by Kx systems in 2003. q is a descendant of APL and as such is
very terse and a little strange looking for anyone from a "C heritage" language
background. Its expressiveness and vector oriented nature make it well suited
@@ -301,7 +301,7 @@ l:1+til 9 / til is a useful shortcut for generating ranges
-5#l / => 5 6 7 8 9
/ drop the last 5
-5_l / => 1 2 3 4
-/ find the first occurance of 4
+/ find the first occurrence of 4
l?4 / => 3
l[3] / => 4
@@ -316,7 +316,7 @@ key d / => `a`b`c
/ and value the second
value d / => 1 2 3
-/ Indexing is indentical to lists
+/ Indexing is identical to lists
/ with the first list as a key instead of the position
d[`a] / => 1
d[`b] / => 2
@@ -406,7 +406,7 @@ k!t
/ We can also use this shortcut for defining keyed tables
kt:([id:1 2 3]c1:1 2 3;c2:4 5 6;c3:7 8 9)
-/ Records can then be retreived based on this key
+/ Records can then be retrieved based on this key
kt[1]
/ => c1| 1
/ => c2| 4
@@ -428,7 +428,7 @@ kt[`id!1]
f:{x+x}
f[2] / => 4
-/ Functions can be annonymous and called at point of definition
+/ Functions can be anonymous and called at point of definition
{x+x}[2] / => 4
/ By default the last expression is returned
@@ -440,7 +440,7 @@ f[2] / => 4
/ Function arguments can be specified explicitly (separated by ;)
{[arg1;arg2] arg1+arg2}[1;2] / => 3
-/ or if ommited will default to x, y and z
+/ or if omitted will default to x, y and z
{x+y+z}[1;2;3] / => 6
/ Built in functions are no different, and can be called the same way (with [])
@@ -472,7 +472,7 @@ a / => 1
/ Functions cannot see nested scopes (only local and global)
{local:1;{:local}[]}[] / throws error as local is not defined in inner function
-/ A function can have one or more of it's arguments fixed (projection)
+/ A function can have one or more of its arguments fixed (projection)
f:+[4]
f[4] / => 8
f[5] / => 9
@@ -483,7 +483,7 @@ f[6] / => 10
////////// q-sql //////////
////////////////////////////////////
-/ q has it's own syntax for manipulating tables, similar to standard SQL
+/ q has its own syntax for manipulating tables, similar to standard SQL
/ This contains the usual suspects of select, insert, update etc.
/ and some new functionality not typically available
/ q-sql has two significant differences (other than syntax) to normal SQL:
@@ -682,7 +682,7 @@ aj[`time`sym;trades;quotes]
/ where possible functionality should be vectorized (i.e. operations on lists)
/ adverbs supplement this, modifying the behaviour of functions
/ and providing loop type functionality when required
-/ (in q functions are sometimes refered to as verbs, hence adverbs)
+/ (in q functions are sometimes referred to as verbs, hence adverbs)
/ the "each" adverb modifies a function to treat a list as individual variables
first each (1 2 3;4 5 6;7 8 9)
/ => 1 4 7
@@ -762,7 +762,7 @@ select from splayed / (the columns are read from disk on request)
/ kdb+ is typically used for data capture and analysis.
/ This involves using an architecture with multiple processes
/ working together. kdb+ frameworks are available to streamline the setup
-/ and configuration of this architecuture and add additional functionality
+/ and configuration of this architecture and add additional functionality
/ such as disaster recovery, logging, access, load balancing etc.
/ https://github.com/AquaQAnalytics/TorQ
```
diff --git a/kotlin.html.markdown b/kotlin.html.markdown
index ca11ee3c..0c787d7e 100644
--- a/kotlin.html.markdown
+++ b/kotlin.html.markdown
@@ -65,7 +65,7 @@ fun helloWorld(val name : String) {
A template expression starts with a dollar sign ($).
*/
val fooTemplateString = "$fooString has ${fooString.length} characters"
- println(fooTemplateString)
+ println(fooTemplateString) // => My String Is Here! has 18 characters
/*
For a variable to hold null it must be explicitly specified as nullable.
diff --git a/lfe.html.markdown b/lfe.html.markdown
new file mode 100644
index 00000000..413de36e
--- /dev/null
+++ b/lfe.html.markdown
@@ -0,0 +1,459 @@
+---
+
+language: "Lisp Flavoured Erlang(LFE)"
+filename: lispflavourederlang.lfe
+contributors:
+ - ["Pratik Karki", "https://github.com/prertik"]
+---
+
+Lisp Flavoured Erlang(LFE) is a functional, concurrent, general-purpose programming
+language and Lisp dialect(Lisp-2) built on top of Core Erlang and the Erlang Virtual Machine(BEAM).
+
+LFE can be obtained from [LFE](https://github.com/rvirding/lfe)
+
+The classic starting point is [LFE DOCS.](http://docs.lfe.io)
+
+Another new site is being built to replace it.[LFE DEV.](http://docs.lfe.io/dev)
+
+
+
+```lisp
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; 0. Syntax
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;; General form.
+
+;; Lisp comprises of two syntax called: the ATOM and the S-expression.
+;; `forms` are known as grouped S-expressions.
+
+8 ; an atom; it evaluates to itself
+
+:ERLANG ;Atom; evaluates to the symbol :ERLANG.
+
+t ; another atom which denotes true.
+
+(* 2 21) ; an S- expression
+
+'(8 :foo t) ;another one
+
+
+;;; Comments
+
+;; Single line comments start with a semicolon; use two for normal
+;; comments, three for section comments, and four fo file-level
+;; comments.
+
+;; Block Comment
+
+ #| comment text |#
+
+;;; Environment
+
+;; LFE is the de-facto standard.
+
+;; Libraries can be used directly from the Erlang ecosystem. Rebar3 is the build tool.
+
+;; LFE is usually developed with a text editor(preferably Emacs) and a REPL
+;; (Read Evaluate Print Loop) running at the same time. The REPL
+;; allows for interactive exploration of the program as it is "live"
+;; in the system.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; 1. Literals and Special Syntactic Rules
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;; Integers
+
+1234 -123 ; Regular decimal notation
+#b0 #b10101 ; Binary notation
+#0 #10101 ; Binary notation (alternative form)
+#o377 #o-111 ; Octal notation
+#d123456789 #d+123 ; Explicitly decimal notation
+#xc0ffe 0x-01 ; Hexadecimal notation
+#2r1010 #8r377 ;Notation with explicit base (up to 36)
+#\a #$ #\ä #\🐭 ;Character notation (the value is the Unicode code point of the character)
+#\x1f42d; ;Character notation with the value in hexadecimal
+
+;;; Floating point numbers
+1.0 +2.0 -1.5 1.0e10 1.111e-10
+
+;;; Strings
+
+"any text between double quotes where \" and other special characters like \n can be escaped".
+; List String
+"Cat: \x1f639;" ; writing unicode in string for regular font ending with semicolon.
+
+#"This is a binary string \n with some \"escaped\" and quoted (\x1f639;) characters"
+; Binary strings are just strings but function different in the VM.
+; Other ways of writing it are: #B("a"), #"a", and #B(97).
+
+
+;;; Character escaping
+
+\b ; => Backspace
+\t ; => Tab
+\n ; => Newline
+\v ; => Vertical tab
+\f ; => Form Feed
+\r ; => Carriage Return
+\e ; => Escape
+\s ; => Space
+\d ; => Delete
+
+;;; Binaries
+;; It is used to create binaries with any contents.
+#B((#"a" binary) (#"b" binary)) ; #"ab" (Evaluated form)
+
+;;; Lists are: () or (foo bar baz)
+
+;;; Tuples are written in: #(value1 value2 ...). Empty tuple #() is also valid.
+
+;;; Maps are written as: #M(key1 value1 key2 value2 ...). Empty map #M() is also valid.
+
+;;; Symbols: Things that cannot be parsed. Eg: foo, Foo, foo-bar, :foo
+| foo | ; explicit construction of symbol by wrapping vertical bars.
+
+;;; Evaluation
+
+;; #.(... some expression ...). E.g. '#.(+ 1 1) will evaluate the (+ 1 1) while it ;; reads the expression and then be effectively '2.
+
+;; List comprehension in LFE REPL
+
+lfe> (list-comp
+ ((<- x '(0 1 2 3)))
+ (trunc (math:pow 3 x)))
+ (1 3 9 27)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 2. Core forms
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; These forms are same as those found at Common Lisp and Scheme.
+
+(quote e)
+(cons head tail)
+(car e)
+(cdr e)
+(list e ... )
+(tuple e ... )
+(binary seg ... )
+(map key val ...), (map-get m k), (map-set m k v ...), (map-update m k v ...)
+
+(lambda (arg ...) ...)
+ (match-lambda
+ ((arg ... ) {{(when e ...)}} ...) ; Matches clauses
+ ... )
+(let ((pat {{(when e ...)}} e)
+ ...)
+ ... )
+(let-function ((name lambda|match-lambda) ; Only define local
+ ... ) ; functions
+ ... )
+(letrec-function ((name lambda|match-lambda) ; Only define local
+ ... ) ; functions
+ ... )
+(let-macro ((name lambda-match-lambda) ; Only define local
+ ...) ; macros
+ ...)
+(progn ... )
+(if test true-expr {{false-expr}})
+(case e
+ (pat {{(when e ...)}} ...)
+ ... ))
+(receive
+ (pat {{(when e ...)}} ... )
+ ...
+ (after timeout ... ))
+(catch ... )
+(try
+ e
+ {{(case ((pat {{(when e ...)}} ... )
+ ... ))}}
+ {{(catch
+ ; Next must be tuple of length 3!
+ (((tuple type value ignore) {{(when e ...)}}
+ ... )
+ ... )}}
+ {{(after ... )}})
+
+(funcall func arg ... )
+(call mod func arg ... ) - Call to Erlang Mod:Func(Arg, ... )
+(define-module name declaration ... )
+(extend-module declaration ... ) - Define/extend module and declarations.
+(define-function name lambda|match-lambda)
+(define-macro name lambda|match-lambda) - Define functions/macros at top-level.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 3. Macros
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Macros are part of the language to allow you to create abstractions
+;; on top of the core language and standard library that move you closer
+;; toward being able to directly express the things you want to express.
+
+;; Top-level function
+
+(defun name (arg ...) ...)
+
+;; Adding comments in functions
+
+(defun name
+ "Toplevel function with pattern-matching arguments"
+ ((argpat ...) ...)
+ ...)
+
+;; Top-level macro
+
+(defmacro name (arg ...) ...)
+(defmacro name arg ...)
+
+;; Top-level macro with pattern matching arguments
+
+(defmacro name
+ ((argpat ...) ...)
+ ...)
+
+;; Top-level macro using Scheme inspired syntax-rules format
+
+(defsyntax name
+ (pat exp)
+ ...)
+
+;;; Local macros in macro or syntax-rule format
+
+(macrolet ((name (arg ... ) ... )
+ ... )
+ ... )
+
+(syntaxlet ((name (pat exp) ...)
+ ...)
+ ...)
+
+;; Like CLISP
+
+(prog1 ...)
+(prog2 ...)
+
+;; Erlang LFE module
+
+(defmodule name ...)
+
+;; Erlang LFE record
+
+(defrecord name ...)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 4. Patterns and Guards
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Using patterns in LFE compared to that of Erlang
+
+;; Erlang ;; LFE
+;; {ok, X} (tuple 'ok x)
+;; error 'error
+;; {yes, [X|Xs]} (tuple 'yes (cons x xs))
+;; <<34,F/float>> (binary 34 (f float))
+;; [P|Ps]=All (= (cons p ps) all)
+
+ _ ; => is don't care while pattern matching
+
+ (= pattern1 pattern2) ; => easier, better version of pattern matching
+
+;; Guards
+
+;; Whenever pattern occurs(let, case, receive, lc, etc) it can be followed by an optional
+;; guard which has the form (when test ...).
+
+(progn gtest ...) ;; => Sequence of guard tests
+(if gexpr gexpr gexpr)
+(type-test e)
+(guard-bif ...) ;; => Guard BIFs, arithmetic, boolean and comparison operators
+
+;;; REPL
+
+lfe>(set (tuple len status msg) #(8 ok "Trillian"))
+ #(8 ok "Trillian")
+lfe>msg
+ "Trillian"
+
+;;; Program illustrating use of Guards
+
+(defun right-number?
+ ((x) (when (orelse (== x 42) (== x 276709)))
+ 'true)
+ ((_) 'false))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 5. Functions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; A simple function using if.
+
+(defun max (x y)
+ "The max function."
+ (if (>= x y) x y))
+
+;; Same function using more clause
+
+(defun max
+ "The max function."
+ ((x y) (when (>= x y)) x)
+ ((x y) y))
+
+;; Same function using similar style but using local functions defined by flet or fletrec
+
+(defun foo (x y)
+ "The max function."
+ (flet ((m (a b) "Local comment."
+ (if (>= a b) a b)))
+ (m x y)))
+
+;; LFE being Lisp-2 has separate namespaces for variables and functions
+;; Both variables and function/macros are lexically scoped.
+;; Variables are bound by lambda, match-lambda and let.
+;; Functions are bound by top-level defun, flet and fletrec.
+;; Macros are bound by top-level defmacro/defsyntax and by macrolet/syntaxlet.
+
+;; (funcall func arg ...) like CL to call lambdas/match-lambdas
+;; (funs) bound to variables are used.
+
+;; separate bindings and special for apply.
+apply _F (...),
+apply _F/3 ( a1, a2, a3 )
+
+;; Cons'ing in function heads
+(defun sum (l) (sum l 0))
+ (defun sum
+ (('() total) total)
+ (((cons h t) total) (sum t (+ h total))))
+
+;; ``cons`` literal instead of constructor form
+ (defun sum (l) (sum l 0))
+ (defun sum
+ (('() total) total)
+ ((`(,h . ,t) total) (sum t (+ h total))))
+
+;; Matching records in function heads
+
+(defun handle_info
+ (('ping (= (match-state remote-pid 'undefined) state))
+ (gen_server:cast (self) 'ping)
+ `#(noreply ,state))
+ (('ping state)
+ `#(noreply ,state)))
+
+;; Receiving Messages
+ (defun universal-server ()
+ (receive
+ ((tuple 'become func)
+ (funcall func))))
+
+;; another way for receiving messages
+
+ (defun universal-server ()
+ (receive
+ (`#(become ,func)
+ (funcall func))))
+
+;; Composing a complete function for specific tasks
+
+(defun compose (f g)
+ (lambda (x)
+ (funcall f
+ (funcall g x))))
+
+(defun check ()
+ (let* ((sin-asin (compose #'sin/1 #'asin/1))
+ (expected (sin (asin 0.5)))
+ (compose-result (funcall sin-asin 0.5)))
+ (io:format "Expected answer: ~p~n" (list expected))
+ (io:format "Answer with compose: ~p~n" (list compose-result))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 6. Concurrency
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Message passing as done by Erlang's light-weight "processes".
+
+(defmodule messenger-back
+ (export (print-result 0) (send-message 2)))
+
+(defun print-result ()
+ (receive
+ ((tuple pid msg)
+ (io:format "Received message: '~s'~n" (list msg))
+ (io:format "Sending message to process ~p ...~n" (list pid))
+ (! pid (tuple msg))
+ (print-result))))
+
+(defun send-message (calling-pid msg)
+ (let ((spawned-pid (spawn 'messenger-back 'print-result ())))
+ (! spawned-pid (tuple calling-pid msg))))
+
+;; Multiple simultaneous HTTP Requests:
+
+(defun parse-args (flag)
+ "Given one or more command-line arguments, extract the passed values.
+
+ For example, if the following was passed via the command line:
+
+ $ erl -my-flag my-value-1 -my-flag my-value-2
+
+ One could then extract it in an LFE program by calling this function:
+
+ (let ((args (parse-args 'my-flag)))
+ ...
+ )
+ In this example, the value assigned to the arg variable would be a list
+ containing the values my-value-1 and my-value-2."
+ (let ((`#(ok ,data) (init:get_argument flag)))
+ (lists:merge data)))
+
+(defun get-pages ()
+ "With no argument, assume 'url parameter was passed via command line."
+ (let ((urls (parse-args 'url)))
+ (get-pages urls)))
+
+(defun get-pages (urls)
+ "Start inets and make (potentially many) HTTP requests."
+ (inets:start)
+ (plists:map
+ (lambda (x)
+ (get-page x)) urls))
+
+(defun get-page (url)
+ "Make a single HTTP request."
+ (let* ((method 'get)
+ (headers '())
+ (request-data `#(,url ,headers))
+ (http-options ())
+ (request-options '(#(sync false))))
+ (httpc:request method request-data http-options request-options)
+ (receive
+ (`#(http #(,request-id #(error ,reason)))
+ (io:format "Error: ~p~n" `(,reason)))
+ (`#(http #(,request-id ,result))
+ (io:format "Result: ~p~n" `(,result))))))
+
+
+;; Check out Erlang's documentation for more concurrency and OTP docs.
+```
+
+## Further Reading
+
+* [LFE DOCS](http://docs.lfe.io)
+* [LFE GitBook](https://lfe.gitbooks.io/reference-guide/index.html)
+* [LFE Wiki](https://en.wikipedia.org/wiki/LFE_(programming_language))
+
+## Extra Info
+* [LFE PDF](http://www.erlang-factory.com/upload/presentations/61/Robertvirding-LispFlavouredErlang.pdf)
+* [LFE mail](https://groups.google.com/d/msg/lisp-flavoured-erlang/XA5HeLbQQDk/TUHabZCHXB0J)
+
+## Credits
+
+Lots of thanks to Robert Virding for creating LFE, Duncan McGreggor for documenting it and other LFE contributors who made LFE awesome.
+
diff --git a/matlab.html.markdown b/matlab.html.markdown
index 86b116c6..6dc9f697 100644
--- a/matlab.html.markdown
+++ b/matlab.html.markdown
@@ -353,7 +353,7 @@ double_input(6) % ans = 12
% anonymous function. Useful when quickly defining a function to pass to
% another function (eg. plot with fplot, evaluate an indefinite integral
% with quad, find roots with fzero, or find minimum with fminsearch).
-% Example that returns the square of it's input, assigned to the handle sqr:
+% Example that returns the square of its input, assigned to the handle sqr:
sqr = @(x) x.^2;
sqr(10) % ans = 100
doc function_handle % find out more
diff --git a/nim.html.markdown b/nim.html.markdown
index 5d00304d..07674532 100644
--- a/nim.html.markdown
+++ b/nim.html.markdown
@@ -76,7 +76,7 @@ let myDrink = drinks[2]
# static typing powerful and useful.
type
- Name = string # A type alias gives you a new type that is interchangable
+ Name = string # A type alias gives you a new type that is interchangeable
Age = int # with the old type but is more descriptive.
Person = tuple[name: Name, age: Age] # Define data structures too.
AnotherSyntax = tuple
@@ -109,7 +109,7 @@ when compileBadCode:
type
Color = enum cRed, cBlue, cGreen
- Direction = enum # Alternative formating
+ Direction = enum # Alternative formatting
dNorth
dWest
dEast
diff --git a/objective-c.html.markdown b/objective-c.html.markdown
index 2b599378..04c4e529 100644
--- a/objective-c.html.markdown
+++ b/objective-c.html.markdown
@@ -786,7 +786,7 @@ MyClass *newVar = [classVar retain]; // If classVar is released, object is still
// Automatic Reference Counting (ARC)
// Because memory management can be a pain, Xcode 4.2 and iOS 4 introduced Automatic Reference Counting (ARC).
// ARC is a compiler feature that inserts retain, release, and autorelease automatically for you, so when using ARC,
-// you must not use retain, relase, or autorelease
+// you must not use retain, release, or autorelease
MyClass *arcMyClass = [[MyClass alloc] init];
// ... code using arcMyClass
// Without ARC, you will need to call: [arcMyClass release] after you're done using arcMyClass. But with ARC,
diff --git a/perl6.html.markdown b/perl6.html.markdown
index 44960347..18326338 100644
--- a/perl6.html.markdown
+++ b/perl6.html.markdown
@@ -447,7 +447,7 @@ False ~~ True; # True
# http://perlcabal.org/syn/S03.html#Smart_matching
# You also, of course, have `<`, `<=`, `>`, `>=`.
-# Their string equivalent are also avaiable : `lt`, `le`, `gt`, `ge`.
+# Their string equivalent are also available : `lt`, `le`, `gt`, `ge`.
3 > 4;
## * Range constructors
@@ -618,7 +618,7 @@ my @arrayplus3 = map(*+3, @array); # `*+3` is the same as `{ $_ + 3 }`
my @arrayplus3 = map(*+*+3, @array); # Same as `-> $a, $b { $a + $b + 3 }`
# also `sub ($a, $b) { $a + $b + 3 }`
say (*/2)(4); #=> 2
- # Immediatly execute the function Whatever created.
+ # Immediately execute the function Whatever created.
say ((*+3)/5)(5); #=> 1.6
# works even in parens !
@@ -750,7 +750,7 @@ sub call_say_dyn {
my $*dyn_scoped_1 = 25; # Defines $*dyn_scoped_1 only for this sub.
$*dyn_scoped_2 = 100; # Will change the value of the file scoped variable.
say_dyn(); #=> 25 100 $*dyn_scoped 1 and 2 will be looked for in the call.
- # It uses he value of $*dyn_scoped_1 from inside this sub's lexical
+ # It uses the value of $*dyn_scoped_1 from inside this sub's lexical
# scope even though the blocks aren't nested (they're call-nested).
}
say_dyn(); #=> 1 10
@@ -816,7 +816,7 @@ $class-obj.other-attrib = 10; # This, however, works, because the public
# Perl 6 also has inheritance (along with multiple inheritance)
# While `method`'s are inherited, `submethod`'s are not.
# Submethods are useful for object construction and destruction tasks,
-# such as BUILD, or methods that must be overriden by subtypes.
+# such as BUILD, or methods that must be overridden by subtypes.
# We will learn about BUILD later on.
class Parent {
@@ -840,7 +840,7 @@ $Richard.talk; #=> "Hi, my name is Richard"
# # $Richard is able to access the submethod, he knows how to say his name.
my Child $Madison .= new(age => 1, name => 'Madison');
-$Madison.talk; # prints "Goo goo ga ga" due to the overrided method.
+$Madison.talk; # prints "Goo goo ga ga" due to the overridden method.
# $Madison.favorite-color does not work since it is not inherited
# When you use `my T $var`, `$var` starts off with `T` itself in it,
@@ -1054,7 +1054,7 @@ say why-not[^5]; #=> 5 15 25 35 45
## * `state` (happens at run time, but only once)
# State variables are only initialized one time
-# (they exist in other langages such as C as `static`)
+# (they exist in other languages such as C as `static`)
sub fixed-rand {
state $val = rand;
say $val;
@@ -1105,7 +1105,7 @@ PRE {
say "If this block doesn't return a truthy value,
an exception of type X::Phaser::PrePost is thrown.";
}
-# exemple:
+# example:
for 0..2 {
PRE { $_ > 1 } # This is going to blow up with "Precondition failed"
}
@@ -1204,7 +1204,7 @@ say (1, 10, (20, 10) ).flat; #> (1 10 20 10) Now the iterable is flat
# - `lazy` - Defer actual evaluation until value is fetched (forces lazy context)
my @lazy-array = (1..100).lazy;
-say @lazy-array.is-lazy; #> True # Check for lazyness with the `is-lazy` method.
+say @lazy-array.is-lazy; #> True # Check for laziness with the `is-lazy` method.
say @lazy-array; #> [...] List has not been iterated on!
my @lazy-array { .print }; # This works and will only do as much work as is
# needed.
@@ -1599,7 +1599,7 @@ so 'ayc' ~~ / a [ b | y ] c /; # `True`. Obviously enough ...
# To decide which part is the "longest", it first splits the regex in two parts:
# The "declarative prefix" (the part that can be statically analyzed)
# and the procedural parts.
-# Declarative prefixes include alternations (`|`), conjuctions (`&`),
+# Declarative prefixes include alternations (`|`), conjunctions (`&`),
# sub-rule calls (not yet introduced), literals, characters classes and quantifiers.
# The latter include everything else: back-references, code assertions,
# and other things that can't traditionnaly be represented by normal regexps.
@@ -1755,10 +1755,10 @@ If you want to go further, you can:
This will give you a dropdown menu of all the pages referencing your search
term (Much better than using Google to find Perl 6 documents!)
- Read the [Perl 6 Advent Calendar](http://perl6advent.wordpress.com/). This
- is a great source of Perl 6 snippets and explainations. If the docs don't
+ is a great source of Perl 6 snippets and explanations. If the docs don't
describe something well enough, you may find more detailed information here.
This information may be a bit older but there are many great examples and
- explainations. Posts stopped at the end of 2015 when the language was declared
+ explanations. Posts stopped at the end of 2015 when the language was declared
stable and Perl 6.c was released.
- Come along on `#perl6` at `irc.freenode.net`. The folks here are always helpful.
- Check the [source of Perl 6's functions and classes](https://github.com/rakudo/rakudo/tree/nom/src/core). Rakudo is mainly written in Perl 6 (with a lot of NQP, "Not Quite Perl", a Perl 6 subset easier to implement and optimize).
diff --git a/php.html.markdown b/php.html.markdown
index f247ba77..f82cea7d 100644
--- a/php.html.markdown
+++ b/php.html.markdown
@@ -122,9 +122,9 @@ echo 'Multiple', 'Parameters', 'Valid'; // Returns 'MultipleParametersValid'
// followed by any number of letters, numbers, or underscores.
define("FOO", "something");
-// access to a constant is possible by calling the choosen name without a $
+// access to a constant is possible by calling the chosen name without a $
echo FOO; // Returns 'something'
-echo 'This outputs ' . FOO; // Returns 'This ouputs something'
+echo 'This outputs ' . FOO; // Returns 'This outputs something'
@@ -132,9 +132,7 @@ echo 'This outputs ' . FOO; // Returns 'This ouputs something'
* Arrays
*/
-// All arrays in PHP are associative arrays (hashmaps),
-
-// Associative arrays, known as hashmaps in some languages.
+// All arrays in PHP are associative arrays (hashmaps in some languages)
// Works with all PHP versions
$associative = array('One' => 1, 'Two' => 2, 'Three' => 3);
@@ -839,7 +837,7 @@ try {
// Handle exception
}
-// When using try catch blocks in a namespaced enviroment use the following
+// When using try catch blocks in a namespaced environment use the following
try {
// Do something
@@ -856,7 +854,7 @@ try {
$condition = true;
if ($condition) {
- throw new MyException('Something just happend');
+ throw new MyException('Something just happened');
}
} catch (MyException $e) {
diff --git a/pl-pl/bf-pl.html.markdown b/pl-pl/bf-pl.html.markdown
index 801f1a9a..c7e1633a 100644
--- a/pl-pl/bf-pl.html.markdown
+++ b/pl-pl/bf-pl.html.markdown
@@ -1,4 +1,5 @@
---
+category: language
language: bf
contributors:
- ["Prajit Ramachandran", "http://prajitr.github.io/"]
@@ -6,6 +7,7 @@ contributors:
translators:
- ["Jakub Młokosiewicz", "https://github.com/hckr"]
lang: pl-pl
+filename: bf-pl.html
---
Brainfuck (pisane małymi literami, za wyjątkiem początku zdania) jest bardzo
diff --git a/pl-pl/haskell-pl.html.markdown b/pl-pl/haskell-pl.html.markdown
index 3a51ade5..034189f5 100644
--- a/pl-pl/haskell-pl.html.markdown
+++ b/pl-pl/haskell-pl.html.markdown
@@ -1,8 +1,12 @@
---
+category: language
language: Haskell
-lang: pl-pl
contributors:
+ - ["Adit Bhargava", "http://adit.io"]
+translators:
- ["Remigiusz Suwalski", "https://github.com/remigiusz-suwalski"]
+lang: pl-pl
+filename: haskell-pl.hs
---
Haskell został zaprojektowany jako praktyczny, czysto funkcyjny język
diff --git a/pl-pl/json-pl.html.markdown b/pl-pl/json-pl.html.markdown
index 872455de..edd059bf 100644
--- a/pl-pl/json-pl.html.markdown
+++ b/pl-pl/json-pl.html.markdown
@@ -1,6 +1,6 @@
---
+category: language
language: json
-filename: learnjson-pl.json
contributors:
- ["Anna Harren", "https://github.com/iirelu"]
- ["Marco Scannadinari", "https://github.com/marcoms"]
@@ -9,6 +9,7 @@ contributors:
translators:
- ["Michał Mitrosz", "https://github.com/Voltinus"]
lang: pl-pl
+filename: learnjson-pl.json
---
JSON to bardzo prosty format wymiany danych. Jak jest napisane na [json.org](http://json.org), jest łatwy do pisania i czytania dla ludzi i do parsowania i generowania dla maszyn.
diff --git a/pl-pl/perl-pl.html.markdown b/pl-pl/perl-pl.html.markdown
index 029ca006..3bac1cbb 100644
--- a/pl-pl/perl-pl.html.markdown
+++ b/pl-pl/perl-pl.html.markdown
@@ -2,11 +2,13 @@
name: perl
category: language
language: perl
-filename: learnperl.pl
contributors:
- ["Korjavin Ivan", "http://github.com/korjavin"]
+ - ["Dan Book", "http://github.com/Grinnz"]
+translators:
- ["Michał Kupczyński", "http://github.com/ukoms"]
lang: pl-pl
+filename: learnperl-pl.pl
---
Perl 5 jest wysoce użytecznym, bogatym w wiele opcji językiem programowania
diff --git a/pt-br/c-pt.html.markdown b/pt-br/c-pt.html.markdown
index 0af553c8..6e7aa8c2 100644
--- a/pt-br/c-pt.html.markdown
+++ b/pt-br/c-pt.html.markdown
@@ -647,7 +647,7 @@ Se você tem uma pergunta, leia [compl.lang.c Frequently Asked Questions](http:/
É importante usar espaços e indentação adequadamente e ser consistente com seu estilo de código em geral.
Código legível é melhor que código 'esperto' e rápido. Para adotar um estilo de código bom e são, veja
-[Linux kernel coding stlye](https://www.kernel.org/doc/Documentation/CodingStyle).
+[Linux kernel coding style](https://www.kernel.org/doc/Documentation/CodingStyle).
Além disso, Google é teu amigo.
[1] http://stackoverflow.com/questions/119123/why-isnt-sizeof-for-a-struct-equal-to-the-sum-of-sizeof-of-each-member
diff --git a/pythonstatcomp.html.markdown b/pythonstatcomp.html.markdown
index 8ee3aa64..79bbcd8d 100644
--- a/pythonstatcomp.html.markdown
+++ b/pythonstatcomp.html.markdown
@@ -104,7 +104,7 @@ import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
-# To do data vizualization in Python, use matplotlib
+# To do data visualization in Python, use matplotlib
plt.hist(pets.age);
diff --git a/qt.html.markdown b/qt.html.markdown
index a9c855a6..64e36e2e 100644
--- a/qt.html.markdown
+++ b/qt.html.markdown
@@ -14,7 +14,7 @@ lang: en
```c++
/*
- * Let's start clasically
+ * Let's start classically
*/
// all headers from Qt framework start with capital letter 'Q'
@@ -79,7 +79,7 @@ int main(int argc, char *argv[]) {
Notice that *QObject::connect* part. This method is used to connect *SIGNALS* of one objects to *SLOTS* of another.
-**Signals** are being emited when certain things happen with objects, like *pressed* signal is emited when user presses on QPushButton object.
+**Signals** are being emitted when certain things happen with objects, like *pressed* signal is emitted when user presses on QPushButton object.
**Slots** are *actions* that might be performed in response to received signals.
diff --git a/r.html.markdown b/r.html.markdown
index 8539b10e..7a94ba05 100644
--- a/r.html.markdown
+++ b/r.html.markdown
@@ -192,7 +192,7 @@ class(-Inf) # "numeric"
2.0 * 2L # 4 # numeric times integer gives numeric
3L / 4 # 0.75 # integer over numeric gives numeric
3 %% 2 # 1 # the remainder of two numerics is another numeric
-# Illegal arithmetic yeilds you a "not-a-number":
+# Illegal arithmetic yields you a "not-a-number":
0 / 0 # NaN
class(NaN) # "numeric"
# You can do arithmetic on two vectors with length greater than 1,
@@ -662,7 +662,7 @@ require(plyr)
#########################
# "pets.csv" is a file on the internet
-# (but it could just as easily be be a file on your own computer)
+# (but it could just as easily be a file on your own computer)
pets <- read.csv("http://learnxinyminutes.com/docs/pets.csv")
pets
head(pets, 2) # first two rows
diff --git a/red.html.markdown b/red.html.markdown
index 5f6ffc86..3575032f 100644
--- a/red.html.markdown
+++ b/red.html.markdown
@@ -51,7 +51,7 @@ comment {
; no need to restrict this to a 'main' function.
; Valid variable names start with a letter and can contain numbers,
-; variables containing only capital A thru F and numbers and ending with 'h'
+; variables containing only capital A through F and numbers and ending with 'h'
; are forbidden, because that is how hexadecimal numbers are expressed in Red
; and Red/System.
diff --git a/ru-ru/c++-ru.html.markdown b/ru-ru/c++-ru.html.markdown
index cef5ab7e..b9704fc3 100644
--- a/ru-ru/c++-ru.html.markdown
+++ b/ru-ru/c++-ru.html.markdown
@@ -853,7 +853,7 @@ pt2 = nullptr; // Устанавливает pt2 в null.
// '=' != '=' != '='!
// Вызывает Foo::Foo(const Foo&) или некий вариант (смотрите "move semantics")
-// копирования конструктора.
+// конструктора копирования.
Foo f2;
Foo f1 = f2;
diff --git a/ru-ru/c-ru.html.markdown b/ru-ru/c-ru.html.markdown
index 71e41ee3..44e7ad3b 100644
--- a/ru-ru/c-ru.html.markdown
+++ b/ru-ru/c-ru.html.markdown
@@ -477,7 +477,7 @@ void str_reverse_through_pointer(char *str_in) {
Очень важно использовать правильные отступы и ставить пробелы в нужных местах.
Читаемый код лучше чем красивый или быстрый код.
-Чтобы научиться писать хороший код, почитайте [Linux kernel coding stlye](https://www.kernel.org/doc/Documentation/CodingStyle).
+Чтобы научиться писать хороший код, почитайте [Linux kernel coding style](https://www.kernel.org/doc/Documentation/CodingStyle).
Также не забывайте, что [Google](http://google.com) и [Яндекс](http://yandex.ru) – ваши хорошие друзья.
diff --git a/ru-ru/elixir-ru.html.markdown b/ru-ru/elixir-ru.html.markdown
new file mode 100644
index 00000000..c8c2c060
--- /dev/null
+++ b/ru-ru/elixir-ru.html.markdown
@@ -0,0 +1,467 @@
+---
+language: elixir
+contributors:
+ - ["Joao Marques", "http://github.com/mrshankly"]
+ - ["Dzianis Dashkevich", "https://github.com/dskecse"]
+ - ["Ryan Plant", "https://github.com/ryanplant-au"]
+translator:
+ - ["Ev Bogdanov", "https://github.com/evbogdanov"]
+filename: learnelixir-ru.ex
+lang: ru-ru
+---
+
+Elixir — современный функциональный язык программирования, который работает на
+виртуальной машине Erlang. Elixir полностью совместим с Erlang, но обладает
+дружелюбным синтаксисом и предлагает больше возможностей.
+
+```elixir
+
+# Однострочные комментарии начинаются с символа решётки.
+
+# Для многострочных комментариев отдельного синтаксиса нет,
+# поэтому просто используйте несколько однострочных комментариев.
+
+# Запустить интерактивную Elixir-консоль (аналог `irb` в Ruby) можно
+# при помощи команды `iex`.
+# Чтобы скомпилировать модуль, воспользуйтесь командой `elixirc`.
+
+# Обе команды будут работать из терминала, если вы правильно установили Elixir.
+
+## ---------------------------
+## -- Базовые типы
+## ---------------------------
+
+# Числа
+3 # целое число
+0x1F # целое число
+3.0 # число с плавающей запятой
+
+# Атомы, которые являются нечисловыми константами. Они начинаются с символа `:`.
+:hello # атом
+
+# Кортежи, которые хранятся в памяти последовательно.
+{1,2,3} # кортеж
+
+# Получить доступ к элементу кортежа мы можем с помощью функции `elem`:
+elem({1, 2, 3}, 0) #=> 1
+
+# Списки, которые реализованы как связные списки.
+[1,2,3] # список
+
+# У каждого непустого списка есть голова (первый элемент списка)
+# и хвост (все остальные элементы списка):
+[head | tail] = [1,2,3]
+head #=> 1
+tail #=> [2,3]
+
+# В Elixir, как и в Erlang, знак `=` служит для сопоставления с образцом,
+# а не для операции присваивания.
+#
+# Это означает, что выражение слева от знака `=` (образец) сопоставляется с
+# выражением справа.
+#
+# Сопоставление с образцом позволило нам получить голову и хвост списка
+# в примере выше.
+
+# Если выражения слева и справа от знака `=` не удаётся сопоставить, будет
+# брошена ошибка. Например, если кортежи разных размеров.
+{a, b, c} = {1, 2} #=> ** (MatchError)
+
+# Бинарные данные
+<<1,2,3>>
+
+# Вы столкнётесь с двумя видами строк:
+"hello" # Elixir-строка (заключена в двойные кавычки)
+'hello' # Erlang-строка (заключена в одинарные кавычки)
+
+# Все строки представлены в кодировке UTF-8:
+"привет" #=> "привет"
+
+# Многострочный текст
+"""
+Я текст на несколько
+строк.
+"""
+#=> "Я текст на несколько\nстрок.\n"
+
+# Чем Elixir-строки отличаются от Erlang-строк? Elixir-строки являются бинарными
+# данными.
+<<?a, ?b, ?c>> #=> "abc"
+# Erlang-строка — это на самом деле список.
+[?a, ?b, ?c] #=> 'abc'
+
+# Оператор `?` возвращает целое число, соответствующее данному символу.
+?a #=> 97
+
+# Для объединения бинарных данных (и Elixir-строк) используйте `<>`
+<<1,2,3>> <> <<4,5>> #=> <<1,2,3,4,5>>
+"hello " <> "world" #=> "hello world"
+
+# Для объединения списков (и Erlang-строк) используйте `++`
+[1,2,3] ++ [4,5] #=> [1,2,3,4,5]
+'hello ' ++ 'world' #=> 'hello world'
+
+# Диапазоны записываются как `начало..конец` (оба включительно)
+1..10 #=> 1..10
+
+# Сопоставление с образцом применимо и для диапазонов:
+lower..upper = 1..10
+[lower, upper] #=> [1, 10]
+
+# Карты (известны вам по другим языкам как ассоциативные массивы, словари, хэши)
+genders = %{"david" => "male", "gillian" => "female"}
+genders["david"] #=> "male"
+
+# Для карт, где ключами выступают атомы, доступен специальный синтаксис
+genders = %{david: "male", gillian: "female"}
+genders.gillian #=> "female"
+
+## ---------------------------
+## -- Операторы
+## ---------------------------
+
+# Математические операции
+1 + 1 #=> 2
+10 - 5 #=> 5
+5 * 2 #=> 10
+10 / 2 #=> 5.0
+
+# В Elixir оператор `/` всегда возвращает число с плавающей запятой.
+
+# Для целочисленного деления применяйте `div`
+div(10, 2) #=> 5
+
+# Для получения остатка от деления к вашим услугам `rem`
+rem(10, 3) #=> 1
+
+# Булевые операторы: `or`, `and`, `not`.
+# В качестве первого аргумента эти операторы ожидают булевое значение.
+true and true #=> true
+false or true #=> true
+1 and true #=> ** (BadBooleanError)
+
+# Elixir также предоставляет `||`, `&&` и `!`, которые принимают аргументы
+# любого типа. Всё, кроме `false` и `nil`, считается `true`.
+1 || true #=> 1
+false && 1 #=> false
+nil && 20 #=> nil
+!true #=> false
+
+# Операторы сравнения: `==`, `!=`, `===`, `!==`, `<=`, `>=`, `<`, `>`
+1 == 1 #=> true
+1 != 1 #=> false
+1 < 2 #=> true
+
+# Операторы `===` и `!==` более строгие. Разница заметна, когда мы сравниваем
+# числа целые и с плавающей запятой:
+1 == 1.0 #=> true
+1 === 1.0 #=> false
+
+# Elixir позволяет сравнивать значения разных типов:
+1 < :hello #=> true
+
+# При сравнении разных типов руководствуйтесь следующим правилом:
+# число < атом < ссылка < функция < порт < процесс < кортеж < список < строка
+
+## ---------------------------
+## -- Порядок выполнения
+## ---------------------------
+
+# Условный оператор `if`
+if false do
+ "Вы этого никогда не увидите"
+else
+ "Вы увидите это"
+end
+
+# Противоположный ему условный оператор `unless`
+unless true do
+ "Вы этого никогда не увидите"
+else
+ "Вы увидите это"
+end
+
+# Помните сопоставление с образцом?
+# Многие конструкции в Elixir построены вокруг него.
+
+# `case` позволяет сравнить выражение с несколькими образцами:
+case {:one, :two} do
+ {:four, :five} ->
+ "Этот образец не совпадёт"
+ {:one, x} ->
+ "Этот образец совпадёт и присвоит переменной `x` значение `:two`"
+ _ ->
+ "Этот образец совпадёт с чем угодно"
+end
+
+# Символ `_` называется анонимной переменной. Используйте `_` для значений,
+# которые в текущем выражении вас не интересуют. Например, вам интересна лишь
+# голова списка, а хвост вы желаете проигнорировать:
+[head | _] = [1,2,3]
+head #=> 1
+
+# Для лучшей читаемости вы можете написать:
+[head | _tail] = [:a, :b, :c]
+head #=> :a
+
+# `cond` позволяет проверить сразу несколько условий за раз.
+# Используйте `cond` вместо множественных операторов `if`.
+cond do
+ 1 + 1 == 3 ->
+ "Вы меня никогда не увидите"
+ 2 * 5 == 12 ->
+ "И меня"
+ 1 + 2 == 3 ->
+ "Вы увидите меня"
+end
+
+# Обычно последним условием идёт `true`, которое выполнится, если все предыдущие
+# условия оказались ложны.
+cond do
+ 1 + 1 == 3 ->
+ "Вы меня никогда не увидите"
+ 2 * 5 == 12 ->
+ "И меня"
+ true ->
+ "Вы увидите меня (по сути, это `else`)"
+end
+
+# Обработка ошибок происходит в блоках `try/catch`.
+# Elixir также поддерживает блок `after`, который выполнится в любом случае.
+try do
+ throw(:hello)
+catch
+ message -> "Поймана ошибка с сообщением #{message}."
+after
+ IO.puts("Я выполнюсь всегда")
+end
+#=> Я выполнюсь всегда
+# "Поймана ошибка с сообщением hello."
+
+## ---------------------------
+## -- Модули и функции
+## ---------------------------
+
+# Анонимные функции (обратите внимание на точку при вызове функции)
+square = fn(x) -> x * x end
+square.(5) #=> 25
+
+# Анонимные функции принимают клозы и гарды.
+#
+# Клозы (от англ. clause) — варианты исполнения функции.
+#
+# Гарды (от англ. guard) — охранные выражения, уточняющие сопоставление с
+# образцом в функциях. Гарды следуют после ключевого слова `when`.
+f = fn
+ x, y when x > 0 -> x + y
+ x, y -> x * y
+end
+
+f.(1, 3) #=> 4
+f.(-1, 3) #=> -3
+
+# В Elixir много встроенных функций.
+# Они доступны в текущей области видимости.
+is_number(10) #=> true
+is_list("hello") #=> false
+elem({1,2,3}, 0) #=> 1
+
+# Вы можете объединить несколько функций в модуль. Внутри модуля используйте `def`,
+# чтобы определить свои функции.
+defmodule Math do
+ def sum(a, b) do
+ a + b
+ end
+
+ def square(x) do
+ x * x
+ end
+end
+
+Math.sum(1, 2) #=> 3
+Math.square(3) #=> 9
+
+# Чтобы скомпилировать модуль Math, сохраните его в файле `math.ex`
+# и наберите в терминале: `elixirc math.ex`
+
+defmodule PrivateMath do
+ # Публичные функции начинаются с `def` и доступны из других модулей.
+ def sum(a, b) do
+ do_sum(a, b)
+ end
+
+ # Приватные функции начинаются с `defp` и доступны только внутри своего модуля.
+ defp do_sum(a, b) do
+ a + b
+ end
+end
+
+PrivateMath.sum(1, 2) #=> 3
+PrivateMath.do_sum(1, 2) #=> ** (UndefinedFunctionError)
+
+# Функции внутри модуля тоже принимают клозы и гарды
+defmodule Geometry do
+ def area({:rectangle, w, h}) do
+ w * h
+ end
+
+ def area({:circle, r}) when is_number(r) do
+ 3.14 * r * r
+ end
+end
+
+Geometry.area({:rectangle, 2, 3}) #=> 6
+Geometry.area({:circle, 3}) #=> 28.25999999999999801048
+Geometry.area({:circle, "not_a_number"}) #=> ** (FunctionClauseError)
+
+# Из-за неизменяемых переменных в Elixir важную роль играет рекурсия
+defmodule Recursion do
+ def sum_list([head | tail], acc) do
+ sum_list(tail, acc + head)
+ end
+
+ def sum_list([], acc) do
+ acc
+ end
+end
+
+Recursion.sum_list([1,2,3], 0) #=> 6
+
+# Модули в Elixir поддерживают атрибуты.
+# Атрибуты бывают как встроенные, так и ваши собственные.
+defmodule MyMod do
+ @moduledoc """
+ Это встроенный атрибут
+ """
+
+ @my_data 100 # А это ваш атрибут
+ IO.inspect(@my_data) #=> 100
+end
+
+# Одна из фишек языка — оператор `|>`
+# Он передаёт выражение слева в качестве первого аргумента функции справа:
+Range.new(1,10)
+|> Enum.map(fn x -> x * x end)
+|> Enum.filter(fn x -> rem(x, 2) == 0 end)
+#=> [4, 16, 36, 64, 100]
+
+## ---------------------------
+## -- Структуры и исключения
+## ---------------------------
+
+# Структуры — это расширения поверх карт, привносящие в Elixir значения по
+# умолчанию, проверки на этапе компиляции и полиморфизм.
+defmodule Person do
+ defstruct name: nil, age: 0, height: 0
+end
+
+joe_info = %Person{ name: "Joe", age: 30, height: 180 }
+#=> %Person{age: 30, height: 180, name: "Joe"}
+
+# Доступ к полю структуры
+joe_info.name #=> "Joe"
+
+# Обновление поля структуры
+older_joe_info = %{ joe_info | age: 31 }
+#=> %Person{age: 31, height: 180, name: "Joe"}
+
+# Блок `try` с ключевым словом `rescue` используется для обработки исключений
+try do
+ raise "какая-то ошибка"
+rescue
+ RuntimeError -> "перехвачена ошибка рантайма"
+ _error -> "перехват любой другой ошибки"
+end
+#=> "перехвачена ошибка рантайма"
+
+# У каждого исключения есть сообщение
+try do
+ raise "какая-то ошибка"
+rescue
+ x in [RuntimeError] ->
+ x.message
+end
+#=> "какая-то ошибка"
+
+## ---------------------------
+## -- Параллелизм
+## ---------------------------
+
+# Параллелизм в Elixir построен на модели акторов. Для написания
+# параллельной программы нам понадобятся три вещи:
+# 1. Создание процессов
+# 2. Отправка сообщений
+# 3. Приём сообщений
+
+# Новый процесс создаётся функцией `spawn`, которая принимает функцию
+# в качестве аргумента.
+f = fn -> 2 * 2 end #=> #Function<erl_eval.20.80484245>
+spawn(f) #=> #PID<0.40.0>
+
+# `spawn` возвращает идентификатор процесса (англ. process identifier, PID).
+# Вы можете использовать PID для отправки сообщений этому процессу. Сообщения
+# отправляются через оператор `send`. А для приёма сообщений используется
+# механизм `receive`:
+
+# Блок `receive do` ждёт сообщений и обработает их, как только получит. Блок
+# `receive do` обработает лишь одно полученное сообщение. Чтобы обработать
+# несколько сообщений, функция, содержащая блок `receive do`, должна рекурсивно
+# вызывать себя.
+
+defmodule Geometry do
+ def area_loop do
+ receive do
+ {:rectangle, w, h} ->
+ IO.puts("Площадь = #{w * h}")
+ area_loop()
+ {:circle, r} ->
+ IO.puts("Площадь = #{3.14 * r * r}")
+ area_loop()
+ end
+ end
+end
+
+# Скомпилируйте модуль и создайте процесс
+pid = spawn(fn -> Geometry.area_loop() end) #=> #PID<0.40.0>
+# Альтернативно
+pid = spawn(Geometry, :area_loop, [])
+
+# Отправьте сообщение процессу
+send pid, {:rectangle, 2, 3}
+#=> Площадь = 6
+# {:rectangle,2,3}
+
+send pid, {:circle, 2}
+#=> Площадь = 12.56
+# {:circle,2}
+
+# Кстати, интерактивная консоль — это тоже процесс.
+# Чтобы узнать текущий PID, воспользуйтесь встроенной функцией `self`
+self() #=> #PID<0.27.0>
+
+## ---------------------------
+## -- Агенты
+## ---------------------------
+
+# Агент — это процесс, который следит за некоторым изменяющимся значением.
+
+# Создайте агента через `Agent.start_link`, передав ему функцию.
+# Начальным состоянием агента будет значение, которое эта функция возвращает.
+{ok, my_agent} = Agent.start_link(fn -> ["красный", "зелёный"] end)
+
+# `Agent.get` принимает имя агента и анонимную функцию `fn`, которой будет
+# передано текущее состояние агента. В результате вы получите то, что вернёт
+# анонимная функция.
+Agent.get(my_agent, fn colors -> colors end) #=> ["красный", "зелёный"]
+
+# Похожим образом вы можете обновить состояние агента
+Agent.update(my_agent, fn colors -> ["синий" | colors] end)
+```
+
+## Ссылки
+
+* [Официальный сайт](http://elixir-lang.org)
+* [Шпаргалка по языку](http://media.pragprog.com/titles/elixir/ElixirCheat.pdf)
+* [Книга "Programming Elixir"](https://pragprog.com/book/elixir/programming-elixir)
+* [Книга "Learn You Some Erlang for Great Good!"](http://learnyousomeerlang.com/)
+* [Книга "Programming Erlang: Software for a Concurrent World"](https://pragprog.com/book/jaerlang2/programming-erlang)
diff --git a/ru-ru/objective-c-ru.html.markdown b/ru-ru/objective-c-ru.html.markdown
index d60db1d8..3baa15f8 100644
--- a/ru-ru/objective-c-ru.html.markdown
+++ b/ru-ru/objective-c-ru.html.markdown
@@ -781,7 +781,7 @@ MyClass *newVar = [classVar retain]; // Если classVar освободится
// автоматический подсчет ссылок (ARC).
// ARC - это особенность компилятора, который помещает "retain", "release"
// и "autorelease" автоматически за вас тогда, когда используется ARC,
-// вам не нужно больше обращаться к "retain", "relase" или "autorelease"
+// вам не нужно больше обращаться к "retain", "release" или "autorelease"
MyClass *arcMyClass = [[MyClass alloc] init];
// ... код, использующий объект arcMyClass
// Без ARC, вам нужно было бы вызвать: [arcMyClass release] после того, как вы
diff --git a/ru-ru/php-ru.html.markdown b/ru-ru/php-ru.html.markdown
index 181368de..014ff5d0 100644
--- a/ru-ru/php-ru.html.markdown
+++ b/ru-ru/php-ru.html.markdown
@@ -128,7 +128,7 @@ define("FOO", "something");
// Доступ к константе возможен через прямое указание её имени без знака $
echo FOO; // печатает 'something'
-echo 'This outputs ' . FOO; // печатает 'This ouputs something'
+echo 'This outputs ' . FOO; // печатает 'This outputs something'
/********************************
* Массивы
@@ -687,45 +687,6 @@ use My\Namespace as SomeOtherNamespace;
$cls = new SomeOtherNamespace\MyClass();
-*//**********************
-* Позднее статическое связывание.
-*
-*/
-
-class ParentClass
-{
- public static function who()
- {
- echo "I'm a " . __CLASS__ . "\n";
- }
-
- public static function test()
- {
- // self ссылается на класс в котором определен метод.
- self::who();
- // static ссылается на класс в котором метод вызван.
- static::who();
- }
-}
-
-ParentClass::test();
-/*
-I'm a ParentClass
-I'm a ParentClass
-*/
-
-class ChildClass extends ParentClass
-{
- public static function who()
- {
- echo "But I'm " . __CLASS__ . "\n";
- }
-}
-
-ChildClass::test();
-/*
-I'm a ParentClass
-But I'm ChildClass
/**********************
* Позднее статическое связывание.
diff --git a/ruby-ecosystem.html.markdown b/ruby-ecosystem.html.markdown
index 1fbcc752..50eedcd0 100644
--- a/ruby-ecosystem.html.markdown
+++ b/ruby-ecosystem.html.markdown
@@ -88,7 +88,7 @@ implementation.
to have stopped since Microsoft pulled their support.
Ruby implementations may have their own release version numbers, but they always
-target a specific version of MRI for compatability. Many implementations have
+target a specific version of MRI for compatibility. Many implementations have
the ability to enter different modes (for example, 1.8 or 1.9 mode) to specify
which MRI version to target.
diff --git a/shutit.html.markdown b/shutit.html.markdown
index d16290b3..67d7a4b5 100644
--- a/shutit.html.markdown
+++ b/shutit.html.markdown
@@ -10,7 +10,7 @@ filename: learnshutit.html
ShutIt is an shell automation framework designed to be easy to use.
-It is a wrapper around a python-based expect clone (pexpect).
+It is a wrapper around a Python-based expect clone (pexpect).
You can look at it as 'expect without the pain'.
@@ -167,8 +167,8 @@ session2.logout()
Here you use the 'send\_and\_get\_output' method to retrieve the output of the
capacity command (df).
-There are much more elegant ways to do the above (eg have a dictionary of the
-servers to iterate over), but it's up to you how clever you need the python to
+There are much more elegant ways to do the above (e.g. have a dictionary of the
+servers to iterate over), but it's up to you how clever you need the Python to
be.
@@ -300,7 +300,7 @@ over a minute to complete (using the 'wait' method).
Again, this is trivial, but imagine you have hundreds of servers to manage like
this and you can see the power it can bring in a few lines of code and one
-python import.
+Python import.
## Learn More
diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown
index cc7ab84c..66022d95 100644
--- a/smalltalk.html.markdown
+++ b/smalltalk.html.markdown
@@ -907,7 +907,7 @@ b := String isWords. true if index instan
Object withAllSubclasses size. "get total number of class entries"
```
-## Debuging:
+## Debugging:
```
| a b x |
x yourself. "returns receiver"
diff --git a/solidity.html.markdown b/solidity.html.markdown
index 602d74f0..fc54d6e4 100644
--- a/solidity.html.markdown
+++ b/solidity.html.markdown
@@ -37,6 +37,9 @@ features are typically marked, and subject to change. Pull requests welcome.
// simple_bank.sol (note .sol extension)
/* **** START EXAMPLE **** */
+// Declare the source file compiler version.
+pragma solidity ^0.4.2;
+
// Start with Natspec comment (the three slashes)
// used for documentation - and as descriptive data for UI elements/actions
@@ -188,7 +191,7 @@ string n = "hello"; // stored in UTF8, note double quotes, not single
// string utility functions to be added in future
// prefer bytes32/bytes, as UTF8 uses more storage
-// Type inferrence
+// Type inference
// var does inferred typing based on first assignment,
// can't be used in functions parameters
var a = true;
@@ -484,7 +487,7 @@ contract MyContract is abc, def("a custom argument to def") {
function z() {
if (msg.sender == owner) {
def.z(); // call overridden function from def
- super.z(); // call immediate parent overriden function
+ super.z(); // call immediate parent overridden function
}
}
}
@@ -804,7 +807,7 @@ someContractAddress.callcode('function_name');
// else should be placed on own line
-// 14. NATSPEC COMENTS
+// 14. NATSPEC COMMENTS
// used for documentation, commenting, and external UIs
// Contract natspec - always above contract definition
diff --git a/standard-ml.html.markdown b/standard-ml.html.markdown
index c9eb2a2e..9ebf345b 100644
--- a/standard-ml.html.markdown
+++ b/standard-ml.html.markdown
@@ -385,7 +385,7 @@ fun calculate_interest(n) = if n < 0.0
(* Exceptions can be caught using "handle" *)
val balance = calculate_interest ~180.0
- handle Domain => ~180.0 (* x now has the value ~180.0 *)
+ handle Domain => ~180.0 (* balance now has the value ~180.0 *)
(* Some exceptions carry extra information with them *)
(* Here are some examples of built-in exceptions *)
@@ -395,7 +395,7 @@ fun failing_function [] = raise Empty (* used for empty lists *)
| failing_function xs = raise Fail "This list is too long!"
(* We can pattern match in 'handle' to make sure
- a specfic exception was raised, or grab the message *)
+ a specific exception was raised, or grab the message *)
val err_msg = failing_function [1,2] handle Fail _ => "Fail was raised"
| Domain => "Domain was raised"
| Empty => "Empty was raised"
diff --git a/swift.html.markdown b/swift.html.markdown
index c17510b6..60915d72 100644
--- a/swift.html.markdown
+++ b/swift.html.markdown
@@ -281,7 +281,7 @@ testGuard()
// Variadic Args
func setup(numbers: Int...) {
- // its an array
+ // it's an array
let _ = numbers[0]
let _ = numbers.count
}
diff --git a/tcl.html.markdown b/tcl.html.markdown
index 1f4ca63b..40d9111a 100644
--- a/tcl.html.markdown
+++ b/tcl.html.markdown
@@ -49,7 +49,7 @@ discipline of exposing all programmatic functionality as routines, including
things like looping and mathematical operations that are usually baked into the
syntax of other languages, allows it to fade into the background of whatever
domain-specific functionality a project needs. Its syntax, which is even
-lighter that that of Lisp, just gets out of the way.
+lighter than that of Lisp, just gets out of the way.
@@ -75,7 +75,7 @@ lighter that that of Lisp, just gets out of the way.
## 2. Syntax
###############################################################################
-# A script is made up of commands delimited by newlines or semiclons. Each
+# A script is made up of commands delimited by newlines or semicolons. Each
# command is a call to a routine. The first word is the name of a routine to
# call, and subsequent words are arguments to the routine. Words are delimited
# by whitespace. Since each argument is a word in the command it is already a
@@ -99,13 +99,13 @@ set greeting $part1$part2[set part3]
# An embedded script may be composed of multiple commands, the last of which provides
-# the result for the substtution:
+# the result for the substitution:
set greeting $greeting[
incr i
incr i
incr i
]
-puts $greeting ;# The output is "Salutations3"
+puts $greeting ;# The output is "Salutations3"
# Every word in a command is a string, including the name of the routine, so
# substitutions can be used on it as well. Given this variable
@@ -377,7 +377,7 @@ set amount [lindex $amounts 1]
set inventory {"item 1" item\ 2 {item 3}}
-# It's generally a better idea to use list routines when modifing lists:
+# It's generally a better idea to use list routines when modifying lists:
lappend inventory {item 1} {item 2} {item 3}
@@ -422,8 +422,7 @@ eval {set name Neo}
eval [list set greeting "Hello, $name"]
-# Therefore, when using "eval", , use "list" to build
-# up the desired command:
+# Therefore, when using "eval", use "list" to build up the desired command:
set command {set name}
lappend command {Archibald Sorbisol}
eval $command
@@ -517,7 +516,7 @@ proc while {condition script} {
# and then calls that routine. "yield" suspends evaluation in that stack and
# returns control to the calling stack:
proc countdown count {
- # send something back to the creater of the coroutine, effectively pausing
+ # send something back to the creator of the coroutine, effectively pausing
# this call stack for the time being.
yield [info coroutine]
diff --git a/tcsh.html.markdown b/tcsh.html.markdown
index a95a84b0..70f1e52d 100644
--- a/tcsh.html.markdown
+++ b/tcsh.html.markdown
@@ -592,7 +592,7 @@ while ( $#lst )
shift lst
end
echo 'options =' $options
-echo 'paramaters =' $params
+echo 'parameters =' $params
#### REPEAT
# Syntax: repeat count command
diff --git a/tr-tr/c-tr.html.markdown b/tr-tr/c-tr.html.markdown
index 33544765..6042a609 100644
--- a/tr-tr/c-tr.html.markdown
+++ b/tr-tr/c-tr.html.markdown
@@ -481,7 +481,7 @@ Diğer bir iyi kaynak ise [Learn C the hard way](http://c.learncodethehardway.or
It's very important to use proper spacing, indentation and to be consistent with your coding style in general.
Readable code is better than clever code and fast code. For a good, sane coding style to adopt, see the
-[Linux kernel coding stlye](https://www.kernel.org/doc/Documentation/CodingStyle).
+[Linux kernel coding style](https://www.kernel.org/doc/Documentation/CodingStyle).
Diğer taraftan google sizin için bir arkadaş olabilir.
diff --git a/typescript.html.markdown b/typescript.html.markdown
index ef37182d..44fd791a 100644
--- a/typescript.html.markdown
+++ b/typescript.html.markdown
@@ -50,7 +50,7 @@ function bigHorribleAlert(): void {
// Functions are first class citizens, support the lambda "fat arrow" syntax and
// use type inference
-// The following are equivalent, the same signature will be infered by the
+// The following are equivalent, the same signature will be inferred by the
// compiler, and same JavaScript will be emitted
let f1 = function (i: number): number { return i * i; }
// Return type inferred
diff --git a/vim.html.markdown b/vim.html.markdown
index 70f43be1..7723136f 100644
--- a/vim.html.markdown
+++ b/vim.html.markdown
@@ -40,9 +40,9 @@ specific points in the file, and for fast editing.
# Searching in the text
- /word # Highlights all occurences of word after cursor
- ?word # Highlights all occurences of word before cursor
- n # Moves cursor to next occurence of word after search
+ /word # Highlights all occurrences of word after cursor
+ ?word # Highlights all occurrences of word before cursor
+ n # Moves cursor to next occurrence of word after search
N # Moves cursor to previous occerence of word
:%s/foo/bar/g # Change 'foo' to 'bar' on every line in the file
diff --git a/visualbasic.html.markdown b/visualbasic.html.markdown
index f081b907..cbeb36b5 100644
--- a/visualbasic.html.markdown
+++ b/visualbasic.html.markdown
@@ -12,7 +12,7 @@ Module Module1
'A Quick Overview of Visual Basic Console Applications before we dive
'in to the deep end.
'Apostrophe starts comments.
- 'To Navigate this tutorial within the Visual Basic Complier, I've put
+ 'To Navigate this tutorial within the Visual Basic Compiler, I've put
'together a navigation system.
'This navigation system is explained however as we go deeper into this
'tutorial, you'll understand what it all means.
diff --git a/yaml.html.markdown b/yaml.html.markdown
index 95adbd83..3b32a069 100644
--- a/yaml.html.markdown
+++ b/yaml.html.markdown
@@ -27,7 +27,7 @@ another_key: Another value goes here.
a_number_value: 100
scientific_notation: 1e+12
# The number 1 will be interpreted as a number, not a boolean. if you want
-# it to be intepreted as a boolean, use true
+# it to be interpreted as a boolean, use true
boolean: true
null_value: null
key with spaces: value
@@ -132,7 +132,7 @@ python_complex_number: !!python/complex 1+2j
# We can also use yaml complex keys with language specific tags
? !!python/tuple [5, 7]
: Fifty Seven
-# Would be {(5, 7): 'Fifty Seven'} in python
+# Would be {(5, 7): 'Fifty Seven'} in Python
####################
# EXTRA YAML TYPES #
diff --git a/zh-cn/visualbasic-cn.html.markdown b/zh-cn/visualbasic-cn.html.markdown
index 59f18fe2..8bdfabc6 100644
--- a/zh-cn/visualbasic-cn.html.markdown
+++ b/zh-cn/visualbasic-cn.html.markdown
@@ -77,7 +77,7 @@ Module Module1
' 使用 private subs 声明函数。
Private Sub HelloWorldOutput()
' 程序名
- Console.Title = "Hello World Ouput | Learn X in Y Minutes"
+ Console.Title = "Hello World Output | Learn X in Y Minutes"
' 使用 Console.Write("") 或者 Console.WriteLine("") 来输出文本到屏幕上
' 对应的 Console.Read() 或 Console.Readline() 用来读取键盘输入
Console.WriteLine("Hello World")