This is the mail archive of the kawa@sourceware.org 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]
Other format: [Raw text]

Re: limit to length of an s-expression passed to eval?


An appalling hack, from years ago, is to find a way to encode your S-expression into a string or series of strings, and to "parse" those strings directly into data.  This can help with startup time, too, since all that "code" may need to be verified (there's a lot of "it depends" here).

So for example:

   static Map<String, String> aliases = StringEncodedAggregate.stringToMap(encodedAliases,';',
                                                                    new BATree<String, String>(DefaultComparator.<String>normal()));

where encodedAliases looks like this:

   final private static String encodedAliases =
	"=/=;"+"NE;"+
	"ACUTE_ANGLE;"+"\u299f;"+
	"ALL_EQUAL_TO;"+"\u224c;"+
	"ALMOST_EQUAL_OR_EQUAL_TO;"+"\u224a;"+
	"ALMOST_EQUAL_TO;"+"APPROX;"+
...
	"\u3014;"+"[/;"+
	"\u3015;"+"/];"+
	"\u3016;"+"{/;"+
	"\u3017;"+"/};"+
	"\u3018;"+"[//;"+
	"\u3019;"+"//];";
(1220 lines, total).


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