i see. in c++ world it would have been
template<int N> struct number{
enum {N};
};
typedef number<1> one;
typedef number<2> two;
typedef number<3> three;
-- which is quite useful, by the way, since you can overload methods
for 1, 2, 3, etc :)
reminds me an old joke about the ways to write a "hello world!" program
http://www.kungfo0.org/data/funny/hello.html
best,
mishka
On 7/14/05, P. J. Alling <[EMAIL PROTECTED]> wrote:
> It was Windows code, for ver. 3.1 and enums weren't always properly
> supported by Microsoft C. (I can't personally remember it started to be
> right).
>
> Mishka wrote:
>
> >sucker!
> >of course it should have been
> > enum {
> > one, two, three
> > };
> >
> >best,
> >mishka
> >
> >
> >On 7/14/05, P. J. Alling <[EMAIL PROTECTED]> wrote:
> >
> >
> >>Mindless requirements are always with us. I once worked on a project
> >>where the word was passed on from on high that there would be no "magic"
> >>numbers in the code all such number would be defined in the header file
> >>for that translation unit with a meaningful name. Well for some numbers
> >>there was no meaningful name, they were just numbers. I wish I had
> >>thought of this, but another programmer on the project produced a header
> >>file and code that included this...
> >>
> >>somefile.h
> >>
> >>#define one 1
> >>#define two 2
> >>#define three 3