From: albert@cal.enst.fr (Luc ALBERT)
To: caml-list@margaux.inria.fr
Subject: affichage de liste
Date: Thu, 22 Feb 1996 00:31:33 +0200 [thread overview]
Message-ID: <v01540501ad5134abaa85@[137.194.3.4]> (raw)
Bonjour voici une question suite a un echange mail avec P Dumas (inria) :
je cree avec caml une liste d'entiers assez longue par exemple a l'aide de
la fonction :
let rec integer_interval n m =
if m < n then []
else n :: ( integer_interval (n+1) m);;
ou de sa version imperative
let intervalle_entier n m =
let accu= ref [] in
for i =m downto n do
accu := i :: !accu done;
!accu ;;
(evidemment, j'entend d'ici les remarques : la premiere version est bien
plus claire et la deuxieme plus rapide et les reponses "c'est meme pas vrai
et puis on est dans les annees 90" ....)
la n'est pas la question (ceci dit si vous voulez reagir...)
quand je les lance entre 1 et 1000 je n'obtiens que le debut de la liste
(les 100 premiers termes
sont affiches) : y-a-t-il une limite a l'affichage d'une liste ?
merci
**************************
Luc ALBERT
prof prepa Lycee Charlemagne
Paris 04
**************************
PS : existe-t- il un style latex2e pour une belle inclusion de programmes
caml ? (avec des mots cles
en gras etc ...)
POOR ENGLISH VERSION
A question about lists printing. Here is the code of two CAML functions
let intervalle_entier n m =
let accu= ref [] in
for i =m downto n do
accu := i :: !accu done;
!accu ;;
or the recursive version
let rec integer_interval n m =
if m < n then []
else n :: ( integer_interval (n+1) m);;
the matter is not the comparison between the two versions of the function
but deals with the printing of the result.
If one executes these functions with arguments n=1 and m=1000 for instance,
only the beginning of the
list is printed (the first 100 terms I think). Is there a limit to output-
printing ?
Thanks
**************************
Luc ALBERT
Teacher at Lycee Charlemagne
Paris (France ! yeah)
**************************
PS: is there a latex2e style to include in an esthetic way caml programs in
documents ? (with bold-faced key words, smart indentation etc ...)
next reply other threads:[~1996-02-22 10:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-02-21 22:31 Luc ALBERT [this message]
1996-02-22 10:37 ` Pierre Weis
1996-02-22 11:22 ` Michel Mauny
1996-02-22 11:45 pbrisset
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='v01540501ad5134abaa85@[137.194.3.4]' \
--to=albert@cal.enst.fr \
--cc=caml-list@margaux.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox