From 858c5a221e7df2aaa756bea625d93b95df307bb0 Mon Sep 17 00:00:00 2001 From: Joaquin Ruiz Luque <8709870+libre8bit@users.noreply.github.com> Date: Fri, 2 Feb 2018 16:15:55 -0300 Subject: [PATCH] Update gdscript_advanced.rst Small fixes. --- getting_started/scripting/gdscript/gdscript_advanced.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/getting_started/scripting/gdscript/gdscript_advanced.rst b/getting_started/scripting/gdscript/gdscript_advanced.rst index 47cb454d1..d3f68316d 100644 --- a/getting_started/scripting/gdscript/gdscript_advanced.rst +++ b/getting_started/scripting/gdscript/gdscript_advanced.rst @@ -229,7 +229,7 @@ Or unordered sets: Dictionaries ------------ -Dictionaries are always a very powerful in dynamically typed languages. +Dictionaries are a very powerful tool in dynamically typed languages. Most programmers that come from statically typed languages (such as C++ or C#) ignore their existence and make their life unnecessarily more difficult. This datatype is generally not present in such languages (or @@ -432,7 +432,7 @@ statically typed language would be something like: entity->smash(); } -This, way, everything that can be smashed by a rock would have to +This way, everything that can be smashed by a rock would have to inherit Smashable. If a character, enemy, piece of furniture, small rock were all smashable, they would need to inherit from the class Smashable, possibly requiring multiple inheritance. If multiple inheritance was @@ -462,8 +462,9 @@ In this case, it translates to: *"If the object can be smashed, don't care what it is, just smash it."* -Yes, we should call it Hulk typing instead. Anyway though, there exists -the possibility of the object being hit not having a smash() function. +Yes, we should call it Hulk typing instead. + +It's possible that the object being hit doesn't have a smash() function. Some dynamically typed languages simply ignore a method call when it doesn't exist (like Objective C), but GDScript is more strict, so checking if the function exists is desirable: