Home
Feedback
FAQ
Getting Started
Discussions
Site operation discussions
Recent Posts
(new topic)
Departments
Courses
Research Papers
Design Docs
Quotations
Genealogical Diagrams
Archives
This is an absolutely blinding hack. See if you can guess how it's done before looking at the recipe...
Andrei Alexandrescu described something very similar in C++ a while ago in a post to comp.lang.c++.moderated.
Whenever I see this sort of thing I have a hard time believing some of the same people argue against real macro sytems...
I've been trying to avoid getting into more political wars, but this is exactly the problem that I see with those who argue against formalism: ultimately they want the ability to do what I call "programming by stunt." It's really just a sub-strain of cargo-cult programming. They want the bennies of macros or operator overloading without having to understand how such features interact with other language features or, worse, with such features interacting with other language features in an incoherent way.
I'm not following how "programming by stunt" -- i.e. writing trickily clever programs -- is like "cargo-cult programming" -- i.e. doing things in a particular way without understanding why. In fact, they seem completely unreleated, since the former, when it depends on abusing language features, often demands a deep understanding of the language's quirks.
Sunny optimist that I am, I prefer to think of it as a kind of poetry, and doing macro-like things with a built-in macro system is, as someone once said of writing poetry without meter, like playing tennis with the net down. And just like poetry, people are writing these things for amusement, not for hard-headed engineering or lofty intellectual reasons.
And just like poetry, people are writing these things for amusement, not for hard-headed engineering or lofty intellectual reasons.
People do sometimes write poetry for lofty intellectual reasons, too...
I used to do such tricks in C++ back then :)
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 19 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago