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]

Re: readtable API


brlewis@alum.mit.edu writes:

> It seems intuitive for square brackets to be delimiters.  They are in
> BRL, which forces identifiers like <char[]> to be used outside of BRL
> pages (e.g. sitedefs.scm).
> 
> Maybe they should be delimiters except while reading an identifier that
> starts with <.

That is one option.  Another option is to treat an initial '[' specially.

We could have '[' be a non-terminating macro character.  The macro
for '[' is like the existing ReaderParens implementation, except that
it checks for tokens that contain an unmatched ']'. The current
implementation only recognizes ']' as the start of a token; it would
need to check for example 'XXX]YYY]ZZZ' and split that as if it were
'XXX ] YYY ] ZZZ'.  Basically, if it sees a constituent character,
it needs to scan ahead, looking for an unquoted ']'.

This solution (like the current implementation) means '[' is treated
like parentheses only following a delimiter, not in the middle of a token.

The cleanest solution is probably to make '[' be a regular constituent
character by default, but make it easy for a user preference to
change it.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


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