[Top][All Lists]

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

Re: [Chicken-users] Peculiar TinyCLOS specialization bit

From: Joel Reymont
Subject: Re: [Chicken-users] Peculiar TinyCLOS specialization bit
Date: Fri, 31 Dec 2004 00:05:40 +0000

> Andreas Rottmann wrote:

>The only method on the generic function foo is specialized on (<b>
><a>), while you pass (<b> <boolean>), so there are no applicable
>methods. Some error is the expected behaviour. If you want it to pass,
>(define-method (foo (self <b>) (a <top>)) #f)
>(define-method (foo (self <b>) (a <boolean>)) #f)

My goal is to be able to pass an object or an absence of one. 

Above basically means that I have to either specialize a method twice,
once for object and once for #f or not specialize it at all (top) and
check the passed value in my method. Right?

I was expecting it to sort of work like when passing pointers in C++ :-).

Too bad there's no way to create an "Empty object of no value" and pass
that instead of specializing the method for both class and boolean or
writing extra argument checks.

    Thanks, Joel

OpenPoker: The Linux of poker software
* Tenerife * Canary Islands * Spain

reply via email to

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