[前][次][番号順一覧][スレッド一覧]

ruby-changes:64962

From: Gannon <ko1@a...>
Date: Wed, 20 Jan 2021 05:07:03 +0900 (JST)
Subject: [ruby-changes:64962] 9e0075a3d9 (master): Replace "iff" with "if and only if"

https://git.ruby-lang.org/ruby.git/commit/?id=9e0075a3d9

From 9e0075a3d902aa5236bbfdc0ad0d3028a55dc17e Mon Sep 17 00:00:00 2001
From: Gannon McGibbon <gannon.mcgibbon@g...>
Date: Wed, 6 Jan 2021 12:20:03 -0500
Subject: Replace "iff" with "if and only if"

iff means if and only if, but readers without that knowledge might
assume this to be a spelling mistake. To me, this seems like
exclusionary language that is unnecessary. Simply using "if and only if"
instead should suffice.

diff --git a/include/ruby/assert.h b/include/ruby/assert.h
index 9b70d71..b0bbdd2 100644
--- a/include/ruby/assert.h
+++ b/include/ruby/assert.h
@@ -167,7 +167,7 @@ RBIMPL_SYMBOL_EXPORT_END() https://github.com/ruby/ruby/blob/trunk/include/ruby/assert.h#L167
 #define RUBY_ASSERT_ALWAYS(expr) RUBY_ASSERT_MESG((expr), #expr)
 
 /**
- * Asserts that the given expression is truthy iff #RUBY_DEBUG is truthy.
+ * Asserts that the given expression is truthy if and only if #RUBY_DEBUG is truthy.
  *
  * @param  expr  What supposedly evaluates to true.
  */
diff --git a/include/ruby/internal/attr/const.h b/include/ruby/internal/attr/const.h
index d5b8da0..b1f27e2 100644
--- a/include/ruby/internal/attr/const.h
+++ b/include/ruby/internal/attr/const.h
@@ -36,7 +36,7 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/attr/const.h#L36
 # define RBIMPL_ATTR_CONST() /* void */
 #endif
 
-/** Enables #RBIMPL_ATTR_CONST iff. ! #RUBY_DEBUG. */
+/** Enables #RBIMPL_ATTR_CONST if and only if. ! #RUBY_DEBUG. */
 #if !RUBY_DEBUG
 # define RBIMPL_ATTR_CONST_UNLESS_DEBUG() RBIMPL_ATTR_CONST()
 #else
diff --git a/include/ruby/internal/attr/constexpr.h b/include/ruby/internal/attr/constexpr.h
index 96b010c..dabb724 100644
--- a/include/ruby/internal/attr/constexpr.h
+++ b/include/ruby/internal/attr/constexpr.h
@@ -75,7 +75,7 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/attr/constexpr.h#L75
 # define RBIMPL_ATTR_CONSTEXPR(_) /* void */
 #endif
 
-/** Enables #RBIMPL_ATTR_CONSTEXPR iff. ! #RUBY_DEBUG. */
+/** Enables #RBIMPL_ATTR_CONSTEXPR if and only if. ! #RUBY_DEBUG. */
 #if !RUBY_DEBUG
 # define RBIMPL_ATTR_CONSTEXPR_UNLESS_DEBUG(_) RBIMPL_ATTR_CONSTEXPR(_)
 #else
diff --git a/include/ruby/internal/attr/pure.h b/include/ruby/internal/attr/pure.h
index 1a10540..4416c25 100644
--- a/include/ruby/internal/attr/pure.h
+++ b/include/ruby/internal/attr/pure.h
@@ -33,7 +33,7 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/attr/pure.h#L33
 # define RBIMPL_ATTR_PURE() /* void */
 #endif
 
-/** Enables #RBIMPL_ATTR_PURE iff. ! #RUBY_DEBUG. */
+/** Enables #RBIMPL_ATTR_PURE if and only if. ! #RUBY_DEBUG. */
 #if !RUBY_DEBUG
 # define RBIMPL_ATTR_PURE_UNLESS_DEBUG() RBIMPL_ATTR_PURE()
 #else
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 9d25cc6..57f6566 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1821,7 +1821,7 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1821
   # without modifying any of the global values mentioned above.
   def pkg_config(pkg, option=nil)
     if pkgconfig = with_config("#{pkg}-config") and find_executable0(pkgconfig)
