diff --git a/libguile/weaks.h b/libguile/weaks.h index 908e27628..23b707248 100644 --- a/libguile/weaks.h +++ b/libguile/weaks.h @@ -3,7 +3,7 @@ #ifndef SCM_WEAKS_H #define SCM_WEAKS_H -/* Copyright (C) 1995,1996,2000,2001, 2003, 2006, 2008 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,2000,2001, 2003, 2006, 2008, 2009 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -71,10 +71,12 @@ SCM_API SCM scm_doubly_weak_pair (SCM car, SCM cdr); ((SCM_WEAK_PAIR_CAR_DELETED_P (_cell)) \ || (SCM_WEAK_PAIR_CDR_DELETED_P (_cell))) -/* Accessing the components of a weak cell. */ +/* Accessing the components of a weak cell. These return `SCM_UNDEFINED' if + the car/cdr has been collected. */ #define SCM_WEAK_PAIR_WORD(_cell, _word) \ - ((SCM_WEAK_PAIR_WORD_DELETED_P ((_cell), (_word))) \ - ? SCM_BOOL_F : SCM_CAR (pair)) + (SCM_WEAK_PAIR_WORD_DELETED_P ((_cell), (_word)) \ + ? SCM_UNDEFINED \ + : SCM_CELL_OBJECT ((_cell), (_word))) #define SCM_WEAK_PAIR_CAR(_cell) (SCM_WEAK_PAIR_WORD ((_cell), 0)) #define SCM_WEAK_PAIR_CDR(_cell) (SCM_WEAK_PAIR_WORD ((_cell), 1))