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


Groups > comp.lang.c > #140918

Re: Propagating results from callbacks?

Subject Re: Propagating results from callbacks?
Newsgroups comp.lang.c
References (8 earlier) <5ceb5c7f-30b8-4cbd-9315-55ccdd726ce3@googlegroups.com> <871s4cmuhs.fsf@bsb.me.uk> <bbe300e6-98c3-4b2b-b3cb-d820b304d6f4@googlegroups.com> <c1a2d7a2-12bb-4107-aba4-561bb5ff4dd6@googlegroups.com> <8736orlxj7.fsf@bsb.me.uk>
From Bart <bc@freeuk.com>
Message-ID <DMT8E.367808$1D1.300446@fx29.am4> (permalink)
Organization virginmedia.com
Date 2019-02-13 12:08 +0000

Show all headers | View raw


On 13/02/2019 11:48, Ben Bacarisse wrote:
> fir <profesor.fir@gmail.com> writes:
> <cut>
>> having separate minus would make things easier and clearer here (also
>> this shorter minus you would be obliged always keep to number as its
>> liek part of number even nearly like just a sign bit so you could only
>> wrote "-23" but never "- 23")
> 
> It's never right to make it easy for the compiler writer at the expense
> of the programmer.  And here there is /no/ cost at all to the compiler
> writer.  The compiler must be able to parse '+42', '- + 42', '- -12' and
> so on, so you save nothing in the parser logic by adding a special form
> of negative literal.

Not with a language like C. With a simpler language you might to use 
integer constants without all the machinery that can reduce an 
arbitrarily complex constant expression.

In that case, you will expect to be able to write negative values.

This can be done by detecting the special case of a hyphen, at the start 
of a term, followed by an integer constant (necessarily positive, and 
this will likely be done in the parser rather than tokeniser).

You don't need a special character for the minus sign, unless you do 
want to do this within the tokeniser. Although this will make using the 
language harder if you have to stop every few seconds to enter a special 
unicode character.

But if that reduction machinery needs to be in place anyway, then as you 
say there is little point.

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


Thread

Propagating results from callbacks? luser droog <luser.droog@gmail.com> - 2019-02-08 16:32 -0800
  Re: Propagating results from callbacks? luser droog <luser.droog@gmail.com> - 2019-02-08 17:08 -0800
    Re: Propagating results from callbacks? luser droog <luser.droog@gmail.com> - 2019-02-09 20:01 -0800
      Re: Propagating results from callbacks? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-02-10 15:21 +0000
        Re: Propagating results from callbacks? luser droog <luser.droog@gmail.com> - 2019-02-10 12:59 -0800
          Re: Propagating results from callbacks? luser droog <luser.droog@gmail.com> - 2019-02-10 13:49 -0800
            Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-10 14:14 -0800
              Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-12 00:31 -0800
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-12 00:45 -0800
                Re: Propagating results from callbacks? luser droog <luser.droog@gmail.com> - 2019-02-12 14:30 -0800
                Re: Propagating results from callbacks? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-02-12 23:56 +0000
                Re: Propagating results from callbacks? Reinhardt Behm <rbehm@hushmail.com> - 2019-02-13 12:54 +0800
                Re: Propagating results from callbacks? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-02-13 11:16 +0000
                Re: Propagating results from callbacks? Andrew Smallshaw <andrews@sdf.org> - 2019-02-13 15:41 +0000
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 03:02 -0800
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 03:30 -0800
                Re: Propagating results from callbacks? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-02-13 11:48 +0000
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 03:59 -0800
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 04:10 -0800
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 04:29 -0800
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 04:40 -0800
                Re: Propagating results from callbacks? Bart <bc@freeuk.com> - 2019-02-13 12:08 +0000
                Re: Propagating results from callbacks? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-02-13 14:40 +0000
                Re: Propagating results from callbacks? Bart <bc@freeuk.com> - 2019-02-13 14:54 +0000
                Re: Propagating results from callbacks? David Brown <david.brown@hesbynett.no> - 2019-02-13 16:12 +0100
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 10:00 -0800
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 10:49 -0800
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 11:08 -0800
                Re: Propagating results from callbacks? Bart <bc@freeuk.com> - 2019-02-13 19:10 +0000
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 12:31 -0800
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 13:24 -0800
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 12:40 -0800
                Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-13 13:06 -0800
                Re: Propagating results from callbacks? David Brown <david.brown@hesbynett.no> - 2019-02-13 20:33 +0100
                Re: Propagating results from callbacks? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-02-13 15:49 +0000
          Re: Propagating results from callbacks? luser droog <luser.droog@gmail.com> - 2019-02-12 15:19 -0800
            Re: Propagating results from callbacks? luser droog <luser.droog@gmail.com> - 2019-02-12 19:02 -0800
              Re: Propagating results from callbacks? luser droog <luser.droog@gmail.com> - 2019-02-13 11:26 -0800
                Re: Propagating results from callbacks? luser droog <luser.droog@gmail.com> - 2019-02-13 16:09 -0800
                Re: Propagating results from callbacks? luser droog <luser.droog@gmail.com> - 2019-02-14 15:41 -0800
                Re: Propagating results from callbacks? luser droog <luser.droog@gmail.com> - 2019-02-14 16:42 -0800
  Re: Propagating results from callbacks? fir <profesor.fir@gmail.com> - 2019-02-10 05:14 -0800

csiph-web