You're viewing a comment by Jan Seidl and its responses.
You're viewing a comment by Jan Seidl and its responses.
I am being sponsored by Syntress since 2007! They bought me an amazing dedicated server to run catonmat on. If you're looking web services in Chicago area, I highly recommend the Syntress guys!
I love to read science books. They make my day and I get ideas for awesome blog posts, such as Busy Beaver, On Functors, Recursive Regular Expressions and many others.
Take a look at my
Amazon wish list, if you're curious about what I have planned reading next, and want to surprise me. :)


Very nice article! It's sad that other popular languages doesn't implement operator()-like
Keep up good work Pete!
Comment Responses
why? I think it's good thing, using () only produces mess in code. When I see bomb.explode() I now I should expect the object bomb to explode. But bomb() doesn't say me anything. Worst thing, the requirements for () changes, old comment stays and i can find something like:
// this operator explodes the bomb
operator()() { /* explode() */ save_the_world(); }
Python does - you just need to implement the __call__ method:
All functions in Javascript are implicitly C++-functors, but defined in a reverse order.
Each run will increment the value and print the new version, but you can also alter that property however and whenever you like, so in Javascript you tend to use real closures for holding state, instead:
or you can define objects to instantiate if you need more than one:
Scala also has "()":
Reply To This Comment