home bbs files messages ]

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

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

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

   Message 242,217 of 243,242   
   Janis Papanagnou to bart   
   Re: _BitInt(N)   
   29 Nov 25 03:26:49   
   
   From: janis_papanagnou+ng@hotmail.com   
      
   On 28/11/2025 12.49, bart wrote:   
   > On 28/11/2025 02:33, Janis Papanagnou wrote:   
   >   
   >> so the natural way of describing them would (IMO) rather be   
   >> based on 'x mod 2 = 1' and 'x mod 2 = 0' respectively. (So the "C"   
   >> syntax with '%' is probably more "appropriate". Mileages may vary.)   
   >   
   > I've made the mistake with % 1 more than once.   
      
   (If you know in what areas you commonly make mistakes you can   
   work on that! - Just a suggestion to think about.)   
      
   >   
   >> You can of course add as many commodity features to "your language"   
   >> as you like. I seem to recall that one of the design principles of   
   >> "C" was to not add too many keywords. (Not sure whether 'A.odd' is   
   >> a function or keyword above [in "your language"].)   
   >   
   > It is a reserved word, which means it can't be used as either a top-   
   > level user identifier, or a member name. With extra effort, it could be   
   > used for both, but that needs some special syntax, such as Ada-style   
   > "A'odd"; I've never got around to it.   
   >   
   > In Pascal (where I copied it from) it is a reserved word.   
      
   As far as I recall, in Pascal it's a predefined function! - The   
   difference is that you cannot use reserved words as identifiers.   
   (It's similar, but not necessarily, with keywords; depending on   
   the language.)   
      
   That was basically also the background of my explanation; to my   
   knowledge "C" didn't want to introduce too many reserved words   
   that as a consequence then cannot be used as "language entity"   
   names (like variables, function names, etc.) any more. - That's   
   why introducing simple high-level functions unnecessarily may be   
   deprecated.   
      
   >   
   >> PS: BTW, I was always wondering why Pascal and Algol 68 supported   
   >> 'odd' but not 'even'! - In the documents of the Genie compiler we   
   >> can read: "This is a relic of times long past.", but beyond that   
   >> it doesn't explain why it's a "relic". I can only guess that it's,   
   >> as a special case, considered just unnecessary in the presence of   
   >> the modulus operator.   
   >   
   > Maybe because you can trivially define 'even' as 'not odd'.   
      
   But it's the same with 'odd'; you can trivially write it as an   
   boolean or as an arithmetic expression, whatever one prefers.   
      
   And that also doesn't explain why 'odd' is considered a "relic"   
   by Marcel. (I can only explain that opinion as I've done above.)   
   The point in Algol 68 is, though, even more relaxed; since you   
   have stropping there the conflicts of keywords with identifiers   
   aren't what they are in other languages.   
      
   Janis   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

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


(c) 1994,  bbs@darkrealms.ca