[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Non-cons data structures
From: |
felix winkelmann |
Subject: |
Re: [Chicken-users] Non-cons data structures |
Date: |
Fri, 11 Mar 2005 07:44:35 +0100 |
On Thu, 10 Mar 2005 23:35:09 +0000, Julian Morrison
<address@hidden> wrote:
> Sunnan wrote:
>
> > * Using an object system (overkill; but could be useful if I want to
> > inherit from my structure (which I probably don't.))
>
> Vectors allow manual inheritance (more or less the way a compiling
> object system does it): if a superclass defines an N-slot vector,
> subclass slots start at N+1. A cast to super just changes the first slot
> (type identifier) - superclass methods already ignore all slots beyond N.
>
> > Between vectors and records, which will have the least performance
> > penalty?
>
> Guessing: they compile to identical operations - block-set! etc in lolevel.
>
Yes, with the right compiler options, efficiency should be roughly the
same.
You might also try out the new srfi-57 egg:
http://www.call-with-current-continuation.org/eggs/srfi-57.html
Also, the meroon object system is quite eficient, about twice the
speed as tinyclos
(http://www.call-with-current-conitnuation.org/eggs/meroon.html),
but note that it doesn't work too well with the psyntax module system.
cheers,
felix