digitalmars.D - Why not support auto Boxing/unBoxing?
- uframer (13/13) Jan 01 2005 Auto Boxing/unBoxing can make the type system complete. It can make some
- Walter (9/22) Jan 01 2005 can
- Carlos Santander B. (10/27) Jan 31 2005 The D Template Library (dtl, by Matthew Wilson, somewhat outdated ATM)
Auto Boxing/unBoxing can make the type system complete. It can make some
common cases easy/simple without making others ugly('cause we have
template:). Well, it may cause some performance problems, but i think we can
avoid these by using template. Template can do most of auto boxing/unboxing
do, but look at the example below:
public class Console
{
    public static void Write(string fmt, params object[] args);
}
i think all of you can under what these codes mean, it's handy. Can we use
template to archieve this in a splitted type system?
Waiting for your advices:)
 Jan 01 2005
"uframer" <uframer sina100.com> wrote in message news:cr7njl$18j3$1 digitaldaemon.com...Auto Boxing/unBoxing can make the type system complete. It can make some common cases easy/simple without making others ugly('cause we have template:). Well, it may cause some performance problems, but i think wecanavoid these by using template. Template can do most of autoboxing/unboxingdo, but look at the example below: public class Console { public static void Write(string fmt, params object[] args); } i think all of you can under what these codes mean, it's handy. Can we use template to archieve this in a splitted type system? Waiting for your advices:)Autoboxing/unboxing are necessary features for a template system that does not support partial or explicit specialization. Since D does, the boxing support doesn't add critical value. I've always been a bit uncomfortable with it anyway from an efficiency standpoint. (Also, D has another way of doing typesafe variable argument lists.)
 Jan 01 2005
uframer wrote:
 Auto Boxing/unBoxing can make the type system complete. It can make some
 common cases easy/simple without making others ugly('cause we have
 template:). Well, it may cause some performance problems, but i think we can
 avoid these by using template. Template can do most of auto boxing/unboxing
 do, but look at the example below:
 public class Console
 {
     public static void Write(string fmt, params object[] args);
 }
 
 i think all of you can under what these codes mean, it's handy. Can we use
 template to archieve this in a splitted type system?
 
 Waiting for your advices:)
 
 
The D Template Library (dtl, by Matthew Wilson, somewhat outdated ATM) 
provides std.box, but I can't guarantee you it'll work with the most 
recent DMD.
The Apropos Library (by Andy Friesen, also outdated) also provides a 
boxing/unboxing feature. Again, I can't guarantee anything.
Also, for "a function to take arbitrary parameters" (as you put it), you 
can use a variadic funtion.
_______________________
Carlos Santander Bernal
 Jan 31 2005








 
  
  
 
 "Walter" <newshound digitalmars.com>
 "Walter" <newshound digitalmars.com> 