-      # iff package specific config command is given
+      # if and only if package specific config command is given
     elsif ($PKGCONFIG ||=
            (pkgconfig = with_config("pkg-config", ("pkg-config" unless CROSS_COMPILING))) &&
            find_executable0(pkgconfig) && pkgconfig) and
diff --git a/signal.c b/signal.c
index 6eea6aa..2ebd119 100644
--- a/signal.c
+++ b/signal.c
@@ -723,7 +723,7 @@ sighandler(int sig) https://github.com/ruby/ruby/blob/trunk/signal.c#L723
         rb_vm_t *vm = GET_VM();
         ATOMIC_EXCHANGE(sigchld_hit, 1);
 
-        /* avoid spurious wakeup in main thread iff nobody uses trap(:CHLD) */
+        /* avoid spurious wakeup in main thread if and only if nobody uses trap(:CHLD) */
         if (vm && ACCESS_ONCE(VALUE, vm->trap_list.cmd[sig])) {
             signal_enque(sig);
         }
diff --git a/spec/ruby/core/gc/disable_spec.rb b/spec/ruby/core/gc/disable_spec.rb
index b0221d8..f89a9d27 100644
--- a/spec/ruby/core/gc/disable_spec.rb
+++ b/spec/ruby/core/gc/disable_spec.rb
@@ -5,7 +5,7 @@ describe "GC.disable" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/gc/disable_spec.rb#L5
     GC.enable
   end
 
-  it "returns true iff the garbage collection was previously disabled" do
+  it "returns true if and only if the garbage collection was previously disabled" do
     GC.enable
     GC.disable.should == false
     GC.disable.should == true
diff --git a/spec/ruby/core/gc/enable_spec.rb b/spec/ruby/core/gc/enable_spec.rb
index eb8d572..ca44885 100644
--- a/spec/ruby/core/gc/enable_spec.rb
+++ b/spec/ruby/core/gc/enable_spec.rb
@@ -2,7 +2,7 @@ require_relative '../../spec_helper' https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/gc/enable_spec.rb#L2
 
 describe "GC.enable" do
 
-  it "returns true iff the garbage collection was already disabled" do
+  it "returns true if and only if the garbage collection was already disabled" do
     GC.enable
     GC.enable.should == false
     GC.disable
diff --git a/spec/ruby/core/hash/shared/eql.rb b/spec/ruby/core/hash/shared/eql.rb
index d8c3317..e294edd 100644
--- a/spec/ruby/core/hash/shared/eql.rb
+++ b/spec/ruby/core/hash/shared/eql.rb
@@ -118,7 +118,7 @@ describe :hash_eql_additional, shared: true do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/hash/shared/eql.rb#L118
     { 1.0 => "x" }.send(@method, { 1 => "x" }).should be_false
   end
 
-  it "returns true iff other Hash has the same number of keys and each key-value pair matches" do
+  it "returns true if and only if other Hash has the same number of keys and each key-value pair matches" do
     a = { a: 5 }
     b = {}
     a.send(@method, b).should be_false
diff --git a/spec/ruby/core/integer/allbits_spec.rb b/spec/ruby/core/integer/allbits_spec.rb
index 11acb52..edce4b1 100644
--- a/spec/ruby/core/integer/allbits_spec.rb
+++ b/spec/ruby/core/integer/allbits_spec.rb
@@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/integer/allbits_spec.rb#L1
 require_relative '../../spec_helper'
 
 describe "Integer#allbits?" do
-  it "returns true iff all the bits of the argument are set in the receiver" do
+  it "returns true if and only if all the bits of the argument are set in the receiver" do
     42.allbits?(42).should == true
     0b1010_1010.allbits?(0b1000_0010).should == true
     0b1010_1010.allbits?(0b1000_0001).should == false
