Arc Forumnew | comments | leaders | submitlogin
4 points by pg 5439 days ago | link | parent

Thanks, this was a bug. Rtm has fixed it and his fix is now in the current version (http://ycombinator.com/arc/arc3.tar).


3 points by conanite 5439 days ago | link

oops ...

  arc> (coerce "foo" 'num)
  #f
I think this should be

  arc> (coerce "foo" 'num)
  Error: "Can't coerce \"foo\" num"
The fix for http://arclanguage.org/item?id=9450 in ac.scm seems to be missing the guard clause for the case where the string is not parsable as a 'num

  ((string? x)    (case type
                  ((sym)    (string->symbol x))
                  ((cons)   (ac-niltree (string->list x)))
;; -> num needs to be checked same way as 'int in the subsequent clause

                  ((num)    (apply string->number x args)) 

                  ((int)    (let ((n (apply string->number x args)))
                              (if n 
                                  (iround n)
                                  (err "Can't coerce" x type))))
                  (else     (err "Can't coerce" x type))))

-----

3 points by pg 5439 days ago | link

Yes, you're right. It's now fixed in arc3.tar.

-----