Chaos Project

Featured Projects => Tasks => Advanced RPG Creator => Finished Tasks => Topic started by: Blizzard on March 27, 2011, 05:46:21 am

Title: [Finished] [RGSS] Method Argument Type Checking
Post by: Blizzard on March 27, 2011, 05:46:21 am
Method Argument Type Checking




Description

All our methods so far should be changed so they have type safe arguments. Some of them already work. Whenever we use NUM2INT or INT2NUM, that is already assured, but the problem happens when we use our own classes.



Priority

Medium.



Prerequisites

None.



Assigned

Nobody



Everything else

After this task has been completed, all newly implemented methods afterwards need to have this type of type check as well.
Title: Re: Method Argument Type Checking
Post by: Ryex on April 08, 2011, 04:54:47 am
we can use
rb_obj_is_instance_of(VALUE obj, VALUE klass)

can't we? we just have to use the rb_cKlass objects
Title: Re: Method Argument Type Checking
Post by: Blizzard on April 08, 2011, 05:12:39 am
Oh, that actually works? Awesome! xD
I will put a macro together to make things easier for argument type check and automatic argument error raising.