Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #91671

Re: Synthetic 'unless' keyword

From BartC <bc@freeuk.com>
Newsgroups comp.lang.c
Subject Re: Synthetic 'unless' keyword
Date 2016-08-04 20:42 +0100
Organization A noiseless patient Spider
Message-ID <no05s6$dvc$1@dont-email.me> (permalink)
References (2 earlier) <83245b54-cf15-4d82-9418-cf48ba3cb37b@googlegroups.com> <lnh9b01m8v.fsf@kst-u.example.com> <87r3a4s7jc.fsf@bsb.me.uk> <c8eb07ac-aac1-4914-9ee8-3f38213e79b6@googlegroups.com> <end-20160804201810@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 04/08/2016 20:20, Stefan Ram wrote:
> supercat@casperkitty.com writes:
>> Precisely.  From a parsing standpoint, it's not really necessary to have a
>> parenthesis before the conditional expression, but it is necessary to have
>> something that marks the end of the conditional expression;
>
>   Why?
>
>   For example, in,
>
> if x > 0 && y < 11 printf( "ok." );
>
>   , or,
>
> if x > 0 && y < 11 { puts( "ok." ); puts( "fine" ); }
>
>   the expression that begins with »x« cannot be continued
>   with »printf« or »{«, so it must end with »11«.


What about:          Without () is parsed as:

  if (a) -b;          if a-b;
  if (a) *b;          if a*b;
  if (a) &b;          if a&b;
  if ("a") "b";       if "ab";
  if (a) (int)b;      if a(int)... // looks like a function call

etc.

There needs to be a tidy way of denoting the boundary between condition 
and statement. Such as ")", "then" or ":". It helps the reader as well 
as the compiler.

-- 
Bartc


Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Synthetic 'unless' keyword jt@toerring.de (Jens Thoms Toerring) - 2016-08-04 09:44 +0000
  Re: Synthetic 'unless' keyword David Brown <david.brown@hesbynett.no> - 2016-08-04 12:21 +0200
  Re: Synthetic 'unless' keyword Mark Storkamp <mstorkamp@yahoo.com> - 2016-08-04 07:01 -0500
    Re: Synthetic 'unless' keyword bert <bert.hutchings@btinternet.com> - 2016-08-04 05:42 -0700
    Re: Synthetic 'unless' keyword Keith Thompson <kst-u@mib.org> - 2016-08-04 08:45 -0700
      Re: Synthetic 'unless' keyword Philip Lantz <prl@canterey.us> - 2016-08-04 21:55 -0700
      Re: Synthetic 'unless' keyword BartC <bc@freeuk.com> - 2016-08-05 10:08 +0100
    Re: Synthetic 'unless' keyword Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-08-05 01:17 -0700
      Re: Synthetic 'unless' keyword BartC <bc@freeuk.com> - 2016-08-05 10:01 +0100
        Re: Synthetic 'unless' keyword Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-08-05 04:34 -0700
      Re: Synthetic 'unless' keyword Mark Storkamp <mstorkamp@yahoo.com> - 2016-08-05 09:37 -0500
        Re: Synthetic 'unless' keyword Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-08-06 02:28 -0700
  Re: Synthetic 'unless' keyword jt@toerring.de (Jens Thoms Toerring) - 2016-08-04 13:38 +0000
  Re: Synthetic 'unless' keyword BartC <bc@freeuk.com> - 2016-08-04 15:04 +0100
  Re: Synthetic 'unless' keyword mark.bluemel@gmail.com - 2016-08-04 07:06 -0700
  Re: Synthetic 'unless' keyword Keith Thompson <kst-u@mib.org> - 2016-08-04 08:52 -0700
    Re: Synthetic 'unless' keyword supercat@casperkitty.com - 2016-08-04 09:45 -0700
      Re: Synthetic 'unless' keyword Keith Thompson <kst-u@mib.org> - 2016-08-04 10:23 -0700
        Re: Synthetic 'unless' keyword Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-08-04 19:39 +0100
          Re: Synthetic 'unless' keyword supercat@casperkitty.com - 2016-08-04 12:02 -0700
            Re: Synthetic 'unless' keyword Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-08-04 20:33 +0100
            Re: Synthetic 'unless' keyword BartC <bc@freeuk.com> - 2016-08-04 20:42 +0100
              Re: Synthetic 'unless' keyword David Brown <david.brown@hesbynett.no> - 2016-08-05 13:14 +0200
                Re: Synthetic 'unless' keyword Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-08-05 12:41 +0100
    Re: Synthetic 'unless' keyword mark.bluemel@gmail.com - 2016-08-05 00:53 -0700
  Re: Synthetic 'unless' keyword Jerry Stuckle <jstucklex@attglobal.net> - 2016-08-04 16:43 -0400
    Re: Synthetic 'unless' keyword David Brown <david.brown@hesbynett.no> - 2016-08-05 13:16 +0200
  Re: Synthetic 'unless' keyword jt@toerring.de (Jens Thoms Toerring) - 2016-08-04 23:16 +0000
    Re: Synthetic 'unless' keyword Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-08-05 00:35 +0100
    Re: Synthetic 'unless' keyword Tim Rentsch <txr@alumni.caltech.edu> - 2016-08-04 20:13 -0700
    Re: Synthetic 'unless' keyword Tim Rentsch <txr@alumni.caltech.edu> - 2016-08-05 04:57 -0700
      Re: Synthetic 'unless' keyword BartC <bc@freeuk.com> - 2016-08-05 13:15 +0100
        Re: Synthetic 'unless' keyword Tim Rentsch <txr@alumni.caltech.edu> - 2016-08-18 08:11 -0700
          Re: Synthetic 'unless' keyword BartC <bc@freeuk.com> - 2016-08-18 16:36 +0100
            Re: Synthetic 'unless' keyword supercat@casperkitty.com - 2016-08-18 10:20 -0700
  Re: Synthetic 'unless' keyword Paul N <gw7rib@aol.com> - 2016-08-07 12:56 -0700

csiph-web