Create "Boolean"
superclass of
TrueClass /
FalseClass
Slide 39
Slide 39 text
ɹɹɹɹɹɹɹ٫Լ
Status: Rejected
Slide 40
Slide 40 text
Rejected for several reasons:
many gems and libraries had already introduced
Boolean class. I don't want to break them.
true and false are the only representative of
true-false values. In Ruby. nil and false are falsy
values, and everything else is a true value.
There's no meaning for having a superclass of
TrueClass and FalseClass as Boolean.
Matz.
ʢԼઢҾ༻ऀʣ
Slide 41
Slide 41 text
Rubyʹ͓͍ͯ
trueͱfalse
ਅِͷද
Slide 42
Slide 42 text
ਅͷදɿtrue
ِͷදɿfalse
Slide 43
Slide 43 text
ͦΕҎ֎ͷɺ
ਅͷྫɿ42, [], …
ِͷྫɿnil
Slide 44
Slide 44 text
trueͱfalse
1Ϗοτͷใྔ
Slide 45
Slide 45 text
trueͱfalse
Կڞ༗
͍ͯ͠ͳ͍
Slide 46
Slide 46 text
trueͱfalse͕
ಉ͡Ϋϥεʹ
ଐ͢Δͱʁ
Slide 47
Slide 47 text
Ϋϥεͱʁ
Slide 48
Slide 48 text
ڞ௨͢Δͷ͕
·ͱ·͍ͬͯΔ
Slide 49
Slide 49 text
ଐ͍ͯ͠Δ
Πϯελϯε͕
ଐੑΛڞ༗͠ͳ͍ʁ
Slide 50
Slide 50 text
BooleanΫϥεʹ
ϝιου͕ଘࡏ
͠ͳ͍ʁ
Slide 51
Slide 51 text
Rejected for several reasons:
many gems and libraries had already introduced
Boolean class. I don't want to break them.
true and false are the only representative of
true-false values. In Ruby. nil and false are falsy
values, and everything else is a true value.
There's no meaning for having a superclass of
TrueClass and FalseClass as Boolean.
Matz.
ʢԼઢҾ༻ऀʣ
Slide 52
Slide 52 text
ڞ௨ͷΫϥε
ʹҙຯ͕ͳ͍
Slide 53
Slide 53 text
ͰBoolean͕
͋ͬͨ΄͏͕
ศརͳͷͰʁ
Slide 54
Slide 54 text
https://bugs.ruby-
lang.org/issues/
12515
Slide 55
Slide 55 text
Ϣʔεέʔε
Slide 56
Slide 56 text
v.is_a?(Boolean)
Slide 57
Slide 57 text
ಉ͡ػೳɿ
v == true || v == false
Slide 58
Slide 58 text
΄΅͜Ε͚ͩ
Slide 59
Slide 59 text
Rejected for several reasons:
many gems and libraries had already introduced
Boolean class. I don't want to break them.
true and false are the only representative of
true-false values. In Ruby. nil and false are falsy
values, and everything else is a true value.
There's no meaning for having a superclass of
TrueClass and FalseClass as Boolean.
Matz.
ʢԼઢҾ༻ऀʣ