Hi Tim,

you wrote:
>Hello Allies:
>I gotta say it: extra verbiage is not simplicity. It would 
>cause a client of mine alarm, and that ain't simple....
>Wouldn't take a lot of code to give an option to suppress...
>but what the hey - 
>I modified Michael's idea of ending the script with a true
>and ended it with prin ""

Why not use a roll-your-own if replacement? 

_if: :if
if: func [condition block [block!] /quiet /local result] [
  result: _if condition block
  either quiet [
    exit
  ][
    return result
  ]
]


>> if false ["Will return false."]
== false
>> if/quiet false ["Will NOT return anything."]
>>


Note that you cannot redefine if UNLESS you preserve its original behavior
as the new, reassigned if's default behavior, because there are some
mezzanine functions that expect if to return some value. These functions
may fail if your reassigned if does not act as they expect. 

That's why my reassigned if preserves the behavior of REBOL's original if
as its own default behavior when it is called without the /quiet
refinement. The mezzanine functions will be served the result they expect. 


>That shut the sucker up!
>Thanks As Always :>) Tim
>
>At 08:22 AM 5/18/00 -0700, you wrote:
>>You all DO understand WHY "== false" is being displayed in the interpreter
>>(for an 'if statement), right? Gabrielle said it best, who deserves to be
>>quoted on the rebol.com site: "...This is the thing about REBOL ---
>>everything is simple by design; so if something looks unintuitive, it's just
>>because simplicity is not always intuitive. :)"
>>
>>'if returns a value, just like most other REBOL words/functions/statements.
>>'if first evaluates the given condition (producing a value of 'true or
>>'false); when the condition is 'true, 'if "then" evaluates the block (also
>>producing a value). The value of 'if is therefore taken from the value of
>>either the condition or the value of the block. To change this would add
>>complexity.
>>
>>BTW I end all of my REBOL modules with the word 'true, just so that I don't
>>get some arbitrary value displayed when loading it. Seeing "== true" after
>>loading a module is somehow pleasing.
>>
>>- Michael Jelinek
>>
>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>>Sent: Wednesday, May 17, 2000 8:40 PM
>>To: [EMAIL PROTECTED]
>>Subject: [REBOL] Suppressing == false Re:(2)
>>
>>
>>Tim wrote:
>>> I get "== false" in the output.
>>> How do I get rid of that?
>>
>>The best way currently, is to swap the 'if for a 'either.
>>
>>I, too, would like rebol to get rid of the 'false returned by a 'if not
>>taken.
>>
>>Andrew Martin
>>ICQ: 26227169
>>http://members.xoom.com/AndrewMartin/
>>-><-
>>
>>
>
>
>

;- Elan >> [: - )]

Reply via email to