From 1371efe157ac337e68091a7e5dc8652ac29497eb Mon Sep 17 00:00:00 2001 From: John Gabriele Date: Sun, 29 Sep 2019 22:42:01 -0400 Subject: general-purpose, not specifically web-oriented Although Haxe has a great JS target, it has many other targets as well, and is a general-purpose language, and not strictly web-oriented. --- haxe.html.markdown | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'haxe.html.markdown') diff --git a/haxe.html.markdown b/haxe.html.markdown index a31728e1..235a9b74 100644 --- a/haxe.html.markdown +++ b/haxe.html.markdown @@ -6,8 +6,8 @@ contributors: - ["Dan Korostelev", "https://github.com/nadako/"] --- -Haxe is a web-oriented language that provides platform support for C++, C#, -Swf/ActionScript, Javascript, Java, PHP, Python, Lua, HashLink, and Neko byte code +[Haxe](https://haxe.org/) is a general-purpose language that provides platform support for C++, C#, +Swf/ActionScript, JavaScript, Java, PHP, Python, Lua, HashLink, and Neko bytecode (the latter two being also written by the Haxe author). Note that this guide is for Haxe version 3. Some of the guide may be applicable to older versions, but it is recommended to use other references. @@ -668,7 +668,7 @@ class TypedefsAndStructuralTypes { That would give us a single "Surface" type to work with across all of those platforms. - */ + */ } } @@ -700,8 +700,7 @@ class UsingExample { instance, and the compiler still generates code equivalent to a static method. */ - } - + } } ``` -- cgit v1.2.3 From 5129c2acd17f8f548d2f5b9c514387e60f7d8c1e Mon Sep 17 00:00:00 2001 From: John Gabriele Date: Sun, 29 Sep 2019 22:57:33 -0400 Subject: Space between `switch` and `(` --- haxe.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'haxe.html.markdown') diff --git a/haxe.html.markdown b/haxe.html.markdown index 235a9b74..6a50b88b 100644 --- a/haxe.html.markdown +++ b/haxe.html.markdown @@ -338,7 +338,7 @@ class LearnHaxe3 { */ var my_dog_name = "fido"; var favorite_thing = ""; - switch(my_dog_name) { + switch (my_dog_name) { case "fido" : favorite_thing = "bone"; case "rex" : favorite_thing = "shoe"; case "spot" : favorite_thing = "tennis ball"; @@ -366,7 +366,7 @@ class LearnHaxe3 { trace("k equals ", k); // outputs 10 - var other_favorite_thing = switch(my_dog_name) { + var other_favorite_thing = switch (my_dog_name) { case "fido" : "teddy"; case "rex" : "stick"; case "spot" : "football"; @@ -559,7 +559,7 @@ class SimpleEnumTest { // You can specify the "full" name, var e_explicit:SimpleEnum = SimpleEnum.Foo; var e = Foo; // but inference will work as well. - switch(e) { + switch (e) { case Foo: trace("e was Foo"); case Bar: trace("e was Bar"); case Baz: trace("e was Baz"); // comment this line to throw an error. @@ -572,7 +572,7 @@ class SimpleEnumTest { You can also specify a default for enum switches as well: */ - switch(e) { + switch (e) { case Foo: trace("e was Foo again"); default : trace("default works here too"); } @@ -595,21 +595,21 @@ class ComplexEnumTest { var e1:ComplexEnum = IntEnum(4); // specifying the enum parameter // Now we can switch on the enum, as well as extract any parameters // it might have had. - switch(e1) { + switch (e1) { case IntEnum(x) : trace('$x was the parameter passed to e1'); default: trace("Shouldn't be printed"); } // another parameter here that is itself an enum... an enum enum? var e2 = SimpleEnumEnum(Foo); - switch(e2){ + switch (e2){ case SimpleEnumEnum(s): trace('$s was the parameter passed to e2'); default: trace("Shouldn't be printed"); } // enums all the way down var e3 = ComplexEnumEnum(ComplexEnumEnum(MultiEnum(4, 'hi', 4.3))); - switch(e3) { + switch (e3) { // You can look for certain nested enums by specifying them // explicitly: case ComplexEnumEnum(ComplexEnumEnum(MultiEnum(i,j,k))) : { -- cgit v1.2.3 From a8d9e066eae5f48b27c93df3d0bbb53cd232a63a Mon Sep 17 00:00:00 2001 From: John Gabriele Date: Sun, 29 Sep 2019 23:21:42 -0400 Subject: decrements too --- haxe.html.markdown | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'haxe.html.markdown') diff --git a/haxe.html.markdown b/haxe.html.markdown index 6a50b88b..05fa59bf 100644 --- a/haxe.html.markdown +++ b/haxe.html.markdown @@ -234,10 +234,9 @@ class LearnHaxe3 { ^ Bitwise exclusive OR | Bitwise inclusive OR */ - - // increments + var i = 0; - trace("Increments and decrements"); + trace("Pre-/Post- Increments and Decrements"); trace(i++); // i = 1. Post-Increment trace(++i); // i = 2. Pre-Increment trace(i--); // i = 1. Post-Decrement -- cgit v1.2.3 From a22ba3395320bbd266aad71e73e8059fc84f45a7 Mon Sep 17 00:00:00 2001 From: John Gabriele Date: Sun, 29 Sep 2019 23:29:13 -0400 Subject: whitespace --- haxe.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'haxe.html.markdown') diff --git a/haxe.html.markdown b/haxe.html.markdown index 05fa59bf..e086dd7a 100644 --- a/haxe.html.markdown +++ b/haxe.html.markdown @@ -189,7 +189,7 @@ class LearnHaxe3 { trace(m.get('bar') + " is the value for m.get('bar')"); trace(m['bar'] + " is the value for m['bar']"); - var m2 = ['foo' => 4, 'baz' => 6]; // Alternative map syntax + var m2 = ['foo' => 4, 'baz' => 6]; // Alternative map syntax trace(m2 + " is the value for m2"); // Remember, you can use type inference. The Haxe compiler will @@ -286,7 +286,7 @@ class LearnHaxe3 { } // do-while loop - var l = 0; + var l = 0; do { trace("do statement always runs at least once"); } while (l > 0); -- cgit v1.2.3