FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Booleans compared to strings
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Booleans compared to strings [message #181415 is a reply to message #181383] Wed, 15 May 2013 19:34 Go to previous messageGo to previous message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma:
Senior Member
Am 14.05.2013 22:17, schrieb The Natural Philosopher:
> On 14/05/13 20:36, M. Strobel wrote:
>> Am 14.05.2013 00:28, schrieb The Natural Philosopher:
>>> On 13/05/13 22:46, Thomas 'PointedEars' Lahn wrote:
>>>> M. Strobel wrote:
>>>>
>>>> > Am 13.05.2013 22:24, schrieb Doug Cassidy:
>>>> >> On Monday, May 13, 2013 6:13:11 AM UTC-7, Jerry Stuckle wrote:
>>>> >>> On 5/13/2013 8:29 AM, Doug Cassidy wrote:
>>>> >>>> I dont see why boolean true is equal to string false in any way.
>>>> >>> A string comparison returns false only if the string is NULL, is an
>>>> >>> empty string ('') or contains a zero ('0'). All other values (including
>>>> >>> 'false') are true.
>>>> >> got it, thanks
>>>> > My favourite link to comparison in PHP is
>>>> > http://www.php.net/manual/en/types.comparisons.php
>>>> > where you have also the "if ($x)" results.
>>>> >
>>>> > Highly recommended.
>>>> Slighty off, though, because “if” is _not_ a function.
>>> Semantics. It behaves like one, takes two variables and returns a value.
>>>
>>> In FORTH its like any other function IIRC, But then everything is a function , in
>>> forth :-)
>> Hmm, in Forth you do 0= or something, then "if" takes a flag off the stack and does a
>> branch/jump to the else address if the flag is false.
>>
>> Not easy to see it as a function.
> try writing the FORTH interpreter...
>> /Str.
>>
>
>
No problem, did it in /370 assembly. You mean because it is an immediate word? but it
is not a function, it does not return a value, only side effects.

/Str.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Security risks allowing users to upload a css file?
Next Topic: mkdir no such file or directory
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 04:34:28 GMT 2024

Total time taken to generate the page: 0.04188 seconds