Code fails with linker error. Why?
ketmar via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Oct 6 08:58:36 PDT 2014
On Mon, 06 Oct 2014 15:44:34 +0000
John Colvin via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com>
wrote:
> >> I disagree. It's simple and easy to understand.
> > and hackish.
> D is very amenable to slightly hackish code.
D allows to write hackish code, and it's good. but if we can provide a
way to write less hackish code, it's good and preferable, i think. ;-)
> > no hacks needed.
> I meant that without a language change, one does need hacks.
i see.
> That would be nice, although personally I'd prefer
>
> int A.bar() { return this.hiddenField; }
>
> as it's less verbose and would be familiar to c++ programmers.
i was trying to not change grammar, that's why i invented that
horribly-looking @implementation attribute. this way the code is still
marked as a hack, but "officially endorsed" hack. besides, attribute
allows to use code blocks:
@implementation(A) {
int foo () { ... }
void bar () { ... }
}
or even:
@implementation(A):
int foo () { ... }
void bar () { ... }
sure, it has it's own pack of problems:
@implementation(A) {
@implementation(B) {
// I'M LOST!
}
}
but we can have both! ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141006/99c1ff2a/attachment.sig>
More information about the Digitalmars-d-learn
mailing list