From: Ken A. <kan...@bb...> - 2003-04-07 21:32:04
|
Tim, I think we need to refactor the code in InputPort for reading numbers. Over the weekend, i found that with U.useJavaSyntax$ = #f we did not correctly parse #xff. This was due to a bug in my maybeNumber optimization which did not include radix because it looked like radix wasn't involved, but it was deeper down. Radix was a syncronized variable at this point. Yes developers, read the last sentence carefully. Good reason to learn functional programming! Radix is set in a synchronized method, which i changed to be readHashedNumber() it calls readToken which is over kill at this point. It eventually calls readNumberOrSymbol(ch) This is also too general. It sucessfully reads #x ff as 255 while PLT scheme gives the error read-number: no digits It also produces this uninformative error: > #xg SchemeException:[[ERROR: undefined variable "g"""]] at jsint.E.error(E.java:14) at jsint.E.error(E.java:19) at jsint.DynamicEnvironment.getValue(DynamicEnvironment.java:102) at jsint.DynamicVariable.getDynamicValue(DynamicVariable.java:13) at jsint.Scheme.execute(Scheme.java:498) at jsint.Scheme.eval(Scheme.java:425) at jsint.Scheme.eval(Scheme.java:414) at jsint.Scheme.readEvalWriteLoop(Scheme.java:208) at jsint.Scheme.runJscheme(Scheme.java:186) at jsint.Scheme.defaultMain(Scheme.java:149) at jsint.Scheme.main(Scheme.java:124) at jscheme.REPL.main(REPL.java:138) > |