Re: Getting a type of a variable

2008-07-20 Thread Ludovic Courtès
Hello, "Maciek Godek" <[EMAIL PROTECTED]> writes: > The solution of my dreams is that it would turn out > that there's a function defined in the scm api: > scm_t_bits scm_get_type(SCM *var) > that returns a type tag and that there's a way to decipher > the contents of this return value, and that

Re: Getting a type of a variable

2008-07-19 Thread Andy Wingo
On Fri 18 Jul 2008 23:48, "Maciek Godek" <[EMAIL PROTECTED]> writes: > Hello, > I'm looking for an efficient way to check the > type of an SCM variable. I imagine that I > could write something like: > (define (type? x) > (cond ((integer? x) 'int) > (cond ((real? x) 'double) > ... > ) (oop go

Getting a type of a variable

2008-07-18 Thread Maciek Godek
Hello, I'm looking for an efficient way to check the type of an SCM variable. I imagine that I could write something like: (define (type? x) (cond ((integer? x) 'int) (cond ((real? x) 'double) ... ) and then convert guile symbol to C string, but that would be terribly inefficient. (I could als