HomeAboutCodePastes

Paste on 2021-03-03T12:03:29

(module srfi.169 ()
  (import scheme
          chicken.base
          chicken.platform
          chicken.irregex)

  (register-feature! 'srfi-169)

  (define orig-sys ##sys#string->number)
  (set! ##sys#string->number
    (lambda (str . rest)
      (apply orig-sys
             (irregex-replace/all "([0-9A-Z])_(?=[0-9A-Z])" str 1)
             rest)))

  (define orig-scheme string->number)
  (set! scheme#string->number
    (lambda (str . rest)
      (apply orig-scheme
             (irregex-replace/all "([0-9A-Z])_(?=[0-9A-Z])" str 1)
             rest))))

plain