more unlimited metamethods

  • From: imzyxwvu@xxxxxxxxx
  • To: "luajit@xxxxxxxxxxxxx" <luajit@xxxxxxxxxxxxx>
  • Date: Thu, 27 Nov 2014 16:17:09 +0800

all return values of __eq, __lt, __le will be converted into booleans, and 
there is not __gt, __ge. this caused limits when metaprogramming. for instance, 
i am writing a database model system using following code to define conditions:

dbtable:select{
  dbtable.column:eq("example")
}

eq is a method that return a table representing this relationship.

if there wasn't this limit, i could write like:

dbtable:select{
  dbtable.column == "example"
}

which is much more clear.

i really want this feature, and hope this become implemented in 2.1 version of 
luajit if possible and luajit developers would like.

Regards.

Other related posts: