[Top][All Lists]

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

Re: Getting a type of a variable

From: Ludovic Courtès
Subject: Re: Getting a type of a variable
Date: Sun, 20 Jul 2008 22:48:42 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)


"Maciek Godek" <address@hidden> 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 it is wisely
> defined for all builtin types.

If you are to dive into such low-level things, you could implement in
Scheme type tag "deciphering".  You'd use the `object-address'
procedure, and then re-implement type tag encoding/decoding from
"libguile/tags.h" at the Scheme level.  That'd be an interesting
exercise as the Scheme implementation would be readily understandable
(compared to obscure C macros and informal comments).

Otherwise, Andy's suggestion may be wiser.  ;-)


reply via email to

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