mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jamie Lokier <lk@tantalophile.demon.co.uk>
To: "Gábor Lénárt" <lgb@lgb.hu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: RFC: booleans and the kernel
Date: Sat, 26 Jan 2002 16:27:47 +0000	[thread overview]
Message-ID: <20020126162747.A6724@kushida.apsleyroad.org> (raw)
In-Reply-To: <3C513CD8.B75B5C42@aitel.hist.no> <20020126030841.C5730@kushida.apsleyroad.org> <20020126105121.GA18223@vega.digitel2002.hu>
In-Reply-To: <20020126105121.GA18223@vega.digitel2002.hu>; from lgb@lgb.hu on Sat, Jan 26, 2002 at 11:51:22AM +0100

Gábor Lénárt wrote:
> Khmmm please enlighten me ...
> 
> >   if (X == true && ptr && *ptr > 1)
> 
> Why? Simply use for example type 'char' as boolean value. Let's say
> 0 means false and other value is true.
> 
> So:
> 
> if (x) printf("true");
> or
> if (!x) printf("false");
> 
> Why do you want to overcomplicate?

If the variable holds a boolean in the C language, fair enough but if
it's being used as a range in a truth-value system of _another_
language, i.e. it simply _represents_ a truth value, I would write it
differently.

If it were a theorem proving paper, the different kinds of variable
would have a different font or colour :-)

> x=a>b;
> if (x) printf("A is greater than B");
> 
> ONE thing which is best in C is the less strictly type rules eg you
> can use 'char' to store eg c='A' or c=2.

You seem to have missed the point.  We _know_ the C language rules.  I
agree that non-strict typeing is quite useful, although C is in fact
quite strict.  Lisp has far less strict typing :-)

> Hey guys, C was designed to write an OS it's not something other ...

Perhaps, but it's pretty useful for something other.

-- Jamie

  reply	other threads:[~2002-01-26 16:32 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-25 11:09 Helge Hafting
2002-01-26  3:08 ` Jamie Lokier
2002-01-26  9:13   ` Mark Zealey
2002-01-27 19:58     ` Jamie Lokier
2002-01-26 10:51   ` Gábor Lénárt
2002-01-26 16:27     ` Jamie Lokier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-01-26 15:48 Ben Bridgwater
2002-01-25 11:28 Thomas Hood
2002-01-25 11:39 ` Xavier Bestel
2002-01-24 17:42 Jeff Garzik
2002-01-24 18:22 ` Anton Altaparmakov
2002-01-24 18:33   ` Arnaldo Carvalho de Melo
2002-01-24 19:28 ` H. Peter Anvin
2002-01-24 19:34   ` Arnaldo Carvalho de Melo
2002-01-24 19:43     ` H. Peter Anvin
2002-01-24 19:47       ` Arnaldo Carvalho de Melo
2002-01-24 19:46     ` Ingo Oeser
2002-01-24 19:52 ` Oliver Xymoron
2002-01-24 20:03   ` Jeff Garzik
2002-01-24 20:06     ` Oliver Xymoron
2002-01-24 20:14       ` Jeff Garzik
2002-01-24 20:23       ` Alexander Viro
2002-01-24 20:25         ` Oliver Xymoron
2002-01-24 20:35           ` John Levon
2002-01-24 20:15     ` Alexander Viro
2002-01-24 20:21   ` Richard B. Johnson
2002-01-24 20:39     ` Oliver Xymoron
2002-01-24 21:55       ` Richard B. Johnson
2002-01-24 21:57         ` Jeff Garzik
2002-01-24 22:05         ` H. Peter Anvin
2002-01-24 22:13         ` Robert Love
2002-01-24 22:33       ` Xavier Bestel
2002-01-24 22:53         ` Xavier Bestel
2002-01-24 22:59         ` Robert Love
2002-01-24 23:27           ` Xavier Bestel
2002-01-25  6:13             ` Alexander Viro
2002-01-25  8:00               ` Momchil Velikov
2002-01-25 10:51               ` Xavier Bestel
2002-01-25 16:11               ` Olivier Galibert
2002-01-26  7:22               ` Timothy Covell
2002-01-25  7:48                 ` Alexander Viro
2002-01-25 23:49                   ` J.A. Magallon
2002-01-27 11:27                 ` Kai Henningsen
2002-01-25 23:09           ` Timothy Covell
2002-01-25  1:16             ` John Levon
2002-01-25 22:47         ` Timothy Covell
2002-01-25 21:24       ` Timothy Covell
2002-01-24 21:31         ` Oliver Xymoron
2002-01-24 22:19           ` Robert Love
2002-01-24 22:38             ` Robert Love
2002-01-25 22:44               ` Timothy Covell
2002-01-25  3:52                 ` Ragnar Hojland Espinosa
2002-01-25 20:39                   ` Calin A. Culianu
2002-01-25 23:07                   ` Rick Stevens
2002-01-25 19:02                 ` Kai Henningsen
2002-01-27  1:33                   ` Timothy Covell
2002-01-26  2:56                     ` Jamie Lokier
2002-01-27 11:18                   ` Kai Henningsen
2002-01-25 22:30             ` Timothy Covell
2002-01-24 22:36               ` Alexander Viro
2002-01-25  6:36               ` Kai Henningsen
     [not found]                 ` <200201250900.g0P8xoL10082@home.ashavan.org.>
2002-01-29  6:36                   ` Nix N. Nix
2002-01-25 21:43           ` Timothy Covell
2002-01-24 21:50             ` Oliver Xymoron
2002-01-24 22:21               ` H. Peter Anvin
2002-01-25 15:07                 ` Werner Almesberger
2002-01-25 15:21                   ` Jakub Jelinek
2002-01-25 16:45                   ` H. Peter Anvin
2002-01-25 11:07         ` Helge Hafting
2002-01-24 22:33 ` Chris Wedgwood
2002-01-24 22:44   ` H. Peter Anvin
2002-01-26 10:22     ` Chris Wedgwood
2002-01-25  2:00 ` Erik Andersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020126162747.A6724@kushida.apsleyroad.org \
    --to=lk@tantalophile.demon.co.uk \
    --cc=lgb@lgb.hu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®