- in
- Http_daemon.send_basic_headers ~code:200 outchan ;
- Http_daemon.send_CRLF outchan ;
- iter_file
- (fun line ->
- let processed_line =
- apply_substs
- [interpretations_RE, html_interpretations;
- interpretations_labels_RE, html_interpretations_labels]
- line
- in
- output_string outchan (processed_line ^ "\n"))
- interactive_interpretation_choice_TPL;
- raise Chat_unfinished
+ in
+ let html_interpretations =
+ let rec aux n =
+ function
+ [] -> []
+ | _::tl -> ("'" ^ string_of_int n ^ "'")::(aux (n+1) tl)
+ in
+ String.concat ", " (aux 0 interpretations)
+ in
+ Http_daemon.send_basic_headers ~code:200 outchan ;
+ Http_daemon.send_CRLF outchan ;
+ iter_file
+ (fun line ->
+ let processed_line =
+ apply_substs
+ [interpretations_RE, html_interpretations;
+ interpretations_labels_RE, html_interpretations_labels]
+ line
+ in
+ output_string outchan (processed_line ^ "\n"))
+ interactive_interpretation_choice_TPL;
+ raise Chat_unfinished