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

Loaded code and code displayed are different? #58

Closed
spavikevik opened this issue Jul 28, 2018 · 2 comments
Closed

Loaded code and code displayed are different? #58

spavikevik opened this issue Jul 28, 2018 · 2 comments

Comments

@spavikevik
Copy link

In the Non-determinism example on the website, the backtrack handler code is written like this

let backtrack = handler
  | effect Decide k ->
    (* We use a second handler to handle the continuation. *)
    handle continue k false with
    | effect Fail _ -> continue k true
;;

However, it seems to me, that the paper defines it like follows

let backtrack = handler
  | effect Decide k ->
    (* We use a second handler to handle the continuation. *)
    handle continue k true with
    | effect Fail _ -> continue k false
;;

Notice that the continuations are reversed

When I try loading the code in the REPL, the handler behaves correctly (I believe), even though the code shown above the REPL is wrong.

I am not sure whether this is a misunderstanding on my side or a bug, but I would be appreciative if someone could take a look at it.

@spavikevik
Copy link
Author

spavikevik commented Jul 28, 2018

On a second look, I didn't notice that backtrack is overriden later in the code

@matijapretnar
Copy link
Owner

Hmmm, the second definition was probably unintentional, so I removed it. Thanks!

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