From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=AWL,HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 69890BBAF for ; Wed, 28 May 2008 01:10:33 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag0CAB4yPEjAXQImiGdsb2JhbACCNzaPUQEBAQ8glheFfg X-IronPort-AV: E=Sophos;i="4.27,550,1204498800"; d="scan'208";a="11196442" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 28 May 2008 01:10:33 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m4RNAVr3005841 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 28 May 2008 01:10:33 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj4GAB4yPEjRVcbpamdsb2JhbACCNzaPUQ0EAwYHDwWWFIV+ X-IronPort-AV: E=Sophos;i="4.27,550,1204498800"; d="scan'208";a="12802340" Received: from rv-out-0506.google.com ([209.85.198.233]) by mail1-smtp-roc.national.inria.fr with ESMTP; 28 May 2008 01:10:32 +0200 Received: by rv-out-0506.google.com with SMTP id k40so2595605rvb.57 for ; Tue, 27 May 2008 16:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=kDE0H6DwMSQRuS2GfwRSwPHmuJsioO/qu4JdgQNvrZU=; b=udNsNUxyDGHed2Bqot8sPdqIPKmiqcxSSM6e6uXfB6ol6/up0slcVV5o+xST0mEsTXndydpoCWhts9f173lhlAIMnJ918U6x3GEGF0XY++vnh7abTL58OrH50F5njsS1v8ato5tPCqyyPCzeDoPQNBoFrJxad3qPSWPF84BchVs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=cT16D59Rj7aCUiqAhh59GyolUi3dvmB/Hxam4Vgg8Wdfr+ncclHUDYMIrsxM2A6ByjOrnfhhl600lr58K0uKzwZnNHQjhQsk7lhkBRY6Tm7aExiPGjqU8Li+WihX3XOm1S8LbehH5Y/XNxtSP8cNLTKn9+jeirC6rZCicaS2ee4= Received: by 10.141.15.19 with SMTP id s19mr793731rvi.205.1211929831490; Tue, 27 May 2008 16:10:31 -0700 (PDT) Received: by 10.141.43.2 with HTTP; Tue, 27 May 2008 16:10:31 -0700 (PDT) Message-ID: Date: Tue, 27 May 2008 16:10:31 -0700 From: "Nathan Mishra Linger" To: caml-list@inria.fr Subject: surprised by string_of_bool MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_17462_12631618.1211929831499" X-Miltered: at discorde with ID 483C94E7.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bool:01 bool:01 nathan:98 nathan:98 disturbing:98 disturbing:98 caml:02 caml:02 objective:02 objective:02 string:02 string:02 seems:03 seems:03 float:03 ------=_Part_17462_12631618.1211929831499 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Consider the following transcript. Objective Caml version 3.10.0 # string_of_bool true == string_of_bool true;; - : bool = true # String.fill (string_of_bool true) 0 4 '@';; - : unit = () # string_of_bool true;; - : string = "@@@@" Perhaps this has been discussed before, but I found this to be disturbing. It seems easy enough to fix this problem, so that, for example, print_string (string_of_bool true) always does the same thing. The "correct" strategy seems to be used for string_of_float infinity: # string_of_float infinity;; - : string = "inf" # string_of_float infinity == string_of_float infinity;; - : bool = false Nathan Mishra-Linger ------=_Part_17462_12631618.1211929831499 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Consider the following transcript.

        Objective Caml version 3.10.0

# string_of_bool true == string_of_bool true;;
- : bool = true
# String.fill (string_of_bool true) 0 4 '@';;
- : unit = ()
# string_of_bool true;;
- : string = "@@@@"

Perhaps this has been discussed before, but I found this to be disturbing.
It seems easy enough to fix this problem, so that, for example, print_string (string_of_bool true) always does the same thing.
The "correct" strategy seems to be used for string_of_float infinity:

# string_of_float infinity;;
- : string = "inf"
# string_of_float infinity == string_of_float infinity;;
- : bool = false

Nathan Mishra-Linger
------=_Part_17462_12631618.1211929831499--