This documentation is an introduction to the Veeyu programming language for programmers.
<string> objects have several useful methods and properties:
>>> "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 <list>
[c"v", c"e", c"e", c"y", c"u"]
There are four types of string literals:
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.
See also
Multiline string e.g. """like this"""
See also
Multiline raw string e.g. '''like this'''
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 |
>>> 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 <int> and <long> classes that have the common superclass <integer> and match to Python’s int and long classes.
>>> 1.class
<int>
>>> 999999999999999999.class
<long>
>>> 1 isa? <integer>
true
>>> 999999999999999999 isa? <integer>
true