[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] current status of tinyclos?
From: |
Zbigniew |
Subject: |
Re: [Chicken-users] current status of tinyclos? |
Date: |
Wed, 17 Aug 2005 13:00:49 -0500 |
Also I've found if you override a built-in function such as + or
length, previous behaviour will be wiped out. So after:
(define-method (+ (<string> x) (<string> y)) (string-append x y))
you lose the ability to do (+ 2 3) unless you define the appropriate
method on integers, and then + will only take 2 arguments so (+ 2) is
no longer valid (variadic functions not permitted). Now, it seems
that in GOOPS, when you override a procedure it's used as the "default
procedure" so old behaviour is preserved. (I think primitives even
have a special optimized hook for this.)
I mention this just in case you're overriding built-ins. In fact it
doesn't seem too hard to implement a "default procedure" for certain
classes, but would likely result in a big performance hit for, e.g.
adding integers, unless you explicitly use fx+ or save the original +
as ##core#+ and use that. I have decided it is safest at the moment
to define a new generic function such as "add" for + and "len" for
length, despite the lack of symmetry between built-in and user-created
types.
On 8/12/05, Rick Taube <address@hidden> wrote:
> Hello, I have a farily large music composition system
> (http://commonmusic.sf.net/) that runs in most CL's and in Gauche,
> Guile and STKlos scheme. I am interested in getting it running in
> Chicken too. After looking over the docs, it seems to me that the only
> thing that (might) be a problem is Chicken's tinyclos relative to the
> other 3 Scheme's oop systems. Am I correct in inferring that Chicken's
> tinyclos has no slot description interface?