Code: Select all
> (setq Test 10)
10
> (setq Test1 (string {Bla}Test{Bla1}))
Blanil
> (setq Test1 (string {Bla} Test {Bla1}))
Bla10Bla1
Code: Select all
> (setq Test 10)
10
> (setq Test1 (string {Bla}Test{Bla1}))
Blanil
> (setq Test1 (string {Bla} Test {Bla1}))
Bla10Bla1
-- xytroxon1. Syntax of symbol variables and numbers
Source code in newLISP is parsed according to the rules outlined here. When in doubt, verify the behavior of newLISP's internal parser by calling parse without optional arguments.
Symbols for variable names
1. The following rules apply to the naming of symbols used as variables or functions:
Variable symbols may not start with any of the following characters:
# ; " ' ( ) { } . , 0 1 2 3 4 5 6 7 8 9
2. Variable symbols starting with a + or - cannot have a number as the second character.
3. Any character is allowed inside a variable name, except for:
" ' ( ) : , and the space character. These mark the end of a variable symbol.
4. A symbol name starting with [ (left square bracket) and ending with ] (right square bracket) may contain any character except the right square bracket.
5. A symbol name starting with $ (dollar sign) is global. There are several of these symbols already built into newLISP and set and changed internally. This type of global symbol can also be created by the user.
All of the following symbols are legal variable names in newLISP:
myvar
A-name
X34-zz
[* 7 5 ()};]
*111*
Instead of a " (double quote), a { (left curly bracket) and } (right curly bracket) can be used to delimit strings. This is useful when quotation marks need to occur inside strings.
Code: Select all
> (setq Test 10)
10
> (setq Test1 (string "Bla"Test"Bla1"))
Bla10Bla1