diff --git a/spec/ruby/core/integer/anybits_spec.rb b/spec/ruby/core/integer/anybits_spec.rb
index 7e510fd..e044907 100644
--- a/spec/ruby/core/integer/anybits_spec.rb
+++ b/spec/ruby/core/integer/anybits_spec.rb
@@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/integer/anybits_spec.rb#L1
 require_relative '../../spec_helper'
 
 describe "Integer#anybits?" do
-  it "returns true iff all the bits of the argument are set in the receiver" do
+  it "returns true if and only if all the bits of the argument are set in the receiver" do
     42.anybits?(42).should == true
     0b1010_1010.anybits?(0b1000_0010).should == true
     0b1010_1010.anybits?(0b1000_0001).should == true
diff --git a/spec/ruby/core/integer/nobits_spec.rb b/spec/ruby/core/integer/nobits_spec.rb
index b132a4a..685759f 100644
--- a/spec/ruby/core/integer/nobits_spec.rb
+++ b/spec/ruby/core/integer/nobits_spec.rb
@@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/integer/nobits_spec.rb#L1
 require_relative '../../spec_helper'
 
 describe "Integer#nobits?" do
-  it "returns true iff all no bits of the argument are set in the receiver" do
+  it "returns true if and only if all no bits of the argument are set in the receiver" do
     42.nobits?(42).should == false
     0b1010_1010.nobits?(0b1000_0010).should == false
     0b1010_1010.nobits?(0b1000_0001).should == false
diff --git a/st.c b/st.c
index dd78705..5b178f6 100644
--- a/st.c
+++ b/st.c
@@ -768,7 +768,7 @@ rebuild_table(st_table *tab) https://github.com/ruby/ruby/blob/trunk/st.c#L768
    guarantees traversing all table bins in extreme case.
 
    According the Hull-Dobell theorem a generator
-   "Xnext = (a*Xprev + c) mod m" is a full cycle generator iff
+   "Xnext = (a*Xprev + c) mod m" is a full cycle generator if and only if
      o m and c are relatively prime
      o a-1 is divisible by all prime factors of m
      o a-1 is divisible by 4 if m is divisible by 4.
diff --git a/thread.c b/thread.c
index 22b77b7..dce181d 100644
--- a/thread.c
+++ b/thread.c
@@ -5149,7 +5149,7 @@ recursive_list_access(VALUE sym) https://github.com/ruby/ruby/blob/trunk/thread.c#L5149
 }
 
 /*
- * Returns Qtrue iff obj (or the pair <obj, paired_obj>) is already
+ * Returns Qtrue if and only if obj (or the pair <obj, paired_obj>) is already
  * in the recursion list.
  * Assumes the recursion list is valid.
  */
diff --git a/variable.c b/variable.c
index 74a7f59..52da16f 100644
--- a/variable.c
+++ b/variable.c
@@ -2481,7 +2481,7 @@ rb_autoload_load(VALUE mod, ID id) https://github.com/ruby/ruby/blob/trunk/variable.c#L2481
 
 	/*
 	 * autoload_reset will wake up any threads added to this
-	 * iff the GVL is released during autoload_require
+	 * if and only if the GVL is released during autoload_require
 	 */
 	list_head_init((struct list_head *)&state.waitq);
     }
diff --git a/vm_trace.c b/vm_trace.c
index 0687981..383f255 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -86,7 +86,7 @@ update_global_event_hook(rb_event_flag_t vm_events) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L86
         mjit_call_p = FALSE;
 #endif
 
-	/* write all ISeqs iff new events are added */
+	/* write all ISeqs if and only if new events are added */
 	rb_iseq_trace_set_all(new_iseq_events | enabled_iseq_events);
     }
 
diff --git a/vsnprintf.c b/vsnprintf.c
index 3efef20..90c827f 100644
--- a/vsnprintf.c
+++ b/vsnprintf.c
@@ -161,7 +161,7 @@ struct __sbuf { https://github.com/ruby/ruby/blob/trunk/vsnprintf.c#L161
  * _ub, _up, and _ur are used when ungetc() pushes back more characters
  * th (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]