This page is part of the web mail archives of SRFI 105 from before July 7th, 2015. The new archives for SRFI 105 contain all messages, not just those from before July 7th, 2015.
On 09/18/2012 10:45 AM, John Cowan wrote:
I mentioned this before but it seems to have gotten lost: I recommend that [foo bar] in c-expressions be treated as ($bracket-list$ foo bar) rather than (bracketaccess foo bar). This is compatible with Kawa, which is the only Scheme in my test suite to treat square brackets in this way. In FemtoLisp and Rep, they are used for vector datums; in all other Schemes, they are synonyms for parentheses per R6RS, regular identifier characters, or lexical syntax errors.
Some context: The default binding of $bracket-list$ is like vector, except that it returns an immutable vector. There is also some target-typing: In a context that requires a generic sequence (i.e. a type that implements java.util.List), a $bracket-list$ is automatically (at compile-time) treated as a constructor for that sequence type. The syntax F0[F1 ... Fn] with no space between the F0 and the '[' is read as ($bracket-apply$ F0 F1 ... Fn). This is used for parameterized types, as in vector[string]. It is also used for "legacy" array types: string. -- --Per Bothner per@xxxxxxxxxxx http://per.bothner.com/