lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


The problem is that there's really no actual distinguishing factor. After all, the "self" argument doesn't even have to be called self; that's just a naming convention.

One possibility: For each function, you could call the function and then immediately trap via a line-hook. Then you could use lua_getlocal on the first value to see if it's named "self". Again, this is not technically valid, since the "self" argument can be named anything, so you'd have to enforce that requirement.

Ben

----- Original Message -----
From: John Paquin <jpaquin@breakawaygames.com>
Date: Monday, December 15, 2003 12:52 pm
Subject: RE: Recognizing Methods vs. Functions

> >> But you have to know what arguments a
> >>  function takes in order to call it anyway
> yeah, but...
> I'm trying to look at the functions in a table and "sort" them into two
> groups.  One that takes the self argument, and one that doesn't (assume that
> I have a valid reason for doing this).  I need to make the distinction, and
> I'd like to be able to do it automatically instead of using some hack naming
> convention to tell the difference.
> Thanks
> 
>