A pattern like (.)? causes the following error:

racket@> (regexp-replace* #px"(.)?" "a" (lambda args "foo"))
car: expects argument of type <pair>; given #f

 === context ===
/usr/local/plt-head/collects/racket/private/string.rkt:174:7: loop
/usr/local/plt-head/collects/racket/private/string.rkt:314:11: core
/usr/local/plt-head/collects/racket/private/misc.rkt:78:7


Replace the insert function with a string and it works:

racket@> (regexp-replace* #px"(.)?" "a" "foo")
"foofoo"


Get rid of the ? and it works:

racket@> (regexp-replace* #px"(.)" "a" (lambda args "foo"))
"foo"


I guess this has to do with constructing the args list to apply to the
insert function.

N.
_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to