deprecate SCM_ASRTGO
authorAndy Wingo <wingo@pobox.com>
Sun, 8 Jan 2012 13:27:03 +0000 (14:27 +0100)
committerAndy Wingo <wingo@pobox.com>
Sun, 8 Jan 2012 13:27:03 +0000 (14:27 +0100)
* libguile/deprecated.h: Mark scm_immutable_cell and
  scm_immutable_double_cell as being SCM_DEPRECATED, not SCM_API.
  Deprecate SCM_ASRTGO.

* libguile/deprecated.c (scm_i_deprecated_asrtgo): New support
  procedure.

* doc/ref/api-control.texi (Handling Errors): Remove ASRTGO docs.

doc/ref/api-control.texi
libguile/deprecated.c
libguile/deprecated.h

index 957b9a7..c1502b0 100644 (file)
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
-@c Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2011
+@c Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2011, 2012
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -1712,14 +1712,6 @@ leave it unspecified which argument's type is incorrect.  Again,
 @code{SCM_ARGn} should be preferred over a raw zero constant.
 @end deftypefn
 
-The @code{SCM_ASRTGO} macro provides another strategy for handling 
-incorrect types.
-
-@deftypefn Macro void SCM_ASRTGO (int @var{test}, label)
-If @var{test} is zero, use @code{goto} to jump to the given @var{label}.
-@var{label} must appear within the current function.
-@end deftypefn
-
 @node Continuation Barriers
 @subsection Continuation Barriers
 
index 4ba305e..530d2d4 100644 (file)
@@ -2624,6 +2624,18 @@ scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
   return scm_double_cell (car, cbr, ccr, cdr);
 }
 
+\f
+
+
+scm_t_bits
+scm_i_deprecated_asrtgo (scm_t_bits condition)
+{
+  scm_c_issue_deprecation_warning
+    ("SCM_ASRTGO is deprecated.  Use `if (!condition) goto label;' directly.");
+
+  return condition;
+}
+
 
 \f
 
index 82415ea..ed81344 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef SCM_DEPRECATED_H
 #define SCM_DEPRECATED_H
 
-/* Copyright (C) 2003,2004, 2005, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2003,2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 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
@@ -796,12 +796,20 @@ SCM_DEPRECATED SCM scm_struct_create_handle (SCM obj);
 
 /* Deprecated 26-05-2011, as the GC_STUBBORN API doesn't do anything any
    more.  */
-SCM_API SCM scm_immutable_cell (scm_t_bits car, scm_t_bits cdr);
-SCM_API SCM scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
+SCM_DEPRECATED SCM scm_immutable_cell (scm_t_bits car, scm_t_bits cdr);
+SCM_DEPRECATED SCM scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
                                       scm_t_bits ccr, scm_t_bits cdr);
 
 \f
 
+SCM_DEPRECATED SCM scm_i_deprecated_asrtgo (scm_t_bits condition);
+
+/* Deprecated 08-01-2012, as it's undocumented and unused.  */
+#define SCM_ASRTGO(_cond, _label)              \
+  do { if (!scm_i_deprecated_asrtgo(_cond)) goto _label; } while (0)
+
+\f
+
 void scm_i_init_deprecated (void);
 
 #endif