creating defines using keyword names
Posted: Fri Oct 26, 2018 1:00 pm
i´m wondering why such defines are allowed ?
DEFINE ASSIGN := 11 AS INT
DEFINE FOR := 12 AS INT
DEFINE NEXT := "aa" AS STRING
DEFINE METHOD := 23 AS INT
DEFINE LOOP := 24 AS INT
DEFINE SEQUENCE := 25 AS INT
DEFINE FOREACH := 26 AS INT
DEFINE __ARGLIST := 34 AS INT
DEFINE DEFINE := 36 AS INT
DEFINE INT := 38 AS INT
DEFINE STRING := 40 AS INT
// DEFINE SELF := 41 AS INT // ok, error XS9002: Parser: mismatched input 'SELF'
// DEFINE SUPER := 42 AS INT // ok, error XS9002: Parser: mismatched input 'SUPER'
If i use fully qualified names, i can even access such defines
? speed.exe.Functions.METHOD
? speed.exe.Functions.SEQUENCE
? speed.exe.Functions.__ARGLIST
? speed.exe.Functions.DEFINE
? speed.exe.Functions.INT
? speed.exe.Functions.String
? speed.exe.Functions.next + "bb"
regards
Karl-Heinz
DEFINE ASSIGN := 11 AS INT
DEFINE FOR := 12 AS INT
DEFINE NEXT := "aa" AS STRING
DEFINE METHOD := 23 AS INT
DEFINE LOOP := 24 AS INT
DEFINE SEQUENCE := 25 AS INT
DEFINE FOREACH := 26 AS INT
DEFINE __ARGLIST := 34 AS INT
DEFINE DEFINE := 36 AS INT
DEFINE INT := 38 AS INT
DEFINE STRING := 40 AS INT
// DEFINE SELF := 41 AS INT // ok, error XS9002: Parser: mismatched input 'SELF'
// DEFINE SUPER := 42 AS INT // ok, error XS9002: Parser: mismatched input 'SUPER'
If i use fully qualified names, i can even access such defines
? speed.exe.Functions.METHOD
? speed.exe.Functions.SEQUENCE
? speed.exe.Functions.__ARGLIST
? speed.exe.Functions.DEFINE
? speed.exe.Functions.INT
? speed.exe.Functions.String
? speed.exe.Functions.next + "bb"
regards
Karl-Heinz