[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Re: imlib2 and define/clone
From: |
Peter Bex |
Subject: |
[Chicken-users] Re: imlib2 and define/clone |
Date: |
Wed, 21 Feb 2007 20:28:54 +0100 |
User-agent: |
Mutt/1.4.2.2i |
On Tue, Feb 20, 2007 at 07:26:08PM -0500, Graham Fawcett wrote:
> Hi Peter,
>
> The (define/clone) syntax in imlib2 isn't quite right: it never
> returns a copy of the cloned object. (So, for example, (imlib:blur
> my-image) returns an undefined value, instead of a blurred clone of
> my-image.
>
> Maybe your destructive versions used to return a copy of the image?
> I don't use syntax-rules much, but I think this is right:
>
> (define-syntax define/clone
> (syntax-rules ()
> ((define/clone ?name ?name!)
> (define (?name img . args)
> (let ((clone (imlib:clone img)))
> (apply ?name! clone args)
> clone)))))
That would be alright. Thanks Graham, I've checked this into svn.
Expect a new version up on the eggs page in a while.
Regards,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth
pgpq18AqDTYw8.pgp
Description: PGP signature