True.st
changeset 3044 a0bbac91639b
parent 1303 8fdc2c653d13
child 6906 87afb9964006
equal deleted inserted replaced
3043:aae6b34587c0 3044:a0bbac91639b
    67 
    67 
    68 and:aBlock
    68 and:aBlock
    69     "evaluate aBlock if the receiver is true.
    69     "evaluate aBlock if the receiver is true.
    70      since the receiver is known to be true,
    70      since the receiver is known to be true,
    71      return the value of evaluating the block.
    71      return the value of evaluating the block.
    72      - open coded by compiler"
    72      Notice:
       
    73 	This method is open coded (inlined) by the compiler(s)
       
    74 	- redefining it may not work as expected."
    73 
    75 
    74     ^ aBlock value
    76     ^ aBlock value
    75 !
    77 !
    76 
    78 
    77 ifFalse:aBlock
    79 ifFalse:aBlock
    78     "return the true alternative, nil (since the receiver is true)
    80     "return the true alternative, nil (since the receiver is true)
    79      - open coded by compiler"
    81      Notice:
       
    82 	This method is open coded (inlined) by the compiler(s)
       
    83 	- redefining it may not work as expected."
    80 
    84 
    81     ^ nil
    85     ^ nil
    82 !
    86 !
    83 
    87 
    84 ifFalse:falseBlock ifTrue:trueBlock
    88 ifFalse:falseBlock ifTrue:trueBlock
    85     "return the value of evaluating trueBlock (since the receiver is true)
    89     "return the value of evaluating trueBlock (since the receiver is true)
    86      - open coded by compiler"
    90      Notice:
       
    91 	This method is open coded (inlined) by the compiler(s)
       
    92 	- redefining it may not work as expected."
    87 
    93 
    88     ^ trueBlock value
    94     ^ trueBlock value
    89 !
    95 !
    90 
    96 
    91 ifTrue:aBlock
    97 ifTrue:aBlock
    92     "return the value of evaluating aBlock (since the receiver is true)
    98     "return the value of evaluating aBlock (since the receiver is true)
    93      - open coded by compiler"
    99      Notice:
       
   100 	This method is open coded (inlined) by the compiler(s)
       
   101 	- redefining it may not work as expected."
    94 
   102 
    95     ^ aBlock value
   103     ^ aBlock value
    96 !
   104 !
    97 
   105 
    98 ifTrue:trueBlock ifFalse:falseBlock
   106 ifTrue:trueBlock ifFalse:falseBlock
    99     "return the value of evaluating trueBlock (since the receiver is true)
   107     "return the value of evaluating trueBlock (since the receiver is true)
   100      - open coded by compiler"
   108      Notice:
       
   109 	This method is open coded (inlined) by the compiler(s)
       
   110 	- redefining it may not work as expected."
   101 
   111 
   102     ^ trueBlock value
   112     ^ trueBlock value
   103 !
   113 !
   104 
   114 
   105 or:aBlock
   115 or:aBlock
   106     "evaluate aBlock if the receiver is false.
   116     "evaluate aBlock if the receiver is false.
   107      since the receiver is known to be true simply return true.
   117      since the receiver is known to be true simply return true.
   108      - open coded by compiler"
   118      Notice:
       
   119 	This method is open coded (inlined) by the compiler(s)
       
   120 	- redefining it may not work as expected."
   109 
   121 
   110     ^ self
   122     ^ self
   111 ! !
   123 ! !
   112 
   124 
   113 !True methodsFor:'logical operations'!
   125 !True methodsFor:'logical operations'!
   126     ^ aBoolean
   138     ^ aBoolean
   127 !
   139 !
   128 
   140 
   129 not
   141 not
   130    "return true if the receiver is false, false otherwise
   142    "return true if the receiver is false, false otherwise
   131     (since the receiver is true, return false)"
   143     (since the receiver is true, return false).
       
   144     Notice:
       
   145 	This method is open coded (inlined) by the compiler(s)
       
   146 	- redefining it may not work as expected."
   132 
   147 
   133     ^ false
   148     ^ false
   134 !
   149 !
   135 
   150 
   136 xor:aBoolean
   151 xor:aBoolean
   156 ! !
   171 ! !
   157 
   172 
   158 !True class methodsFor:'documentation'!
   173 !True class methodsFor:'documentation'!
   159 
   174 
   160 version
   175 version
   161     ^ '$Header: /cvs/stx/stx/libbasic/True.st,v 1.18 1996-04-26 07:12:22 cg Exp $'
   176     ^ '$Header: /cvs/stx/stx/libbasic/True.st,v 1.19 1997-10-21 17:44:58 cg Exp $'
   162 ! !
   177 ! !