lua-users home
lua-l archive

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


So..

Just playing with this thought experiment, what does t[f()] do? Multiret into a __slice, falling back into an __index with the first return (or nil if none) if not found?

Sounds messy on the vm. Or does it truncate to one argument and just call __index?

I'm not sold on the idea personally. I'd rather __index, __newindex were expanded to support multiple arguments if anything is to be done.

Once you do that though, It's a bit how deep does the rabbit hole go? ie can you return multiple values from __slice? Can you assign multiple values to __newslice?

ie would you want this to be able to be made to work:

t[1,3] = 3,4,5

?

I bet the very thought of that would make Mike break out in hives...

Alex