October 02, 2006
"Derek Parnell" <derek@nomail.afraid.org> wrote in message news:96d4ls69hbtj.cdpdafq3hhs3.dlg@40tude.net...

> LOL... I used to think that way too until I actually tried a purpose-built newsreader that adhered to standards. I'll never go back to that toy newsreader again.

Thing is, I tried Thunderbird, and .. I couldn't really tell a difference from OE.  Except that it was slower.

Are there any other good free readers for Windows then?


October 03, 2006
Stewart Gordon wrote:
> Reiner Pope wrote:
>> As we all know, opCast can only have one overload per class, because D doesn't support overloading by return type. That is a really silly limitation, in my opinion. Anyway, I have a solution here: give it a parameter, which is the type (we pass this parameter in the form of a template). Here's the magic:
>>
>> class Test
>> {
>>     int x;
>>     Foo myCast(TFoo : Foo)() { static assert(is(TFoo == Foo), "No cast of the required type exists"); return new Foo(x); }
> <snip>
> 
> Something to this effect has been proposed before.
> 
> However, the idea of having to put a static assert in each would make it somewhat more cumbersome than it should be.  Moreover, a problem with using templates is deciding how the vtbl would work.
> 
> There have been a number of proposals for ways to do multiple casts.
> 
> http://www.prowiki.org/wiki4d/wiki.cgi?FeatureRequestList
> 
> My proposal:
> 
> http://tinyurl.com/p2pn4
> 
> Stewart.
> 
> 

Well, while we're on the topic, I might as well mention this variant as well. :)

class Foobar{
  void* opCast(TypeInfo type){
    /* perform cast and return instance/value as needed
  }
}

Not only does this play fair with D's overload rules (no overload by return type) but it handles every possible case for casting, and IMO, is no more cumbersome than varargs are. For what it's worth, the runtime already does something similar when a dynamic cast is required.
October 03, 2006
pragma wrote:
<snip>
> Well, while we're on the topic, I might as well mention this variant as well. :)
> 
> class Foobar{
>   void* opCast(TypeInfo type){
>     /* perform cast and return instance/value as needed
>   }
> }
<snip>

How can you return an artibrary value as a void*?  Besides, it looks exactly like what you proposed ages ago and I've already critiqued, as you'd know if you'd read what I linked to.

Stewart.

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:-@ C++@ 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.
October 03, 2006
Stewart Gordon wrote:
> pragma wrote:
> <snip>
>> Well, while we're on the topic, I might as well mention this variant as well. :)
>>
>> class Foobar{
>>   void* opCast(TypeInfo type){
>>     /* perform cast and return instance/value as needed
>>   }
>> }
> <snip>
> 
> How can you return an artibrary value as a void*?  Besides, it looks exactly like what you proposed ages ago and I've already critiqued, as you'd know if you'd read what I linked to.
> 
> Stewart.
> 

Mea culpa.

Sometimes, some ideas are hard to let go. :)

-- 
- EricAnderton at yahoo
October 03, 2006
Kristian wrote:
<snip>
> The documentation indeed states "Since functions cannot be overloaded based on return value, there can be only one opCast per struct or class.", but that's not the actual reason why there is only one opCast. It may be a practical reason (which makes compiler implementation simplier),

It's only simpler because the compiler wants to treat opCast just like any other identifier.  But that is itself partly down to the fact that opCast is an identifier like any other.  As such, you can call it as obj.opCast() just like any other function.

> but it's not a physical restriction preventing multiple opCasts. The compiler could very well support the following:
> 
> class Obj {
>     int opCast();
>     float opCast();
> }
> 
> It just depends on how one makes the compiler parse source files.
> 
> So, first we should discuss if there should be more than one opCast, and should there be implicit type conversion. How should it work in ambigious cases.

My impression was that it works only on casting to the exact return type of opCast.

> Is that a reason why there is only one opCast? Or is it because implicit conversion makes code harder to read (it's less informative)?

Please see my proposal

http://tinyurl.com/p2pn4

It's very similar to your idea, but makes use of "cast", which is already a keyword, to be treated differently from ordinary function names.

Stewart.

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:-@ C++@ 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.
October 03, 2006
Stewart Gordon wrote:
> Please see my proposal
> 
> http://tinyurl.com/p2pn4
> 
> It's very similar to your idea, but makes use of "cast", which is already a keyword, to be treated differently from ordinary function names.
> 
> Stewart.
> 


I like that idea. Does anyone know what Walters long term plans are regarding the casting operator? It seems to me that a single cast operator is extremely lacking. So does anyone know if this is just temporary or does Walter not see a need for multiple casting operators?
October 03, 2006
On Tue, 03 Oct 2006 21:39:15 +0300, Stewart Gordon <smjg_1998@yahoo.com> wrote:
> Kristian wrote:
> <snip>
[snip]
>
> Please see my proposal
>
> http://tinyurl.com/p2pn4
>
> It's very similar to your idea, but makes use of "cast", which is already a keyword, to be treated differently from ordinary function names.
>
> Stewart.
>

If there will be multiple cast functions some day, I think the syntax "T cast() {...}" would be very nice. As you said, it makes a distinction from ordinary functions (and operator functions) by its name, which is a reserved word.

(Of course, assuming that D will never have an ability to overload functions by their return values... ;) )
October 03, 2006
On Mon, 02 Oct 2006 23:21:37 +0300, Jarrett Billingsley <kb3ctd2@yahoo.com> wrote:

> "Derek Parnell" <derek@nomail.afraid.org> wrote in message
> news:96d4ls69hbtj.cdpdafq3hhs3.dlg@40tude.net...
>
>> LOL... I used to think that way too until I actually tried a purpose-built
>> newsreader that adhered to standards. I'll never go back to that toy
>> newsreader again.
>
> Thing is, I tried Thunderbird, and .. I couldn't really tell a difference
> from OE.  Except that it was slower.
>
> Are there any other good free readers for Windows then?
>
>

Well, I have been using Opera and it has been working fine (in addition, I like to surf and read NGs with the same program). Though it took a while to setup the digitalmars NGs: Opera didn't connect to the NG server right away.
October 23, 2006
Jarrett Billingsley wrote:
> "Derek Parnell" <derek@nomail.afraid.org> wrote in message news:96d4ls69hbtj.cdpdafq3hhs3.dlg@40tude.net...
> 
>> LOL... I used to think that way too until I actually tried a purpose-built
>> newsreader that adhered to standards. I'll never go back to that toy
>> newsreader again.
> 
> Thing is, I tried Thunderbird, and .. I couldn't really tell a difference from OE.  Except that it was slower.

(Had this in my drafts folder for a while, keep meaning to post it!)

Whenever I've moved from OE to anything else, one of the first things
I've noticed is freedom from OE's many annoying bugs.  How many of these
bit you?

http://www.epinions.com/content_67328904836

OK, so other newsreaders have bugs too, but not many have an array of
bugs that's quite as annoying as this.

> Are there any other good free readers for Windows then? 

How different is Thunderbird from the newsreader facilities of Mozilla
Application Suite/SeaMonkey (which I use)?

Stewart.

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:-@ C++@ 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.
October 23, 2006
"Stewart Gordon" <smjg_1998@yahoo.com> wrote in message news:ehijj9$1r6d$3@digitaldaemon.com...to post it!)
>
> Whenever I've moved from OE to anything else, one of the first things I've noticed is freedom from OE's many annoying bugs.  How many of these bit you?
>
> http://www.epinions.com/content_67328904836

None, actually.  I only have one news server so I don't have trouble with it posting to the wrong server; I don't have a signature; and I don't use any of the watch/ignore/view features.  The only problem I've ever run into is the random not-quoting bug.  So from my experience, it's OK for me :)

> How different is Thunderbird from the newsreader facilities of Mozilla Application Suite/SeaMonkey (which I use)?

I've heard some people talking about SeaMonkey and how they like it.  I'll have to check it out sometime.


1 2
Next ›   Last »