{"action":"opened","issue":{"url":"https://api.github.com/repos/shirok/Gauche/issues/129","labels_url":"https://api.github.com/repos/shirok/Gauche/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/shirok/Gauche/issues/129/comments","events_url":"https://api.github.com/repos/shirok/Gauche/issues/129/events","html_url":"https://github.com/shirok/Gauche/issues/129","id":121626082,"number":129,"title":"Parameterize doesn't rewind correctly","user":{"login":"shirok","id":190598,"avatar_url":"https://avatars.githubusercontent.com/u/190598?v=3","gravatar_id":"","url":"https://api.github.com/users/shirok","html_url":"https://github.com/shirok","followers_url":"https://api.github.com/users/shirok/followers","following_url":"https://api.github.com/users/shirok/following{/other_user}","gists_url":"https://api.github.com/users/shirok/gists{/gist_id}","starred_url":"https://api.github.com/users/shirok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirok/subscriptions","organizations_url":"https://api.github.com/users/shirok/orgs","repos_url":"https://api.github.com/users/shirok/repos","events_url":"https://api.github.com/users/shirok/events{/privacy}","received_events_url":"https://api.github.com/users/shirok/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-11T03:00:43Z","updated_at":"2015-12-11T03:00:43Z","closed_at":null,"body":"When an error is thrown within guard procedure.\r\n\r\nReported by Joo ChurlSoo.  Here's a sample session exhibiting the bug.\r\n\r\ngosh> (use gauche.parameter)\r\n#<undef>\r\ngosh>\r\n(define a (make-parameter 1 number->string))\r\n(define b (make-parameter 2 number->string))\r\na\r\ngosh> b\r\ngosh> (list (a) (b))\r\n(\"1\" \"2\")\r\ngosh> (parameterize ((a 10) (b 20) (a 30) (b 40)) (list (a) (b)))\r\n(\"30\" \"40\")\r\ngosh> (list (a) (b))\r\n(\"10\" \"20\")\r\ngosh> (a 1) (b 2)\r\n\"10\"\r\ngosh> \"20\"\r\ngosh> (list (a) (b))\r\n(\"1\" \"2\")\r\ngosh> (parameterize ((a 10) (b 20) (a 30) (b 'ab)) (list (a) (b)))\r\n*** ERROR: number required: ab\r\nStack Trace:\r\n_______________________________________\r\n  0  (P L)\r\n        [unknown location]\r\n  1  (^ () (set! S (P L)) (set! S (P L)) (set! S (P L)) (set! S (P L)))\r\n        [unknown location]\r\n  2  (eval expr env)\r\n        At line 179 of \"c:\\\\tilde\\\\gauche\\\\share\\\\gauche-0.9\\\\0.9.4\\\\lib/gauche/interactive.scm\"\r\ngosh> (list (a) (b))\r\n(\"30\" \"20\")\r\ngosh> (let ((f (make-parameter 'a))\r\n            (path '())\r\n            (g (make-parameter 'g))\r\n            (c #f))\r\n        (let ((add (lambda () (set! path (cons (f) path)))))\r\n          (add)\r\n          (parameterize ((f 'b)\r\n                         (g (call-with-current-continuation\r\n                             (lambda (c0) (set! c c0) 'c))))\r\n                        (add) (f (g)) (add))\r\n          (f 'd)\r\n          (add)\r\n          (if (< (length path) 5)\r\n              (c 'e)\r\n              (reverse path))))\r\n(a b c d c e d)                 ;; cf. (a b c d b e d)"}}