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

Fix collision of "i" at example in basics-server.wiki #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Yukimura66
Copy link

I found that following example in "Eliom: Typing page parameters" doesn't work.

let () =
  Eliom_registration.Html.register ~service:myservice
    (fun (s, i) () ->
      Lwt.return
         Eliom_content.Html.F.(html (head (title (txt "")) [])
                                    (body [h1 [txt (s^string_of_int i)]])))

In definition of html, symbol i is used for parameter, but this collide to element for list item. So I replaced symbol i to num, as following.

let () =
  Eliom_registration.Html.register ~service:myservice
    (fun (s, num) () ->
      Lwt.return
         Eliom_content.Html.F.(html (head (title (txt "")) [])
                                    (body [h1 [txt (s^string_of_int num)]])))

I found that following example in "Eliom: Typing page parameters" doesn't work.

```ocaml
let () =
  Eliom_registration.Html.register ~service:myservice
    (fun (s, i) () ->
      Lwt.return
         Eliom_content.Html.F.(html (head (title (txt "")) [])
                                    (body [h1 [txt (s^string_of_int i)]])))
```

In definition of html, symbol `i` is used for parameter, but this collide to element for list item.
So I replaced symbol `i` to `num`, as following.

```ocaml
let () =
  Eliom_registration.Html.register ~service:myservice
    (fun (s, num) () ->
      Lwt.return
         Eliom_content.Html.F.(html (head (title (txt "")) [])
                                    (body [h1 [txt (s^string_of_int num)]])))
```
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

Successfully merging this pull request may close these issues.

None yet

1 participant