GAP mode testing # Literals 1234; .123; 1.7; 7; 2147483647; (1,2,3)(4,5,6); """ Multiline string literals """ # Identifiers a; foo; aLongIdentifier := n; hello; Hello; HELLO; x100; 100x; _100; some_people_prefer_underscores_to_separate_words; WePreferMixedCaseToSeparateWords; abc@def; G\(2\,5\)asd; 9123really\w\ eir\_\(identifier := 5; Group\(2\,5\); # Functions Sum(List([1..100], x -> x^2)); 2 * 2; 2 * 2 + 9 = Fibonacci(7) and Fibonacci(13) in Primes; 100; InstallGlobalFunction(MyGlobalFunction, function(a,b,c) local e,f,g; return a; end); f := function(a,b,c) local x, y, z, g; g := Group((1,2,3), (4,5,6)); if IsBound(c[2]) then while c[2] > 0 do c[3] := 4 - 2; od; fi; if IsGroup(g) then Error("This is a group!\n"); fi; x := z{ [1,2,3] }; z := x{ [1..3] }; if a = true then return x + z; elif b = 5 then return b + 2; else return a + b + c; fi; end; g := function(x,y) atomic readwrite x do x[5] := 2; od; end; MIME types defined: text/x-gap.