This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Square barckets in Kawa


I'd like to get a feel for people's preferences wrt square brackets
in Kawa.  (We're talking about the default reader syntax for Scheme.)
By "type names" I means Kawa forms like <object[]> .

Option 1: Square branckets are token constituents.
Advantages: Status quo; consistent with Common Lisp default;
does not cause problems with type names; economy (in that
using two extra characters that do exactly the same as
regular parens seems wasteful).

Option 2:  Square brackets are equivalent to parentheses.
Advantages:  Some people find it helps visually match
parens, especially if there are standards for when to use
which brackets.  Simple; consistent with some other Scheme
implementations; may make programs easier to read.
Disadvantage:  Breaks Kawa types names, so this is out
as a default.

Option 3: Square brackets are equivalent to parentheses,
except when inside a token started by '<'.
Advantage:  Those of options 2, plus does not break type names.
Disadvantage:  Slightly more complex rule.

Option 4: Square brackets are equivalent to parentheses,
except when inside a token. A '[' not inside a token is
equivalent to '('.  A ']' not inside a token is equivalent to
a ')', except it is an error if the matching open was not a '['.
A ']' inside a token terminates the token.
Advantages and disadvantages:  Similar to 3.  Perhaps
slightly more fragile to spacing errors.

I don't have a strong preference, except that 2 is out, so I'll
see what my users prefer.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]