guile-devel
[Top][All Lists]
Advanced

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

Re: Smart variables, dumb variables


From: Marius Vollmer
Subject: Re: Smart variables, dumb variables
Date: 15 Aug 2002 22:02:09 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

address@hidden writes:

> > Should it print #<primitive-generic +> from the start?
> 
> Since it actually _is_ a generic from the start, yes, i think it should.

Ok, agreed.  Objections?

> Of course, what i'm really after is a test like 'generic? foo' so that
> i can write a macro that does what i think guile should do. Make 'foo'
> a generic iff it's not one allready.

You can't really do that I think.  You can't change a procedure into a
generic function.  What you can do is change the value of a variable
to point to a new function, which is generic.  But maybe that is what
you want.

There is no 'generic?' but you can maybe define it like so

  (define (generic? obj)
    (or (is-a? obj <generic>)
        (is-a? obj <primitive-generic>)))

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405




reply via email to

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