home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 262,318 of 264,096   
   Dan Cross to arne@vajhoej.dk   
   Re: basic BASIC question   
   01 Feb 25 04:29:50   
   
   From: cross@spitfire.i.gajendra.net   
      
   In article <679d7b05$0$713$14726298@news.sunsite.dk>,   
   Arne Vajhøj   wrote:   
   >On 1/31/2025 5:05 PM, Dan Cross wrote:   
   >> In article <679d26bd$0$713$14726298@news.sunsite.dk>,   
   >> Arne Vajhøj   wrote:   
   >>> But there is no consistency between languages.   
   >>>   
   >>> $ type dump.for   
   >>> [snip]   
   >>   
   >> I don't know why this should be surprising?   
   >   
   >I don't know if it is surprising, but it is inconsistent.   
      
   What I mean is, why is it notable that they are inconsistent?   
   They are, after all, different languages that come from   
   different places and took different evolutionary paths.  They   
   have different standards defining them and mandating different   
   things; Pascal and C, define the values of the boolean literals   
   as 0 and 1; C goes further and mandates that the allowable   
   values in a `bool` are 0 (false) and 1 (true).  The reference   
   manuals for the versions of BASIC and Fortran in use here   
   mandate that -1 is the value for the `false` literal.   
      
   >                  Fortran       Pascal        C          Basic   
   >true literal       -1             1      usually 1    usually -1   
   >false literal       0             0          0            0   
   >test            low bit set  low bit set   not 0        not 0   
      
   These program snippets conflate two separate things: whether an   
   integer, when evaluated in a boolean context, yields a `true` or   
   `false` value, and the value that represents a literal `true`   
   constant.   
      
   >4 languages - 4 ways of doing it.   
      
   Four different syntaxes, too. :-)   
      
   	- Dan C.   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca