caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alex Baretta <alex@barettadeit.com>
To: Ocaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Another polymorphism puzzle
Date: Fri, 01 Apr 2005 11:45:03 +0200	[thread overview]
Message-ID: <424D181F.1040604@barettadeit.com> (raw)
In-Reply-To: <20050401.132956.74753023.garrigue@math.nagoya-u.ac.jp>

Jacques Garrigue wrote:
> From: Manos Renieris <er@cs.brown.edu>
> 
>>Worse:
>>
>># let f x = { () with foo = 3};;                    
>>val f : 'a -> int t = <fun>
>># let f x = { 42 with foo = 3};; 
>>val f : 'a -> int t = <fun>
>>
>>I think this qualifies as a bug. Especially since the documentation
>>says the expr on the left hand side of with has to be a record.
> 
> 
> What do you mean by worse? You just exhibit an immediate consequence
> of the typing of f below.

I think that "worse" here stands for "completely counterintuitive".

> Following the manual, the typing could be more restrictive, but the
> current typing is perfectly sound.
> 
> Jacques Garrigue

I doubt that any one of us has every written buggy code like the 
examples in this thread, yet, it it ever happens out of pure thermal 
agitation in the PS2 cable, I would expect the type checker to track 
down such "unsound" code, even if it would not cause a segfault.

Alex

-- 
*********************************************************************
http://www.barettadeit.com/
Baretta DE&IT
A division of Baretta SRL

tel. +39 02 370 111 55
fax. +39 02 370 111 54

Our technology:

The Application System/Xcaml (AS/Xcaml)
<http://www.asxcaml.org/>

The FreerP Project
<http://www.freerp.org/>


      reply	other threads:[~2005-04-01 10:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-01  2:02 Yaron Minsky
2005-04-01  2:32 ` [Caml-list] " Karl Zilles
2005-04-01  2:52 ` Manos Renieris
2005-04-01  4:29   ` Jacques Garrigue
2005-04-01  9:45     ` Alex Baretta [this message]

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=424D181F.1040604@barettadeit.com \
    --to=alex@barettadeit.com \
    --cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).