[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Did they mean "." or ":"?
- From: Geoff Leyland <geoff_leyland@...>
- Date: Wed, 17 Feb 2010 13:11:28 +1300
On 17/02/2010, at 1:05 PM, Christopher Eykamp wrote:
> I'm working on a C++ game that uses Lua scripts to control robot players. I'm noticing a common error that the scripters are making, and am looking for a way to detect it and print a helpful error message.
>
> When the scripters should be writing:
>
> bot:setAngle(angle)
>
> they often write:
>
> bot.setAngle(angle)
>
> ...
>
> Is there a way from C++ to figure out if a function was called using "." as opposed to ":"?
Is checking the type of the first argument and then writing "Not enough arguments, you probably used '.' instead of ':'" if it's not a bot good enough?
Cheers,
Geoff