guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Turning `scm_is_pair ()' into a macro


From: Marius Vollmer
Subject: Re: [PATCH] Turning `scm_is_pair ()' into a macro
Date: Thu, 15 Dec 2005 01:19:13 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> I believe it *really* makes sense to turn `scm_is_pair ()' into a macro.

Yep.  But what about an inline function?  There is some machinery in
inline.h for this and we already use it for scm_cell, for example.

> +#define scm_is_pair(__obj)  (SCM_I_CONSP (__obj))

SCM_I_CONSP is not a safe macro, it expands its argument twice so we
shouldn't use it just like this.  (What is the point of the double
underscores?)

(It is true that I didn't care about performance at all when
introducing scm_is_pair and your approach is the exactly right one:
profile and identify the real bottlenecks.)

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




reply via email to

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