[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ADD type-of
From: |
Daniel Hartwig |
Subject: |
Re: ADD type-of |
Date: |
Tue, 27 Dec 2011 15:17:36 +0800 |
On 27 December 2011 14:24, Nala Ginrut <address@hidden> wrote:
> A newbie Guiler asked me if there's something like "typeof" as "type" in
> Python or "typeof" in JS.
> I can't remember there's such a thing. But I think it'll provide
> someĀ convenientĀ for a newbie to learn Guile.
> Here's my patch.
> What you guys think?
GOOPS has `class-of'[1] and `class-name':
scheme@(guile-user)> (use-modules (oop goops))
scheme@(guile-user)> (class-of 12)
$1 = #<<class> <integer> 99bef78>
scheme@(guile-user)> (class-name $1)
$2 = <integer>
[1] http://www.gnu.org/software/guile/manual/html_node/Instances.html