Re: another small wish

  • From: Cosmin Apreutesei <cosmin.apreutesei@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Tue, 29 May 2012 01:33:43 +0300

On Mon, May 28, 2012 at 9:59 PM, Mike Pall <mike-1205@xxxxxxxxxx> wrote:
> Cosmin Apreutesei wrote:
>> Would it be feasible to make ctype objects be unique to the C type
>> they represent and also make them comparable instead of raising
>> "attempt to compare 'enum 21' with 'enum 21'" ? This would allow
>> ctypes to be useful as table keys and also find out if two cdata are
>> of the same type.
>
> Err, the comparison for equality doesn't throw an error anymore?
> Ok, so it always returns false. Not optimal, but ctype objects
> aren't meant for anything other than constructors and abstract
> type identifiers.
>
> I'm not going to make them unique, because interning is costly and
> usually wasted.

Ok. The error "attempt to compare 'enum 21' with 'enum 21'" suggested
me that they were already internalized so I thought it was more of a
bug really that the comparison didn't succeed.

>
> [
> Anyway, the questions you're asking sound like you're going for
> some awfully complicated abstractions, which is rarely a good
> idea. If this is still your WIN32 bindings, then I'd be very
> surprised if all of that is truly necessary or even helpful. :-)

Funny how people react on the second wish-like feedback they get from
the same user in a short period of time - now you're a noob and must
be doing something wrong :) My code is online so you can verify your
intuition about my complicated abstractions :)

My postings are to provide user feedback. I already feel very
comfortable with the API as it, we're talking edges here. Also, I
can't answer to the feasibility of implementing these things so I
don't know which are a complete waste of your time and attention.

So, what do you suggest I do with my wishes? Tell'em or shove'em?

Other related posts: