Veeyu Primer ============ This documentation is an introduction to the Veeyu programming language for programmers. Strings ------- ```` objects have several useful methods and properties: .. sourcecode:: text >>> "hello" "hello" >>> s := 'Veeyu language' "Veeyu language" >>> s.split(" ") ["Veeyu", "language"] >>> "hello, " ++ "world!" "hello, world!" >>> "abc"[0] c"a" >>> "veeyu".make-uppercase() "VEEYU" >>> "hello world"[2 ~ 7] "llo w" >>> "veeyu" as [c"v", c"e", c"e", c"y", c"u"] Literals ^^^^^^^^ There are four types of string literals: **string** e.g. ``"like this"`` This is the most commonly used string literal. It accepts C-style metacharacters like ``\n``, ``\r``, ``\t`` and Python-style metacharacters that represents unicode codepoints like ``\xff``, ``\uffff``, ``\Uffffffff``. .. seealso:: :ref:`veeyu-string-metacharacter` **Raw string** e.g. ``'like this'`` This is a raw string literal that doesn't take any metacharacters except ``\'``. For example, ``'\'this\'\ncode\\'`` equals to ``"'this'\\ncode\\\\"``. **Multiline string** e.g. ``"""like this"""`` .. seealso:: :ref:`veeyu-string-metacharacter` **Multiline raw string** e.g. ``'''like this'''`` .. _veeyu-string-metacharacter: Metacharacters ^^^^^^^^^^^^^^ ================= ================================================= Escaping Sequence Meaning ================= ================================================= ``\\`` Backslash (``\``) ``\'`` Single quote (``'``) ``\"`` Double quote (``"``) ``\a`` ASCII Bell (BEL) ``\b`` ASCII Backspace (BS) ``\f`` ASCII Formfeed (FF) ``\n`` ASCII Linefeed (LF) ``\r`` ASCII Carriage Return (CR) ``\t`` ASCII Horizontal Tab (TAB) ``\uxxxx`` Unicode character with 16-bit hex value `xxxx` ``\Uxxxxxxxx`` Unicode character with 32-bit hex value `xxxxxxxx` ``\v`` ASCII Vertical Tab (VT) ``\xhh`` Unicode character with hex value `hh` ================= ================================================= Numbers ------- .. sourcecode:: text >>> 1 + 2 + 3 6 There are some numeric types according to standards: - ```` - ```` - ```` Implementations may add some subclasses for numeric types for performance optimization or ease of implementation, so Comedy implements ```` and ```` classes that have the common superclass ```` and match to Python's :class:`int` and :class:`long` classes. - ```` - ```` - ```` - ```` - ```` .. sourcecode:: text >>> 1.class >>> 999999999999999999.class >>> 1 isa? true >>> 999999999999999999 isa? true