This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: printing types ?


Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:

> On Tue, 7 Mar 2000, Han-Wen Nienhuys wrote:
> 
> > is there a generic way to print types from within GUILE? eg.
> > 
> >    1 => integer
> > 
> >    #t => boolean
> > 
> > etc.?
> 
> I don't think so.

I do think so.  but you need GOOPS.  oh, and it won't distinguish
pairs and lists, of course.

guile> (use-modules (oop goops))
guile> (class-of 1)
#<<class> <integer> 91d60>
guile> (class-of '(1 . 2))
#<<class> <pair> cb948>
guile> (class-of '(1 2))
#<<class> <pair> cb948>

it would probably be a good idea to implement some analog of CL's
`deftype', `typep' and `typecase', too.

> Best regards
> Dirk Herrmann

--mike

-- 
Roses are red,
  Violets are blue,
I'm schizophrenic...
  And I am too.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]