Skip to content

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

Open
Yukimura66 wants to merge 1 commit intoocsigen:masterfrom
Yukimura66:fix-example-eliom-parameter
Open

Fix collision of "i" at example in basics-server.wiki#38
Yukimura66 wants to merge 1 commit intoocsigen:masterfrom
Yukimura66:fix-example-eliom-parameter

Conversation

@Yukimura66
Copy link
Copy Markdown

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.

2 participants