You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1530 Reporter: administrator Status: closed Resolution: won't fix Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general)
Bug description
Bonjour,
Un petit exercice sous OcamlWin et Emacs a mis en évidence un problème
lié aux entrées sorties sous Windows.
Le programme suivant demande de saisir un nombre au clavier puis
l'affiche après l'avoir divisé par 10 :
let main () =
Printf.printf "Entrez un nombre : ";
let s = read_line () in
Printf.printf "Vous avez entré : "%s"" s;
Printf.printf "Divisé par 10 : %d" (int_of_string s / 10)
;;
main ();;
Ce programme fonctionne parfaitement compilé avec ocamlc ou ocamlopt ou
en mode interactif sous DOS, mais sous OcamlWin et Emacs on obtient
généralement :
#use "C:/hello.ml";;
val main : unit -> unit =
Entrez un nombre : 200
Vous avez entré : "Entrez un nombre : 200"
Exception: Failure "int_of_string".
Que vient faire "Entrez un nombre : " dans la chaîne saisie ?
La version utilisant le module Scanf (après avoir compilé scanf.ml dans
la librairie standard car ce n'est pas fait par défaut) plante aussi
(sous OcamlWin et Emacs, pas sous DOS) :
#use "C:/hello.ml";;
val main : unit -> unit =
Entrez un nombre : 200
Exception: Failure "int_of_string".
Fichier hello.ml :
let main () =
Printf.printf "Entrez un nombre : ";
flush stdout;
let n = Scanf.scanf "%s" int_of_string in
Printf.printf "Vous avez entré : %d\n" n;
Printf.printf "Divisé par 10 : %d" (n / 10)
;;
main ();;
Cordialement,
Sébastien Furic.
The text was updated successfully, but these errors were encountered:
Both Emacs and OCamlWin send the whole line where the cursor is. This cannot
be
changed under Emacs, and probably will not be changed under OCamlWin anytime
soon.
Original bug ID: 1530
Reporter: administrator
Status: closed
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
Bonjour,
Un petit exercice sous OcamlWin et Emacs a mis en évidence un problème
lié aux entrées sorties sous Windows.
Le programme suivant demande de saisir un nombre au clavier puis
l'affiche après l'avoir divisé par 10 :
let main () =
Printf.printf "Entrez un nombre : ";
let s = read_line () in
Printf.printf "Vous avez entré : "%s"" s;
Printf.printf "Divisé par 10 : %d" (int_of_string s / 10)
;;
main ();;
Ce programme fonctionne parfaitement compilé avec ocamlc ou ocamlopt ou
en mode interactif sous DOS, mais sous OcamlWin et Emacs on obtient
généralement :
#use "C:/hello.ml";;
val main : unit -> unit =
Entrez un nombre : 200
Vous avez entré : "Entrez un nombre : 200"
Exception: Failure "int_of_string".
Que vient faire "Entrez un nombre : " dans la chaîne saisie ?
La version utilisant le module Scanf (après avoir compilé scanf.ml dans
la librairie standard car ce n'est pas fait par défaut) plante aussi
(sous OcamlWin et Emacs, pas sous DOS) :
#use "C:/hello.ml";;
val main : unit -> unit =
Entrez un nombre : 200
Exception: Failure "int_of_string".
Fichier hello.ml :
let main () =
Printf.printf "Entrez un nombre : ";
flush stdout;
let n = Scanf.scanf "%s" int_of_string in
Printf.printf "Vous avez entré : %d\n" n;
Printf.printf "Divisé par 10 : %d" (n / 10)
;;
main ();;
Cordialement,
Sébastien Furic.
The text was updated successfully, but these errors were encountered: