From 845e662265fd5d0ede241e77eb631a14b579f0a7 Mon Sep 17 00:00:00 2001 From: Jonatan Liljedahl Date: Sat, 21 Jan 2012 14:41:20 +0100 Subject: [PATCH] Boolean: fix help file, add asInteger and binaryValue subclassResponsibility Boolean must respond to the methods mentioned in the help file, or else it renders "method not found". (cherry picked from commit 0d2a14776cc6de2810103d82b2e7e9a7858c513e) --- HelpSource/Classes/Boolean.schelp | 3 ++- SCClassLibrary/Common/Core/Boolean.sc | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HelpSource/Classes/Boolean.schelp b/HelpSource/Classes/Boolean.schelp index 8682c2119..db17bc124 100644 --- a/HelpSource/Classes/Boolean.schelp +++ b/HelpSource/Classes/Boolean.schelp @@ -49,12 +49,13 @@ method::if If the receiver is true, answer the evaluation of the trueFunc. If the receiver is false, answer the evaluation of the falseFunc. +method::asInteger method::binaryValue returns:: 1 if the receiver is true, and 0 if the receiver is false. +method::asBoolean method::booleanValue - Returns:: The receiver. The same message is understood by link::Classes/SimpleNumber:: and can be used to convert it to boolean. method::keywordWarnings diff --git a/SCClassLibrary/Common/Core/Boolean.sc b/SCClassLibrary/Common/Core/Boolean.sc index b1ffeeabf..4d0a4cd86 100644 --- a/SCClassLibrary/Common/Core/Boolean.sc +++ b/SCClassLibrary/Common/Core/Boolean.sc @@ -8,6 +8,8 @@ Boolean { and { ^this.subclassResponsibility(thisMethod) } or { ^this.subclassResponsibility(thisMethod) } nand { ^this.subclassResponsibility(thisMethod) } + asInteger { ^this.subclassResponsibility(thisMethod) } + binaryValue { ^this.subclassResponsibility(thisMethod) } // TODO: deprecate for asInteger asBoolean { ^this } booleanValue { ^this } // TODO in the long-run, deprecate for asBoolean -- 2.11.4.GIT