From d57968121950069e63f6706a399d8d47b6f6edbe Mon Sep 17 00:00:00 2001 From: Daniil Yarancev <21169548+Yardanico@users.noreply.github.com> Date: Mon, 16 Oct 2017 15:30:25 +0300 Subject: [PATCH] Updated Feature suggestions (markdown) --- Feature-suggestions.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Feature-suggestions.md b/Feature-suggestions.md index 562f8fb..56f6f1a 100644 --- a/Feature-suggestions.md +++ b/Feature-suggestions.md @@ -37,9 +37,7 @@ quickly). - A user-defined ternary operator is entirely possible (and really simple). - a simple way of indexing the last element of an array or sequence, to avoid long-hand code like ``arr[arr.len-1]`` - - You can do: ``arr[arr.high]`` or ``arr[arr.low]`` for indexing the last and first element or an array or sequence. - - If it is ``thisismylongname[thisismylongname.high]`` thats not helpfull. ``thisismylongname[>]`` and ``thisismylongname[<]`` looks nice for that in my eyes. - + - You can do: ``arr[arr.high]`` or ``arr[arr.low]`` for indexing the last and first element or an array or sequence or ``arr[^1]`` for the last element. - a shorthand way of discarding the return value of a proc (to improve readability) - a shorthand initialization of arrays or sequences, eg var x: array[0..25, int] = -1 @@ -49,7 +47,8 @@ would initialize all elements of x to -1 - array/sequence comprehension - They are present in the ``future`` module of the standard library. -- introspection like python's dir() +- introspection like python's dir() + - Possible via metaprogramming - scoped imports, like D, Ada, and Ocaml