M
Martin Gregorie
I'm with you here. I like overloading. Used in moderation it can clarify
what you're doing by making it concise. I remember that the Algol 68 R
graphics package defined a sketch (a drawable but unscaled object),
picture (scaled, ready to output) and overloaded +, so you could write:
sketch disk = circle(0, 0, 30);
sketch frame = rectangle(0, 0, 60, 30);
sketch caption = text(0, -20 "A label);
picture mydrawing = circle + frame + caption;
Works for me, anyway.
brackets, so he always defined:
#define begin {
#define end }
Just so he could write:
int main(int argc, char **argv)
begin
printf("Hello World");
end
what you're doing by making it concise. I remember that the Algol 68 R
graphics package defined a sketch (a drawable but unscaled object),
picture (scaled, ready to output) and overloaded +, so you could write:
sketch disk = circle(0, 0, 30);
sketch frame = rectangle(0, 0, 60, 30);
sketch caption = text(0, -20 "A label);
picture mydrawing = circle + frame + caption;
Works for me, anyway.
Agreed. Some people can make a mess. I knew a programmer who hated curlyAs a comparison: as much as I love the preprocessor in C (it was such a
cool idea in 1980), it's a huge mistake. It suffers from the same sorts
of abuses (sometimes worse) as operator overloading.
brackets, so he always defined:
#define begin {
#define end }
Just so he could write:
int main(int argc, char **argv)
begin
printf("Hello World");
end