This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: BRL reader problem.
On 08/26/2009 01:38 PM, Dan Stanger wrote:
This problem is now resolved, for the servlet and interactive BRL by:
1) Setting the readtable before the parse in KawaPageServlet.
2) Setting the readState consistent with the comments in
LineBufferedReader.
KawaPageServlet shouldn't set the current ReadTable, because
KawaPageServlet is supposed to language-neutral, and ReadTables
are specific to LispLanguage sub-classes.
However, the code in ReadTable.getCurrent does appear questionable
if you might mix languages in the same thread, since you (presumably)
want to switch readtables when you switch languages - at least in the
common case when you you're using a language-default readtable.
Perhaps we want:
public static ReadTable getCurrent()
{
ReadTable table = (ReadTable) current.get(null);
if (table == null)
{
Language language = Language.getDefaultLanguage();
if (language instanceof LispLanguage)
table = ((LispLanguage) language).defaultReadTable;
else
{
table = ReadTable.createInitial();
current.set(table);
}
}
return table;
}
Somewhat less efficient, though.
--
--Per Bothner
per@bothner.com http://per.bothner.com/