Re: Is C# any good?

From: Daniel Bonniot (Daniel.Bonniot_at_inria.fr)
Date: 10/16/03


Date: Thu, 16 Oct 2003 16:54:21 +0200


> What you describe here is still overloading, if not Java
> overloading. It is just handled by the compiler in a different way.

You mean that a single function with optional parameters is a form of
"overloading"?

> OCaml has a similarly feature, and I actually wrote once about the same
> null-based implementation. The main reason (Some 2) and 2 do not share
> the same representation in ocaml is that the GC is too fast for this
> to matter.

My point was more about readability of the source than about efficiency.
It's still an interesting fact that the representation does not matter
much speed-wise.

> You were claiming that an important feature of ?-types is that A is a
> subtype of ?A. Have you got examples where this subtping cannot be
> replaced by the above kind of overloading?

Sorry, but I am getting confused about what "above" precisely refers
too, as we are speaking about several solutions. Could you clarify this?

However, I can see a way top use overloading to make function call as
convenient as if there was the subtyping. But that involves quite a lot
of tedious work furing function definition.

> Saying that ?-types are actually no more than cleverly implemented
> option types is not a criticism. I think the distinction between A and
> ?A is useful (even in a Java-like language), and that the tight
> integration of ?-types in the compiler considerably improves their
> comfort of use. This is what matters. And comfort is not a hack.

I completely agree with this. I just felt I would stress this comfort
advantage because I did not see it acknowledged in the initial post.

Daniel



Relevant Pages

  • Re: Python and Flaming Thunder
    ... the compiler optimizes it away, ... I think overloading your catch error types to include objects ... assignment could throw an error) makes things confusing. ...
    (comp.lang.python)
  • Re: Declaration design preference: type or name first
    ... the compiler defaults to integer. ... Haskell uses type classes to handle overloading. ... that is an instance of the Num type class and returns a value of the ... This would make it illegal to apply f to, say, a string, ...
    (comp.lang.misc)
  • Re: why cant functions return arrays
    ... at initialization. ... I think you don't understand your own compiler. ... but you have not specified how overloading works with arrays unless I ... Pointer + integer ...
    (comp.compilers.lcc)
  • Re: Operator overloading in C
    ... Operator overloading integrates cleanly with C. ... and not be part of the standard. ... Basically the algorithm for modifying the compiler runs like this: ... and the committee tands to prefer proposals ...
    (comp.std.c)
  • Re: Operator overloading in C
    ... Modify the lexer to recognize "operator" at the global ... the compiler copies foo into that address. ... I'd suggest leaving arrays out of this scheme, ... that would actually be needed for overloading would be structure ...
    (comp.std.c)