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.
This commit is contained in:
Gannon McGibbon 2021-01-06 12:20:03 -05:00 коммит произвёл Aaron Patterson
Родитель a8dc5156e1
Коммит 9e0075a3d9
17 изменённых файлов: 18 добавлений и 18 удалений

Просмотреть файл

@ -167,7 +167,7 @@ RBIMPL_SYMBOL_EXPORT_END()
#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.
*/

Просмотреть файл

@ -36,7 +36,7 @@
# 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

Просмотреть файл

@ -75,7 +75,7 @@
# 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

Просмотреть файл

@ -33,7 +33,7 @@
# 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

Просмотреть файл

@ -1821,7 +1821,7 @@ SRC
# 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

Просмотреть файл

@ -723,7 +723,7 @@ sighandler(int sig)
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);
}

Просмотреть файл

@ -5,7 +5,7 @@ describe "GC.disable" do
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

Просмотреть файл

@ -2,7 +2,7 @@ require_relative '../../spec_helper'
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

Просмотреть файл

@ -118,7 +118,7 @@ describe :hash_eql_additional, shared: true do
{ 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

Просмотреть файл

@ -1,7 +1,7 @@
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

Просмотреть файл

@ -1,7 +1,7 @@
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

Просмотреть файл

@ -1,7 +1,7 @@
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

2
st.c
Просмотреть файл

@ -768,7 +768,7 @@ rebuild_table(st_table *tab)
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.

Просмотреть файл

@ -5149,7 +5149,7 @@ recursive_list_access(VALUE sym)
}
/*
* 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.
*/

Просмотреть файл

@ -2481,7 +2481,7 @@ rb_autoload_load(VALUE mod, ID id)
/*
* 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);
}

Просмотреть файл

@ -86,7 +86,7 @@ update_global_event_hook(rb_event_flag_t vm_events)
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);
}

Просмотреть файл

@ -161,7 +161,7 @@ struct __sbuf {
* _ub, _up, and _ur are used when ungetc() pushes back more characters
* than fit in the current _bf, or when ungetc() pushes back a character
* that does not match the previous one in _bf. When this happens,
* _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
* _ub._base becomes non-nil (i.e., a stream has ungetc() data if and only if
* _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
*
* NB: see WARNING above before changing the layout of this structure!
@ -196,7 +196,7 @@ typedef struct __sFILE {
#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
#define __SOPT 0x0400 /* do fseek() optimisation */
#define __SNPT 0x0800 /* do not do fseek() optimisation */
#define __SOFF 0x1000 /* set iff _offset is in fact correct */
#define __SOFF 0x1000 /* set if and only if _offset is in fact correct */
#define __SMOD 0x2000 /* true => fgetln modified _p text */