54 karma · joined February 27, 2013
I wrote some stuff here: http://howtowriteaprogram.blogspot.com/
I'm trying to complete this: http://logfilerobot.com/
And the MEMORY keyword "must be an ordinary keyword as well." So you'd need a (XYZZY ...) rule.
Also, the START symbol appears in the DOCTOR script, but is never mentioned in the body of the paper.
Another thing Weizenbaum doesn't mention in his description is the final empty list in the DOCTOR script. This does seem to be expected by the code.
Usually, I write a short reply on some thread and although my post shows me "1 point by anthay" my karma doesn't change. I'm sure it used to.
int g()
{
int x, y;
struct local {
int & a_;
int & b_;
local(int & a, int & b) : a_(a), b_(b) {}
int operator()()
{
return a_ + b_;
}
} nested(x, y);
x = 99; y = 1;
return nested();
}
assert(g() == 100); int f()
{
struct local {
static int nested_func()
{
return 123;
}
};
return local::nested_func();
}"Good judgement is the result of experience and experience is the result of bad judgement." - Mark Twain
and
"To write a good program takes intelligence, taste, and patience. You are not going to get it right the first time; experiment!" - Bjarne Stroustrup
In your code \n must be a line separator rather than a line terminator. (Otherwise, if the last line is \n terminated, the function returns 0.)