[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Account Lua Live Demo snippet fails
- From: "Alexander Gladysh" <agladysh@...>
- Date: Fri, 28 Nov 2008 21:16:02 +0300
Hi, list!
http://www.lua.org/cgi-bin/demo?account
This demo fails when run:
Output
after creation demo 0
after deposit demo 1000
after withdraw demo 900
input:18: insufficient funds on account DEMO
Your program failed to run.
I do realize that the failure is intentional, but in my opinion it may
be misleading to the newcomers. ("What, they can't even get they own
demo to work?")
I believe that pcall should be added to avoid that scary red fail message.
If failure is there for the right purpose, then at least add a warning
message that this demo is expected to fail. Something like this:
<...>
b = Account:new(nil,"DEMO")
print("About to withdraw too large sum and fail")
b:withdraw(100.00)
HTH,
Alexander.