digitalmars.D - other keywords[as,throw]
- cortigenb6 yahoo.com (6/6) Jul 20 2005 D is great but i ask if you can add these key words [as,throws]
- Mike Capp (8/12) Jul 20 2005 If Delphi's "as" is like C#'s, returning null for a bad cast, that's how...
- cortigenb6 yahoo.com (9/9) Jul 23 2005 thanks Mike
- Stefan (20/29) Jul 23 2005 They are not "deficient", they are missing - so what?.
- Hasan Aljudy (4/22) Jul 24 2005 I remember someone was writing a tool to convert java code to d.
D is great but i ask if you can add these key words [as,throws] [as] as in delphi make a checked typecast [objref as classref] and [throws] as in java with which we can raise an exception very easily in java methods thanks in advance kortex
Jul 20 2005
In article <dbmlp5$126u$1 digitaldaemon.com>, cortigenb6 yahoo.com says...D is great but i ask if you can add these key words [as,throws] [as] as in delphi make a checked typecast [objref as classref]work already.and [throws] as in java with which we can raise an exception very easily in java methods"throw" is already a D keyword and raises an exception. "throws" is something quite different - it's in Java to support exception specifications, which are now generally acknowledged to have been a bad idea. cheers Mike
Jul 20 2005
thanks Mike but why i want these keywords?!!! because i am a javanese man and i really want to tranform a lot of java codes to d and im thinking for something like awt,swing for java so deficient keywords like [throws ,instanceof,boolean] make my dream a nightmare i know with [D] we can do every thing as we like but as a lazy javanese programmer i need these keywords to make my life easy and make me smile again
Jul 23 2005
In article <dbum4n$19l5$1 digitaldaemon.com>, cortigenb6 yahoo.com says...thanks Mike but why i want these keywords?!!! because i am a javanese man and i really want to tranform a lot of java codes to d and im thinking for something like awt,swing for javaAWT, Swing?? And that's your only problem? Man, good luck ...so deficient keywords like [throws ,instanceof,boolean]They are not "deficient", they are missing - so what?. - boolean is bool (or bit), - "if (o instanceof x)" is "if (cast(x) o)" - throw is throw - throws: just drop it from the method signature, D has no checked exceptions. (For what it's worth I'm also 'javanese' and I principally like the concept of checked exceptions, but the Java API has just gone overboard with these in too many spots - 'javax.transaction.UserTransaction' any one?) At least, I don't see how that will hinder you from from converting Java sources to D. - "as" has never been a Java 'keyword' (or something else recognized by javac).make my dream a nightmare i know with [D] we can do every thing as we like but as a lazy javanese programmer i need these keywords to make my life easy and make me smile againWell, you're perhaps just too lazy ;-). Your "missing keywords" will very likely be the least problem when you're going to convert Java sources to D - most of them could be handled by simple string replacement or a slightly more advanced regexp algorithm. So I'd say: Wake up, D is not Java! You'll have to do some work on your own. Best regards, Stefan
Jul 23 2005
Stefan wrote:In article <dbum4n$19l5$1 digitaldaemon.com>, cortigenb6 yahoo.com says...I remember someone was writing a tool to convert java code to d. I also remember that inner classes were speically added to d to ease that task.make my dream a nightmare i know with [D] we can do every thing as we like but as a lazy javanese programmer i need these keywords to make my life easy and make me smile againWell, you're perhaps just too lazy ;-). Your "missing keywords" will very likely be the least problem when you're going to convert Java sources to D - most of them could be handled by simple string replacement or a slightly more advanced regexp algorithm. So I'd say: Wake up, D is not Java! You'll have to do some work on your own. Best regards, Stefan
Jul 24 2005