caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Bruce Hoult <bruce@hoult.org>
To: John Max Skaller <skaller@ozemail.com.au>,
	Chet Murthy <chet@watson.ibm.com>
Cc: Chris Hecker <checker@d6.com>,
	Mattias Waldau <mattias.waldau@abc.se>,
	Caml-List <caml-list@inria.fr>
Subject: Re: Same label in different types, how do people solve this?
Date: Sat, 16 Dec 2000 10:51:59 +1300	[thread overview]
Message-ID: <a04310103b660411e1d13@[192.168.0.12]> (raw)
In-Reply-To: <3A3663B5.412BECE2@ozemail.com.au>

At 4:43 AM +1100 13/12/00, John Max Skaller wrote:
>Chet Murthy wrote:
>
>>  The issue, about practicality, isn't whether you _can_ specify the
>>  particular types and type-usages you want.  The issue is whether, if
>>  you write a phrase, and you got it wrong, you have to know all about
>>  the type system, in order to debug that phrase.
>
>It is a tradeoff. Full inference makes code short: lack of
>inference severely pollutes programming style (as in C++).
>In Felix, I compromised: functions must be explicitly typed
>when declared, but values don't:
>
>	function f(a:int): int { val b = a; return b; }
>
>f must be explicitly typed. The type of b is deduced.

That's how most code gets written in Dylan.  You need to declare 
argument types for methods of generic functions so that the 
polymorphic dispatch can figure out which method to call for which 
actual arguments.  Once you've done that, the compiler can often 
figure out all the types within the method by itself.

Internal functions -- anonymous arguments to things such as map(), 
and ones used for tail-recursive looping, for example -- don't tend 
to have their arguments declared.

The difference between Dylan and ML-family languages is, of course, 
that in ML if the compiler can't figure out some types it complains, 
whereas Dylan just says "oh well, it's <object>, then", and you 
silently end up with less efficient code.  A good compiler will have 
tools to tell you about this sort of thing when you want to know 
about it, and ignore it otherwise.

-- Bruce



  parent reply	other threads:[~2000-12-18 14:44 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-06 21:22 Mattias Waldau
2000-12-07 16:49 ` John Max Skaller
2000-12-07 18:34 ` Maxence Guesdon
2000-12-07 23:02 ` Gerd Stolpmann
2000-12-08  1:22 ` Jacques Garrigue
2000-12-08  9:31   ` Sven LUTHER
2000-12-08  9:36     ` Pierre Weis
2000-12-08  9:48       ` Sven LUTHER
2000-12-08 18:41       ` John Max Skaller
2000-12-08  9:40     ` Nicolas barnier
2000-12-08 16:36 ` Brian Rogoff
2000-12-11 17:19   ` Pierre Weis
2000-12-10 12:49 ` Mattias Waldau
2000-12-11 18:23   ` Chris Hecker
2000-12-11 19:17     ` Pierre Weis
2000-12-12 10:02       ` Sven LUTHER
2000-12-12  3:25     ` Chet Murthy
2000-12-12 17:43       ` John Max Skaller
2000-12-12 19:24         ` Functions must be explicitly typed, (was Same label in different types, how do people solve this?) Mattias Waldau
2000-12-13  0:51           ` John Max Skaller
2000-12-15 10:13             ` Andreas Rossberg
2000-12-15 12:50             ` Frank Atanassow
2000-12-14 18:42           ` Stefan Monnier
2000-12-15 12:47             ` Pierre Weis
2000-12-15 13:39               ` Mattias Waldau
2000-12-15 23:37                 ` Brian Rogoff
2000-12-16 14:10                 ` ROverloading John Max Skaller
2000-12-15 21:51         ` Bruce Hoult [this message]
2000-12-12 17:19   ` Same label in different types, how do people solve this? John Max Skaller
2000-12-10 14:57 Ohad Rodeh
2000-12-13 13:17 Dave Berry
2000-12-13 14:31 ` Mattias Waldau
2000-12-15 10:01   ` John Max Skaller

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='a04310103b660411e1d13@[192.168.0.12]' \
    --to=bruce@hoult.org \
    --cc=caml-list@inria.fr \
    --cc=checker@d6.com \
    --cc=chet@watson.ibm.com \
    --cc=mattias.waldau@abc.se \
    --cc=skaller@ozemail.com.au \
    /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).