Thread overview | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
August 23, 2005 Contradiction? | ||||
---|---|---|---|---|
| ||||
Direct quote from Phobos documentation: "No pointless wrappers around C runtime library functions or OS API functions. D provides direct access to C runtime library functions and operating system API functions. Pointless D wrappers around those functions just adds blather, bloat, baggage and bugs." std.cstream: class CFile : Stream A Stream wrapper for a C file of type FILE*. :-) Regards, James Dunne |
August 23, 2005 Re: Contradiction? | ||||
---|---|---|---|---|
| ||||
Posted in reply to James Dunne | James Dunne wrote: > Direct quote from Phobos documentation: > "No pointless wrappers around C runtime library functions or OS API functions. D > provides direct access to C runtime library functions and operating system API > functions. Pointless D wrappers around those functions just adds blather, bloat, > baggage and bugs." > > std.cstream: > > class CFile : Stream > A Stream wrapper for a C file of type FILE*. On what basis have you concluded that this is a _pointless_ wrapper? Does the addition of functionality and potential robustness not constitute a point? OTOH look at std.math. Half the stuff in there looks more like pointless wrappers from where I am. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- a->--- UB@ P+ L E@ W++@ N+++ o K- w++@ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
August 24, 2005 Re: Contradiction? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | Stewart Gordon wrote:
> James Dunne wrote:
>
>> Direct quote from Phobos documentation:
>> "No pointless wrappers around C runtime library functions or OS API functions. D
>> provides direct access to C runtime library functions and operating system API
>> functions. Pointless D wrappers around those functions just adds blather, bloat,
>> baggage and bugs."
>>
>> std.cstream:
>>
>> class CFile : Stream
>> A Stream wrapper for a C file of type FILE*.
>
>
> On what basis have you concluded that this is a _pointless_ wrapper? Does the addition of functionality and potential robustness not constitute a point?
>
> OTOH look at std.math. Half the stuff in there looks more like pointless wrappers from where I am.
Yes, they are just removing the "l" from the std library names.
std.c.math:
-------------------------
extern (C):
real acosl(real);
-------------------------
std.math
-------------------------
real acos(real x) { return std.c.math.acosl(x); }
-------------------------
Why not, in std.math:
alias std.c.math.acosl acos;
Or could we even extend the syntax for extern and/or alias so that you could write:
alias extern (C): real acosl(real) acos;
or (nicer)
extern (C):
alias real acosl(real) acos;
and remove std.c.math entirely?
There does not seem to be any purpose in having 'acosl' defined.
Don.
|
August 25, 2005 Re: Contradiction? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don Clugston | "Don Clugston" <dac@nospam.com.au> wrote in message news:degfdm$185$1@digitaldaemon.com... > Stewart Gordon wrote: > > OTOH look at std.math. Half the stuff in there looks more like pointless wrappers from where I am. > > Yes, they are just removing the "l" from the std library names. > > std.c.math: > ------------------------- > extern (C): > > real acosl(real); > ------------------------- > std.math > ------------------------- > real acos(real x) { return std.c.math.acosl(x); } > ------------------------- It isn't quite pointless. The idea is to remove the "hungarian notation" postfixes as they are unnecessary in a language that supports overloading. > Why not, in std.math: > > alias std.c.math.acosl acos; > > Or could we even extend the syntax for extern and/or alias so that you could write: > > alias extern (C): real acosl(real) acos; > > or (nicer) > > extern (C): > alias real acosl(real) acos; > > > and remove std.c.math entirely? Aliases cannot change the type or calling convention, after all, they are merely another name for a symbol. What's in an alias? That which we call a rose by any other alias would smell as sweet. |
August 25, 2005 Re: Contradiction? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | > It isn't quite pointless. The idea is to remove the "hungarian notation" postfixes as they are unnecessary in a language that supports overloading. Are you aware of the origin(al) of Hungarian notation? http://www.joelonsoftware.com/articles/Wrong.html (Starting at "I'm Hungary" section.) ElfQT ps, I'm from hungary, by the way ;). really. "Walter" <newshound@digitalmars.com> wrote in message news:dejco0$1toc$3@digitaldaemon.com... > > "Don Clugston" <dac@nospam.com.au> wrote in message news:degfdm$185$1@digitaldaemon.com... > > Stewart Gordon wrote: > > > OTOH look at std.math. Half the stuff in there looks more like pointless wrappers from where I am. > > > > Yes, they are just removing the "l" from the std library names. > > > > std.c.math: > > ------------------------- > > extern (C): > > > > real acosl(real); > > ------------------------- > > std.math > > ------------------------- > > real acos(real x) { return std.c.math.acosl(x); } > > ------------------------- > > It isn't quite pointless. The idea is to remove the "hungarian notation" postfixes as they are unnecessary in a language that supports overloading. > > > > Why not, in std.math: > > > > alias std.c.math.acosl acos; > > > > Or could we even extend the syntax for extern and/or alias so that you could write: > > > > alias extern (C): real acosl(real) acos; > > > > or (nicer) > > > > extern (C): > > alias real acosl(real) acos; > > > > > > and remove std.c.math entirely? > > Aliases cannot change the type or calling convention, after all, they are merely another name for a symbol. What's in an alias? That which we call a rose by any other alias would smell as sweet. > > |
August 25, 2005 Re: Contradiction? | ||||
---|---|---|---|---|
| ||||
Posted in reply to ElfQT | ElfQT wrote: >> It isn't quite pointless. The idea is to remove the "hungarian notation" >> postfixes as they are unnecessary in a language that supports overloading. > > Are you aware of the origin(al) of Hungarian notation? > http://www.joelonsoftware.com/articles/Wrong.html > (Starting at "I'm Hungary" section.) <snip> Strong typedefs can be an even safer alternative ... up until you get bitten by this issue.... http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/3843 Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- a->--- UB@ P+ L E@ W++@ N+++ o K- w++@ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
August 25, 2005 Re: Contradiction? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | > http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/3843
Nice one. When I first read of alias and typedef,
I've felt that typef should work as really a different type (so it should
find the "right" overload).
(Now I'm not that sure about it's design goal...)
So is that still a bug?
ElfQT
|
August 25, 2005 Re: Contradiction? | ||||
---|---|---|---|---|
| ||||
Posted in reply to ElfQT | ElfQT wrote:
>>It isn't quite pointless. The idea is to remove the "hungarian notation"
>>postfixes as they are unnecessary in a language that supports overloading.
>
>
> Are you aware of the origin(al) of Hungarian notation?
> http://www.joelonsoftware.com/articles/Wrong.html
> (Starting at "I'm Hungary" section.)
>
> ElfQT
> ps, I'm from hungary, by the way ;). really.
>
>
> "Walter" <newshound@digitalmars.com> wrote in message
> news:dejco0$1toc$3@digitaldaemon.com...
>
>>"Don Clugston" <dac@nospam.com.au> wrote in message
>>news:degfdm$185$1@digitaldaemon.com...
>>
>>>Stewart Gordon wrote:
>>>
>>>>OTOH look at std.math. Half the stuff in there looks more like
>>>>pointless wrappers from where I am.
>>>
>>>Yes, they are just removing the "l" from the std library names.
>>>
>>>std.c.math:
>>>-------------------------
>>>extern (C):
>>>
>>>real acosl(real);
>>>-------------------------
>>>std.math
>>>-------------------------
>>>real acos(real x) { return std.c.math.acosl(x); }
>>>-------------------------
>>
>>It isn't quite pointless. The idea is to remove the "hungarian notation"
>>postfixes as they are unnecessary in a language that supports overloading.
>>
>>
>>
>>>Why not, in std.math:
>>>
>>>alias std.c.math.acosl acos;
>>>
>>>Or could we even extend the syntax for extern and/or alias so that you
>>>could write:
>>>
>>>alias extern (C): real acosl(real) acos;
>>>
>>>or (nicer)
>>>
>>>extern (C):
>>>alias real acosl(real) acos;
>>>
>>>
>>>and remove std.c.math entirely?
>>
>>Aliases cannot change the type or calling convention, after all, they are
>>merely another name for a symbol. What's in an alias? That which we call a
>>rose by any other alias would smell as sweet.
>>
>>
>
>
>
That was brought up before ...
"Making Wrong Code Look Wrong" <<< that is wrong
What we should do instead, is "Make wrong code produce a compiler error" , with strong typing.
|
August 25, 2005 Re: Contradiction? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Hasan Aljudy | Hasan Aljudy wrote: <snip> > That was brought up before ... > "Making Wrong Code Look Wrong" <<< that is wrong > What we should do instead, is "Make wrong code produce a compiler error" , with strong typing. See also http://www.digitalmars.com/d/archives/digitalmars/D/11512.html Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- a->--- UB@ P+ L E@ W++@ N+++ o K- w++@ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
August 26, 2005 Re: Contradiction? | ||||
---|---|---|---|---|
| ||||
Posted in reply to ElfQT | "ElfQT" <dethjunk@yahoo.com> wrote in message news:dekh99$1m7a$1@digitaldaemon.com... > > It isn't quite pointless. The idea is to remove the "hungarian notation" postfixes as they are unnecessary in a language that supports overloading. > > Are you aware of the origin(al) of Hungarian notation? > http://www.joelonsoftware.com/articles/Wrong.html > (Starting at "I'm Hungary" section.) Yes (I like reading Joel's essays, he's very good). I was using the popular meaning of the term. I think the original meaning is gone for good, like the original meaning of "hacker" <g>. |
Copyright © 1999-2021 by the D Language Foundation