[e-lang] E-Native Methods and arguments

rick at vecx.net rick at vecx.net
Wed Aug 30 19:57:45 CDT 2006


I have a question relating to the MethodN classes in e-native. Is it important that we tie the class/functions definition 
to the argument count? The simple question being how many arguments are enough?

The different methods all lose their exact type when they are packed into the array of *Methods in VTable. Also, since the 
functions are already wrapped in classes we would have cleaner code with the same net effect if we just implemented a single 
method class with either A, an internal list of arguments, or B a single method function with a set of default arguments. 

The downside to A is obviously the added overhead of a list, which isn't much. 
The downside of B is that we now have to take pointers to Ref's rather than the copy constructed Ref due to needing to check for 
the default value which would likely be NULL.
There are other options, functors with member arguments, as well as variad functions (...) (the downside to those is that they 
are not typesafe, but quite convenient in our case.)

These questions lead me to another question, does anyone care about these implementation choices? I figure if I am going through 
the hassle of making a native implementation of e-lib that I try to stay as close to the will of its designers and users as 
possible.  If no one cares then I will implement it how I wish and address changes later. 

Thanks,
Rick



More information about the e-lang mailing list