Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string-map fails to return an expected value when invoking a continuation captured in given procedure #199

Closed
tabe opened this issue Mar 31, 2016 · 1 comment

Comments

@tabe
Copy link
Contributor

tabe commented Mar 31, 2016

Inspired by #198:

$ gosh -r7
gosh[r7rs.user]> (let ((gauche "Gauche")
      (c #f)
      (f char-downcase)
      (g! set-car!)
      (r (cons #f #f)))
  (g! r (string-map (lambda (x)
                      (if (and (char=? x #\c) (not c))
                          (call/cc (lambda (cc) (set! c cc) (f x)))
                          (f x)))
                    gauche))
  (if c
      (let ((cc c))
        (set! c #f)
        (set! f char-upcase)
        (set! g! set-cdr!)
        (cc #\X))
      r))
("gauche" . "gaucheX")
gosh[r7rs.user]> 

I think its expected value is ("gauche" . "gauXHE").

@shirok
Copy link
Owner

shirok commented Mar 31, 2016

Good catch!

shirok added a commit that referenced this issue Mar 31, 2016
Cf. #199
Tests will come in separate commit.
@shirok shirok closed this as completed Mar 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants