[cl-json-devel] cl-json depends on lisp reader?

Robert Goldman rpgoldman at sift.info
Sun Nov 4 21:57:11 UTC 2012


OK, I have a patch along the lines of my previous email.  I will try to
convince darcs to let me pass it on.

It passes tests on

ACL 8.2
SBCL 1.1
CCL 1.8
clisp 2.49
ABCL 1.0.1 [but I had to fix ARNESI, see below, or the tests wouldn't run]


It *FAILS* the tests on ECL, seemingly because of problems with floating
point comparisons:

JSON-NUMBER []:
      (DECODE-JSON-FROM-STRING "-2.3e3") evaluated to -2300.0002, which
is not = to -2300.0..
 --------------------------------
 --------------------------------
 JSON-NUMBER []:
      (DECODE-JSON-FROM-STRING "-3e4") evaluated to -30000.004, which is
not = to -30000.0..
 --------------------------------
 --------------------------------
 JSON-NUMBER []:
      (DECODE-JSON-FROM-STRING "3e4") evaluated to 30000.004, which is
not = to 30000.0..
 --------------------------------
 --------------------------------
 JSON-NUMBER []:
      (DECODE-JSON-FROM-STRING "2e40") evaluated to
2.0000000000000315e40, which is not = to 2.e40..
 --------------------------------
 --------------------------------
 JSON-NUMBER []:
      (WITH-FP-OVERFLOW-HANDLER (INVOKE-RESTART 'BIGNUMBER-STRING "BIG:")
                          (DECODE-JSON-FROM-STRING "2e444")) evaluated
to #.ext::single-float-positive-infinity, which is not EQUALP to
"BIG:2e444"..
 --------------------------------
 --------------------------------
 JSON-NUMBER []:
      Unexpected Error: #<a ARITHMETIC-ERROR>
#<a ARITHMETIC-ERROR>..

I do not know how to fix these.

I need to check and see if these tests pass under the current version of
CL-JSON with ECL, or if the failures are independent of my modifications.


* I was not able to test on ABCL because the matcher function definition
in ARNESI (which is used by FiveAM), cannot be compiled in ABCL:

(defstruct (match-state (:conc-name ||))
  target
  bindings
  matched)

Changing the :CONC-NAME to "" fixed the problem.  I don't know if this
is a bug in ABCL or ARNESI.




More information about the cl-json-devel mailing list