Re: there is a subtle problem doing: mySlot := obj getSlot(slotname)
Kevin Edwards <[email protected]> Tue, 08 Nov 2011 11:39:26 -0600
| Newsgroups | gmane.comp.lang.io |
|---|---|
| Message-ID | <[email protected]> |
On 11/8/2011 8:11 AM, Jeremy Tregunna wrote: > On 2011-11-08, at 7:41 AM, Mildred Ki'Lya wrote: >> >> If this isn't mentioned somewhere, it should be. That said, >> perhaps it's time we figured out a long term solution to this >> problem which doesn't affect performance quite as much as my >> Slot object idea did (impacted the runtime by approximately >> 35% of additional overhead). >> >> >> That's not an easy solution ... For a long time (before I knew >> about Self and Io), i tried to design a language that had methods >> as first-class objects. I never really succeeded. > > Believe me, I know. Before I had the Slot idea, it was Jan-Paul > Bultmann being super annoyed with this problem that it finally > became more than a minor annoyance for me (and I've written a > plethora of Io code since 2003, perhaps I just got used to it). > Which is why the Slot object/meta idea came about. We talked for > about 2 days figuring out solutions, and this is the one that we > agreed was workable. Hey, I remember this discussion!... or maybe one like it a long while ago. It's neat that you actually implemented it! Did Slot localize get, set, del, etc., too? This could entail big changes. I'm curious how you implemented it. Did you put an indirection bit in PHashRecord? You could probably twiddle some low bits of 'v' if you didn't want to waste space in exchange for a little extra time on each lookup. Ah, from more recent messages, it looks like you implemented it in Ruby which might explain the inefficiency. Maybe the JIT you're working on can optimize it at some point. Kevin