> < ^ Date: Tue, 23 Mar 1993 17:04:13 +0100
> < ^ From: Steve Linton <sal@dcs.st-and.ac.uk >
> ^ Subject: Inconsistencies in new string, list and range features.

1) While strings are lists, string literals do not appear to be
usable as such:

gap> "abc"[1];
Syntax error: ; expected
"abc"[1];
     ^
gap> ("abc")[1];
Syntax error: ; expected
("abc")[1];
       ^
gap> l := "abc";
"abc"
gap> l[1];
'a'

Actually the second example above seems to be an instance of
something more general:

gap> (l)[1];
Syntax error: ; expected
(l)[1];
   ^

2) I think the following should work:

gap> [y := 9, y-1 ..1];
Syntax error: ] expected
[y := 9, y-1..1];
    ^
This may look stupid, but suppose 9 were replaced by an expensive
function call.

gap> y := 9; [y,y-1..1];
9
[ 9, 8 .. 1 ]

works, but seems unnecessarily long.

Actually, the best way to cope with this situation would be to be
able to specify the step explicitly in a range literal, something
like [start, end : step].

Steve


> < [top]