[Top][All Lists]

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

Re: [Chicken-users] tinyclos on windows

From: Matt Welland
Subject: Re: [Chicken-users] tinyclos on windows
Date: Mon, 27 Dec 2010 17:12:03 -0700

I'm getting a bit further but I am seeing tinyclos issues with the following seemingly straightforward code. This snippet works with 3.4 on cygwin. Am I doing something wrong or is this a 4.60 bug? FYI, I'll try on 4.63 later today.

BTW if tinyclos can be kept limping along then for future dev I'm happy to use coops. No need for a translation layer then.

This fails with "Unbound variable foo" (4.60 on Mingw)

(use tinyclos)
(define-class <bar> ()

(define-method (initialize (bar <bar>) initargs)
  (slot-set! bar 'yep #t)
  (initialize-slots bar initargs))

(define-method (foo (bar <bar>))
  (if (slot-ref bar 'yep)
      (print "We're ok")
        (slot-set! bar 'yep (not (slot-ref bar 'yep)))
        (foo bar))))


Editorial: These kind of problems illustrate why I strongly avoid using macros, records, modules or objects anymore :) ya just can't trust they will be there and work in the future and you know they won't easily transfer to another implementation ...


On Mon, Dec 27, 2010 at 2:45 AM, Felix <address@hidden> wrote:
From: Matt Welland <address@hidden>
Subject: Re: [Chicken-users] tinyclos on windows
Date: Sun, 26 Dec 2010 22:49:45 -0700

> I'm not making any headway on tinyclos. On 4.6.3 the "(use tinyclos)" works
> but there are still more problems, perhaps due to trying too many things
> without a fresh start. However, is tinyclos supported or not? Perhaps the
> time is better spent on getting coops to work.

I have tagged a new version of tinyclos - the error was caused by
a buggy implementation of `randomize' (used internally for method
caching). Please give it a try. I tested it with 4.6.0 and the tinyclos
test-suite appears to run ok.

> Regarding coops. Has anyone put together a "translation" layer that allows
> tinyclos code to work with coops without rewriting? Is it even possible?
> I've got over 90k lines of code sprinkled with tinyclos here and there and
> it will be tedious to translate by hand. If no such translation layer exists
> I can try some perl in place ....

Superficially, coops is quite similar to tinyclos, with the exception of
the initialization protocol. I can look into this some more, but can't
promise anything - object-initialization works differently in coops,
and is much simpler.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]