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


Groups > comp.lang.c > #156943 > unrolled thread

Programming exercise/challenge

Started byTim Rentsch <tr.17687@z991.linuxsc.com>
First post2020-12-05 08:25 -0800
Last post2021-01-06 23:07 -0800
Articles 20 on this page of 399 — 24 participants

Back to article view | Back to comp.lang.c


Contents

  Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-05 08:25 -0800
    Re: Programming exercise/challenge Sjouke Burry <burrynulnulfour@ppllaanneett.nnll> - 2020-12-05 17:33 +0100
      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-06 11:58 -0800
      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-30 09:40 -0800
        Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-30 18:20 +0000
          Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-31 01:04 -0800
          Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2021-01-02 22:05 +0300
            Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2021-01-02 14:48 -0500
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-02 19:17 -0800
            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-02 19:04 -0800
        Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-30 21:44 +0000
          Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-31 02:54 +0000
          Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-03 09:49 -0800
            Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2021-01-04 00:15 +0300
              Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-03 21:57 +0000
                Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-03 23:00 +0000
                  Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-04 00:00 +0000
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-04 20:04 -0800
                Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-05 07:15 +0000
                  Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-07 22:30 -0800
            Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-04 18:42 +0000
              Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-04 21:23 +0000
                Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-04 23:41 +0000
    Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-05 16:39 +0000
      Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-05 16:58 +0000
        Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-05 17:08 +0000
        Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-05 17:11 +0000
          Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-05 17:24 +0000
            Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-05 17:52 +0000
              Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-05 18:30 +0000
              Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-05 19:56 +0000
                Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-06 14:51 +0000
        Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-05 17:49 +0000
          Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-05 18:34 +0000
        Re: Programming exercise/challenge Bonita Montero <Bonita.Montero@gmail.com> - 2020-12-05 19:40 +0100
          Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-05 18:47 +0000
            Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-05 23:19 +0000
              Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-05 23:56 +0000
              Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-08 02:26 +0000
                Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-08 16:04 +0300
                  Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-08 23:39 -0800
                    Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-12 23:34 +0300
                      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-12 19:28 -0800
                      Re: Programming exercise/challenge kegs@provalid.com (Kent Dickey) - 2020-12-29 10:34 -0600
                        Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-29 20:05 -0800
      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-06 06:03 -0800
    Re: Programming exercise/challenge dfs <nospam@dfs.com> - 2020-12-05 13:58 -0500
      Re: Programming exercise/challenge Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-12-05 21:37 +0000
        Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-06 06:13 -0800
          Re: Programming exercise/challenge jacobnavia <jacob@jacob.remcomp.fr> - 2020-12-06 18:00 +0100
            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-06 12:31 -0800
      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-06 06:26 -0800
    Re: Programming exercise/challenge jacobnavia <jacob@jacob.remcomp.fr> - 2020-12-05 23:32 +0100
      Re: Programming exercise/challenge jacobnavia <jacob@jacob.remcomp.fr> - 2020-12-06 17:18 +0100
        Re: Programming exercise/challenge jacobnavia <jacob@jacob.remcomp.fr> - 2020-12-06 17:51 +0100
        Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-06 22:27 +0000
          Re: Programming exercise/challenge jacobnavia <jacob@jacob.remcomp.fr> - 2020-12-07 09:37 +0100
            Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-07 07:36 -0500
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-08 22:49 -0800
    Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-06 17:51 +0000
      Re: Programming exercise/challenge dfs <nospam@dfs.com> - 2020-12-06 13:03 -0500
        Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-06 23:53 +0000
      Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-06 19:53 +0000
        Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-06 23:38 +0000
          Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-07 00:17 +0000
            Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-07 02:09 +0000
      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-07 01:03 -0800
        Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-07 12:05 +0000
          Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-07 12:25 +0000
            Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-07 13:33 +0000
              Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-07 14:18 +0000
                Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-07 14:31 +0000
                  Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-07 12:58 -0500
                    Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-08 23:03 -0800
                Re: Programming exercise/challenge Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-12-07 07:12 -0800
                Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-07 21:55 +0000
                Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-08 22:59 -0800
            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-08 22:55 -0800
              Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-09 07:45 -0500
                Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-24 11:26 -0800
                  Re: Programming exercise/challenge Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-12-24 12:24 -0800
                    Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-24 17:19 -0500
                      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-27 05:16 -0800
                    Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-27 04:17 -0800
                      Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-27 08:27 -0500
                        Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-29 19:18 -0800
          Re: Programming exercise/challenge Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-12-07 05:15 -0800
            Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-07 13:42 +0000
          Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-08 22:53 -0800
          Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-10 01:49 -0800
            Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-10 22:35 +0000
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-10 21:17 -0800
                Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-12 21:44 +0000
                  Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-12 19:46 -0800
                    Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-13 12:21 +0000
                      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-24 11:35 -0800
                        Re: Programming exercise/challenge Rosario19 <Ros@invalid.invalid> - 2020-12-31 00:46 +0100
                          Re: Programming exercise/challenge Rosario19 <Ros@invalid.invalid> - 2020-12-31 00:52 +0100
                            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-31 00:34 -0800
                              Re: Programming exercise/challenge Rosario19 <Ros@invalid.invalid> - 2021-01-01 08:23 +0100
                                Re: Programming exercise/challenge Rosario19 <Ros@invalid.invalid> - 2021-01-01 10:09 +0100
                                  Re: Programming exercise/challenge Rosario19 <Ros@invalid.invalid> - 2021-01-01 11:38 +0100
                                    Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-01 08:24 -0800
        Re: Programming exercise/challenge "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2020-12-07 07:03 -0800
          Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-08 02:16 +0300
            Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-09 02:39 +0300
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-08 23:18 -0800
            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-08 23:17 -0800
    Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-08 00:27 +0300
      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-08 23:20 -0800
    Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-07 13:44 -0800
      Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-07 14:01 -0800
      Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-07 22:16 +0000
        Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-07 15:10 -0800
          Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-08 01:07 +0000
        Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-08 00:34 +0000
      Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-08 18:17 -0800
        Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-09 00:56 -0800
          Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-09 02:30 -0800
            Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-09 15:14 -0800
              Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-09 15:44 -0800
              Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-12 23:56 +0300
                Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-12 13:29 -0800
                  Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-13 00:46 +0300
                    Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-12 13:59 -0800
                  Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-13 14:17 +0300
                    Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-13 12:58 -0800
                      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-13 20:57 -0800
                        Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-14 20:44 -0800
                          Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-23 11:15 -0800
                            Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-23 23:45 +0300
                              Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-23 21:36 -0800
                                Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-24 09:11 -0800
                                  Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-24 15:30 -0800
                                    Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-24 23:18 -0800
                                      Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-24 23:56 -0800
                                        Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2020-12-28 12:01 -0800
                                          Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-29 19:31 -0800
                              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-24 14:47 -0800
    Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-08 01:59 +0300
      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-08 23:26 -0800
    Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-07 19:02 -0500
      Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-08 01:15 +0000
        Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-07 20:38 -0500
          Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-08 02:19 +0000
      Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-08 11:44 +0000
        Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-08 07:32 -0500
          Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-08 14:40 +0000
            Re: Programming exercise/challenge "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2020-12-08 06:52 -0800
              Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-08 17:31 +0000
                Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-08 20:16 +0000
                  Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-08 20:48 +0000
                    Re: Programming exercise/challenge Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-12-08 15:34 -0800
                      Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-09 02:54 +0300
                        Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-09 12:33 +0300
                          Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-09 12:43 +0300
                            Re: Programming exercise/challenge Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-12-09 01:52 -0800
                              Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-13 00:28 +0300
                                Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-12 21:40 +0000
                                  Re: Programming exercise/challenge Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-12-12 13:48 -0800
                          Re: Programming exercise/challenge Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-12-09 01:46 -0800
                      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-08 23:29 -0800
            Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-08 10:45 -0500
            Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-08 17:16 +0000
        Re: Programming exercise/challenge "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2020-12-08 06:39 -0800
    Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-07 17:48 -0800
      Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-07 21:03 -0500
        Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-09 03:02 -0800
          Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-09 08:02 -0500
            Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-09 16:49 +0000
              Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-09 13:33 -0500
                Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-09 19:57 +0000
                Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-10 01:45 +0000
                  Re: Programming exercise/challenge Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2020-12-10 02:15 +0000
                    Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-24 11:24 -0800
                  Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-09 21:57 -0500
                    Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-10 03:32 +0000
                      Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-10 08:19 -0500
            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-24 11:04 -0800
              Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-24 19:34 +0000
      Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-08 02:22 +0000
        Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-09 03:04 -0800
          Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-09 11:59 +0000
            Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-09 08:11 -0500
            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-10 00:02 -0800
              Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-10 15:12 +0000
                Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-10 10:36 -0800
                  Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-10 22:11 +0000
                    Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-10 23:34 +0000
                    Re: Programming exercise/challenge "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2020-12-10 20:11 -0800
                    Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-10 21:06 -0800
      Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-09 03:03 +0300
        Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-08 21:21 -0500
          Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-09 12:50 +0300
            Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2020-12-09 08:16 -0500
        Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-08 23:32 -0800
        Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-09 12:21 +0000
          Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-02 19:15 +0000
            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-07 01:54 -0800
              Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-22 22:36 +0000
                Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-22 23:07 +0000
                  Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-22 20:27 -0800
                    Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-23 13:05 +0000
                      Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-23 07:45 -0800
                        Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-23 16:49 +0000
                      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-23 11:22 -0800
                    Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-23 16:53 +0000
                      Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-23 09:55 -0800
                  Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-23 21:35 -0800
                    Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-24 18:17 +0000
                      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-27 07:57 -0800
                Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-23 11:28 -0800
    Re: Programming exercise/challenge "jfbod...@gmail.com" <jfbode1029@gmail.com> - 2020-12-08 11:30 -0800
      Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-08 20:31 +0000
        Re: Programming exercise/challenge jacobnavia <jacob@jacob.remcomp.fr> - 2020-12-08 22:17 +0100
      Re: Programming exercise/challenge jacobnavia <jacob@jacob.remcomp.fr> - 2020-12-08 22:15 +0100
        Re: Programming exercise/challenge "jfbod...@gmail.com" <jfbode1029@gmail.com> - 2020-12-08 13:28 -0800
          Re: Programming exercise/challenge "jfbod...@gmail.com" <jfbode1029@gmail.com> - 2020-12-09 12:05 -0800
            Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-13 00:04 +0300
        Re: Programming exercise/challenge Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2020-12-08 21:38 +0000
      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-09 03:25 -0800
    Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-09 01:00 +0000
      Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-09 03:09 +0000
        Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-13 00:35 +0300
          Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-12 22:57 +0000
            Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-12 23:43 +0000
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-12 19:47 -0800
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-12 23:27 -0800
                Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-12-13 14:44 +0000
                  Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-24 11:47 -0800
    Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-09 03:36 -0800
      Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-09 14:51 +0300
        Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-09 11:35 -0800
          Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-10 02:33 +0300
            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-10 00:05 -0800
              Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-10 14:59 +0300
                Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-10 20:32 -0800
            Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-12 23:45 +0300
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-12 19:24 -0800
          Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-13 00:17 +0300
            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-12 19:23 -0800
      Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2020-12-09 19:31 +0000
      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-09 12:01 -0800
        Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-09 12:25 -0800
    Re: Programming exercise/challenge kegs@provalid.com (Kent Dickey) - 2020-12-23 01:00 -0600
      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-24 14:34 -0800
        Re: Programming exercise/challenge kegs@provalid.com (Kent Dickey) - 2020-12-26 23:03 -0600
          Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-27 06:29 -0800
            Re: Programming exercise/challenge kegs@provalid.com (Kent Dickey) - 2020-12-28 11:52 -0600
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-29 00:38 -0800
          Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-28 15:29 +0300
            Re: Programming exercise/challenge kegs@provalid.com (Kent Dickey) - 2020-12-28 17:12 -0600
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-28 23:54 -0800
          Re: Programming exercise/challenge kegs@provalid.com (Kent Dickey) - 2020-12-29 10:26 -0600
            Re: Programming exercise/challenge kegs@provalid.com (Kent Dickey) - 2020-12-29 10:37 -0600
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-29 19:59 -0800
    Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-12-30 09:17 -0800
      Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2020-12-31 16:54 +0300
        Re: Programming exercise/challenge kegs@provalid.com (Kent Dickey) - 2020-12-31 09:16 -0600
          Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2020-12-31 15:56 +0000
            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-07 02:41 -0800
          Re: Programming exercise/challenge Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-12-31 13:01 -0800
          Re: Programming exercise/challenge Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-12-31 14:15 -0800
          Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-01 08:03 -0800
        Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-01 07:42 -0800
          Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2021-01-02 21:59 +0300
            Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2021-01-02 14:52 -0500
              Re: Programming exercise/challenge Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-01-02 12:30 -0800
              Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-02 18:17 -0500
                Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2021-01-02 19:22 -0500
                Re: Programming exercise/challenge Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-01-02 17:48 -0800
                  Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-02 22:35 -0500
            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-02 18:02 -0800
              Re: Programming exercise/challenge Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-01-03 00:42 -0800
                Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-04 20:12 -0800
    Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-04 07:04 -0800
      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-04 20:22 -0800
        Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-05 04:24 -0800
          Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-05 06:22 -0800
            Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-05 08:55 -0800
              Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2021-01-05 20:22 +0300
                Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2021-01-05 20:27 +0300
                Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-05 14:20 -0800
              Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-05 17:23 +0000
                Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-05 10:18 -0800
                  Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-05 18:57 +0000
                Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-05 12:58 -0800
                  Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2021-01-05 17:31 -0500
                  Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-05 17:50 -0500
                    Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-05 19:33 -0800
                      Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2021-01-05 23:02 -0500
                        Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-05 21:00 -0800
                          Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2021-01-06 07:42 -0500
                            Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-06 08:55 -0800
                              Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2021-01-06 13:29 -0500
                                Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-06 14:09 -0800
                                  Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-06 22:11 -0500
                                  Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-07 03:10 -0800
                                    Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2021-01-07 06:40 -0500
                                    Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-09 06:27 -0800
                                      Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-10 04:32 -0800
                                        Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-11 06:58 -0800
                                          Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-11 14:40 -0800
                                            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-15 09:46 -0800
                                              Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-17 04:13 -0800
                                                Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-17 14:18 +0000
                                                  Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-17 18:02 +0000
                                                    Re: Programming exercise/challenge Richard Damon <Richard@Damon-Family.org> - 2021-01-17 15:12 -0500
                                                    Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-17 21:39 +0000
                                                Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-20 10:57 -0800
                                                  Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-21 11:37 -0800
                                                    Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-22 00:30 -0500
                                                      Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-22 09:09 -0800
                                                        Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-22 13:47 -0500
                                                        Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-22 19:00 +0000
                                                          Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-22 19:42 +0000
                                                            Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-22 21:16 +0000
                                                              Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-22 16:41 -0500
                                                                Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-23 17:46 -0800
                                                              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-23 09:51 -0800
                                                                Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-23 18:38 +0000
                                                          Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-23 04:52 -0800
                                                            Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-01-23 15:45 +0000
                                                              Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-23 09:04 -0800
                                                                Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-01-23 23:10 +0000
                                                                  Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-23 15:39 -0800
                                                            Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-23 15:59 +0000
                                                            Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-25 11:40 -0500
                                                      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-23 09:47 -0800
                                                        Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-23 18:32 +0000
                                                    Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-23 17:26 -0800
                                                      Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-24 01:55 +0000
                                                        Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-27 08:40 -0800
                                                      Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-23 20:51 -0800
                                                        Re: Programming exercise/challenge Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-01-24 02:28 -0800
                                                          Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-24 03:49 -0800
                                                            Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2021-01-24 15:38 +0300
                                                            Re: Programming exercise/challenge Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-01-24 14:04 -0800
                                                              Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-25 07:26 -0800
                                                                Re: Programming exercise/challenge David Brown <david.brown@hesbynett.no> - 2021-01-25 16:58 +0100
                                                                Re: Programming exercise/challenge luser droog <luser.droog@gmail.com> - 2021-01-25 09:14 -0800
                                                                  Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-27 07:32 -0800
                                                                    Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-01-27 16:24 +0000
                                                                      Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-28 00:11 -0800
                                                                      Re: Programming exercise/challenge Anton Shepelev <anton.txt@g{oogle}mail.com> - 2021-01-28 12:25 +0300
                                                                        Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-28 06:18 -0500
                                                                          Re: Programming exercise/challenge Anton Shepelev <anton.txt@g{oogle}mail.com> - 2021-01-28 16:54 +0300
                                                                            Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-28 09:15 -0500
                                                                              Re: Programming exercise/challenge Anton Shepelev <anton.txt@g{oogle}mail.com> - 2021-01-28 20:07 +0300
                                                                                Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-28 15:58 -0500
                                                                                  Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2021-01-29 00:07 +0300
                                                                                    Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-28 16:17 -0500
                                                                          Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2021-01-29 00:03 +0300
                                                                        Re: Programming exercise/challenge Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-01-28 03:37 -0800
                                                                        Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-01-28 22:50 +0000
                                                                          Re: Programming exercise/challenge Anton Shepelev <anton.txt@gmail.com> - 2021-01-30 23:14 +0300
                                                                            Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-01-30 20:49 +0000
                                                                    Re: Programming exercise/challenge M Joshua Ryan <luser.droog@gmail.com> - 2021-01-28 00:05 -0600
                                                                  Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-27 11:51 -0800
                                                                Re: Programming exercise/challenge Bart <bc@freeuk.com> - 2021-01-25 17:22 +0000
                                                                Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-25 12:21 -0800
                                                                  Re: Programming exercise/challenge Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-01-25 14:27 -0800
                                                                    Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-25 19:41 -0800
                                                                      Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-26 04:46 +0000
                                                                        Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-26 06:30 -0800
                                                                      Re: Programming exercise/challenge David Brown <david.brown@hesbynett.no> - 2021-01-26 15:46 +0100
                                                                        Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-27 03:43 -0800
                                                                          Re: Programming exercise/challenge David Brown <david.brown@hesbynett.no> - 2021-01-27 13:43 +0100
                                                                            Re: Programming exercise/challenge Anton Shepelev <anton.txt@g{oogle}mail.com> - 2021-01-27 17:51 +0300
                                                                              Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-27 11:02 -0500
                                                                              Re: Programming exercise/challenge David Brown <david.brown@hesbynett.no> - 2021-01-27 17:03 +0100
                                                                            Re: Programming exercise/challenge Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-01-27 07:21 -0800
                                                                              Re: Programming exercise/challenge David Brown <david.brown@hesbynett.no> - 2021-01-27 17:09 +0100
                                                                            Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-27 17:04 +0000
                                                                              Re: Programming exercise/challenge David Brown <david.brown@hesbynett.no> - 2021-01-28 10:41 +0100
                                                                                Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-28 18:25 +0000
                                                                              Re: Programming exercise/challenge David Brown <david.brown@hesbynett.no> - 2021-01-28 10:44 +0100
                                                                                Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-28 21:33 +0000
                                                                                  Re: Programming exercise/challenge David Brown <david.brown@hesbynett.no> - 2021-01-29 10:39 +0100
                                                                  Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-25 23:52 -0500
                                                                  Re: Programming exercise/challenge Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-01-26 11:37 +0000
                                                                Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-27 08:04 -0800
                                                                  Re: Programming exercise/challenge Anton Shepelev <anton.txt@g{oogle}mail.com> - 2021-01-27 19:16 +0300
                                                                    Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-27 23:38 -0800
                                                        Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-27 13:43 -0800
                                                          Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-28 03:16 -0800
                                                            Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-28 06:42 -0500
                                                            Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-28 13:01 -0800
                              Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-06 13:35 -0500
                              Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-06 19:27 +0000
                              Re: Programming exercise/challenge Kaz Kylheku <563-365-8930@kylheku.com> - 2021-01-06 21:25 +0000
                      Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-06 00:37 -0500
                        Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-06 04:34 -0800
                          Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-06 11:54 -0500
                  Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-05 15:28 -0800
              Re: Programming exercise/challenge James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-01-05 13:27 -0500
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-05 15:43 -0800
            Re: Programming exercise/challenge Dave Dunfield <dave.dunfield@gmail.com> - 2021-01-05 20:10 -0800
              Re: Programming exercise/challenge Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-01-06 23:07 -0800

Page 7 of 20 — ← Prev page 1 … 5 6 [7] 8 9 … 20  Next page →


#157173

Fromluser droog <luser.droog@gmail.com>
Date2020-12-09 15:44 -0800
Message-ID<0477879d-b41c-4aed-b72e-281c0cefa1adn@googlegroups.com>
In reply to#157171
On Wednesday, December 9, 2020 at 5:14:34 PM UTC-6, luser droog wrote:
> On Wednesday, December 9, 2020 at 4:30:51 AM UTC-6, Tim Rentsch wrote: 
> > luser droog <luser...@gmail.com> writes: 
> > 
> > [...] 
> > > Version 3. I think it actually fulfills the problem statement now. It removes 
> > > line continuations, but counts them and stashes the number in the node 
> > > immediately following. Then another pass at the end uses the counts to 
> > > restore any that survived comment removal. And I added a garbage collector. 
> > > [...] 
> > 
> > Problem 1: no #include <stddef.h> 
> > 
> > droog-3.c: In function 'mark': 
> > droog-3.c:43:37: error: implicit declaration of function 'offsetof' [-Wimplicit-function-declaration] 
> > 
> > Problem 2: after adding #include <stddef.h> - suspicious code 
> > 
> > droog-3.c: In function 'new_': 
> > droog-3.c:82:11: warning: function may return address of local variable [-Wreturn-local-addr] 
> > 
> > Problem 3: segmentation fault
> Well, dang. Yep around line 82 does look funny. I couldn't reproduce the segfault. 
> 
> Here's my Version 4. I removed the lazy evaluation but kept the garbage collector. 
> Saved about 50 lines and it produces less garbage! I've tested with my tests and with 
> krx123tp.c on cygwin and red hat. 
> 
> 
> //strpcom-v5.c: 
<snip>
> object add_global_root( object o ){ 
> global_roots = cons( o, global_roots ); return o; 
> } 

If I modify this function to just "return  o;" and ...

<snip>
> int main( int argc, char **argv ){
> list input = chars_from_file( argc > 1 ? fopen( argv[1], "r" ) : stdin ); 
> DEBUG( printf( "input:\n"); print( input ); ) 
> list logical = logical_lines( input ); 
> DEBUG( printf( "logical:\n"); print( logical ); ) 
> list stripped = strip_comments( logical ); 
> DEBUG( printf( "stripped:\n"); print( stripped ); ) 
> list restored = restore_continues( stripped ); 
> DEBUG( printf( "restored:\n"); ) 
> print( restored ); 
> DEBUG( printf( "@%d\n", collect( restored ) ); ) 
> }

modify main() to collect everything and delete pointers, ...

int main( int argc, char **argv ){
  list input = chars_from_file( argc > 1 ? fopen( argv[1], "r" )  : stdin );
  DEBUG( printf( "input:\n"); print( input ); )
  list logical = logical_lines( input );
  DEBUG( printf( "logical:\n"); print( logical ); )
  list stripped = strip_comments( logical );
  DEBUG( printf( "stripped:\n"); print( stripped ); )
  list restored = restore_continues( stripped );
  DEBUG( printf( "restored:\n"); )
  print( restored );
  //DEBUG(
    printf( "@%d\n", collect( restored ) );
    printf( "@%d\n", collect( NULL ) );
    input = logical = stripped = restored = NULL;
  //)
}

Then, I'm getting a clean bill of health from valgrind running it on < krx123tp.c. 

@7758
@1778
==17939==
==17939== HEAP SUMMARY:
==17939==     in use at exit: 0 bytes in 0 blocks
==17939==   total heap usage: 9,536 allocs, 9,536 frees, 381,440 bytes allocated
==17939==
==17939== All heap blocks were freed -- no leaks are possible
==17939==
==17939== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

[toc] | [prev] | [next] | [standalone]


#157229

FromAnton Shepelev <anton.txt@gmail.com>
Date2020-12-12 23:56 +0300
Message-ID<20201212235625.2ed00d1287b1d48b52d9a68c@gmail.com>
In reply to#157171
luser droog:

> Here's my Version 4.

On one of my tests it chokes the only CPU core in my PC
until I kill it. Try it yourself with the following input
between the `---' markers:

---
a/\
\
\
\
/b
---

-- 
()  ascii ribbon campaign -- against html e-mail
/\  http://preview.tinyurl.com/qcy6mjc [archived]

[toc] | [prev] | [next] | [standalone]


#157234

Fromluser droog <luser.droog@gmail.com>
Date2020-12-12 13:29 -0800
Message-ID<f215c2f7-e1e3-4ed4-a573-7904ba473673n@googlegroups.com>
In reply to#157229
On Saturday, December 12, 2020 at 2:56:40 PM UTC-6, Anton Shepelev wrote:
> luser droog:
> > Here's my Version 4.
> On one of my tests it chokes the only CPU core in my PC 
> until I kill it. Try it yourself with the following input 
> between the `---' markers: 
> 
> --- 
> a/\ 
> \ 
> \ 
> \ 
> /b 
> ---

Weird. I can't reproduce that. What compiler are you using?
 If I enable the debugging macro, I get

./strpcom-v5 < test3
input:
a/\
\
\
\
/b
[a/][/\][\
]@[\
]@[\
]@[\
]@[/b][b
][
\377]logical:
a//b
<a/><//>@<
\377>stripped:
a
restored:
a
@31

Which seems correct.

[toc] | [prev] | [next] | [standalone]


#157238

FromAnton Shepelev <anton.txt@gmail.com>
Date2020-12-13 00:46 +0300
Message-ID<20201213004646.5f89274c62e230bab4b4b412@gmail.com>
In reply to#157234
luser droog to Anton Shepelev:

> > On one of my tests it chokes the only CPU core in my PC
> > until I kill it. Try it yourself with the following
> > input between the `---' markers:
> >
> > ---
> > a/\
> > \
> > \
> > \
> > /b
> > ---
> >
> Weird. I can't reproduce that. What compiler are you
> using?

Tiny C compiler 0.9.27.

> If I enable the debugging macro, I get
>
> \&./strpcom-v5 < test3
> input:
> a/\
> \
> \
> \
> /b
> [a/][/\][\
> ]@[\
> ]@[\
> ]@[\
> ]@[/b][b
> ][
> \377]logical:
> a//b
> <a/><//>@<
> \377>stripped:
> a
> restored:
> a
> @31
>
> Which seems correct.

And I get:

a/\
\
\
\
/b[a/][/\][\
]@[\
]@[\
]@[\
]@[/b][b ]logical:
a//b<a/><//>@

and then it stops printing and starts heating my CPU.  I will
try to find a later version of TCC and try again.


-- 
()  ascii ribbon campaign -- against html e-mail
/\  http://preview.tinyurl.com/qcy6mjc [archived]

[toc] | [prev] | [next] | [standalone]


#157240

Fromluser droog <luser.droog@gmail.com>
Date2020-12-12 13:59 -0800
Message-ID<669a1321-368a-4526-b923-e044961adbf9n@googlegroups.com>
In reply to#157238
On Saturday, December 12, 2020 at 3:46:59 PM UTC-6, Anton Shepelev wrote:
> luser droog to Anton Shepelev:
> > > On one of my tests it chokes the only CPU core in my PC 
> > > until I kill it. Try it yourself with the following 
> > > input between the `---' markers: 
> > > 
> > > --- 
> > > a/\ 
> > > \ 
> > > \ 
> > > \ 
> > > /b 
> > > --- 
> > > 
> > Weird. I can't reproduce that. What compiler are you 
> > using?
> Tiny C compiler 0.9.27.
> > If I enable the debugging macro, I get 
> >
> > \&./strpcom-v5 < test3
> > input: 
> > a/\ 
> > \ 
> > \ 
> > \ 
> > /b 
> > [a/][/\][\ 
> > ]@[\ 
> > ]@[\ 
> > ]@[\ 
> > ]@[/b][b 
> > ][ 
> > \377]logical: 
> > a//b 
> > <a/><//>@< 
> > \377>stripped: 
> > a 
> > restored: 
> > a 
> > @31 
> > 
> > Which seems correct.
> And I get:
> a/\ 
> \ 
> \ 
> \ 
> /b[a/][/\][\ 
> ]@[\ 
> ]@[\ 
> ]@[\
> ]@[/b][b ]logical: 
> a//b<a/><//>@ 
> 
> and then it stops printing and starts heating my CPU. I will 
> try to find a later version of TCC and try again.

Thanks. It must be stuck in this do-loop just after printing the '@'.

list strip_comments( list o ){
  static list single, multi;
  if(  !single  ) single = add_global_root( cons( Int('/'), one(Int('/')) ), &single );
  if(  !multi   ) multi = add_global_root( cons( Int('/'), one(Int('*')) ), &multi );

  object matched, tail;
  DEBUG( if(car(o)->Int.i!=EOF)
          fprintf(stderr,"<%c%c>", car(o)->Int.i, car(cdr(o))->Int.i); )
  if(  match( single, o, &matched, &tail )  ){
    DEBUG( fprintf( stderr, "@" ); )
    do {
      tail = cdr( tail );
      matched = car( tail );
    } while(  !eqint( matched, '\n' )  );
    return  strip_comments( tail );
  } 

Maybe I need to check for EOF or the end of the list there. If car or cdr start
returning NULL, then that loop won't ever stop. The loop itself also looks fishy
If tail is the list starting after the second slash, then it looks like it drops
the first character before starting to look at them.

[toc] | [prev] | [next] | [standalone]


#157251

FromAnton Shepelev <anton.txt@gmail.com>
Date2020-12-13 14:17 +0300
Message-ID<20201213141727.288df3589354d05a3e03b53d@gmail.com>
In reply to#157234
luser droog to Anton Shepelev:

> > On one of my tests it chokes the only CPU core in my PC
> > until I kill it. Try it yourself with the following
> > input between the `---' markers:
> >
> > ---
> > a/\
> > \
> > \
> > \
> > /b
> > ---
> >
> Weird. I can't reproduce that. What compiler are you
> using?

Tiny C compiler 0.9.27, and the latest TCC brings no
improvement, but I can't reproduce the error with GCC.  Now
that I see your program is not pure C90, maybe TCC is not
required to compile it correctly?

-- 
()  ascii ribbon campaign -- against html e-mail
/\  http://preview.tinyurl.com/qcy6mjc [archived]

[toc] | [prev] | [next] | [standalone]


#157255

Fromluser droog <luser.droog@gmail.com>
Date2020-12-13 12:58 -0800
Message-ID<b658df49-017f-431a-81ff-7c0fdc84e5b6n@googlegroups.com>
In reply to#157251
On Sunday, December 13, 2020 at 5:17:43 AM UTC-6, Anton Shepelev wrote:
> luser droog to Anton Shepelev:
> > > On one of my tests it chokes the only CPU core in my PC 
> > > until I kill it. Try it yourself with the following 
> > > input between the `---' markers: 
> > > 
> > > --- 
> > > a/\ 
> > > \ 
> > > \ 
> > > \ 
> > > /b 
> > > --- 
> > > 
> > Weird. I can't reproduce that. What compiler are you 
> > using?
> Tiny C compiler 0.9.27, and the latest TCC brings no 
> improvement, but I can't reproduce the error with GCC. Now 
> that I see your program is not pure C90, maybe TCC is not 
> required to compile it correctly?

Thanks for the effort. Yes, my code is C99, but I don't think that
accounts for the difference in behavior. Aside from the implicit
'return 0;' in main(), I think I'm just using syntax sugar from C99
so if it compiles, the program ought to be correct. The fact that
the program isn't behaving correctly is a real bug that is my own 
fault. My guess is the stream doesn't contain a newline after 
the 'b'. So my 'do' loop is just wrong. Or to be more generous,
my Version 4 is implementation dependent and not very portable.

So, here's my Version 5. The numbering finally matches up to my
filename numbering. I replaced the fishy 'do' loop with a 'while' 
loop and tried to take extra care not to run off the end of the linked list.
I also modified the GC so it can zero out the static pointers used
by the functions.


//strpcom-v5.c:
//$ make strpcom-v5 CFLAGS='-std=c99 -Wall -pedantic -Wextra -Wno-switch'
//#define DEBUG(...) __VA_ARGS__
#define DEBUG(...)
#define HANDLE_ROOTS(...) __VA_ARGS__
//#define HANDLE_ROOTS(...)
//#define FINAL_GC(...) __VA_ARGS__
#define FINAL_GC(...)

#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef union uobject *object;
typedef object list;
typedef enum tag { INVALID, INTEGER, LIST } tag;

union uobject { tag t;
       struct { tag t; int i, continues; } Int;
       struct { tag t; object a, b; } List;
};

typedef struct record {
  int mark;
  struct record *prev;
  object *handle;
  union uobject o;
} record;


list cons( object a, object b );
list skip_quote( object q, list o );
list nested_comment( list o );
void print( list o );


record *allocation_list;
object global_roots;
object add_global_root( object o, object *op ){
  HANDLE_ROOTS(
                global_roots = cons( o, global_roots );
		record *r = ((void*)( (char*)o - offsetof( record, o ) ) );
		r->handle = op;
              )
  return  o;
}
record *alloc(){
  return  calloc( 1, sizeof(record) );
}
void mark( object ob ){
  if(  !ob  ) return;
  record *r = ((void*)( (char*)ob - offsetof( record, o ) ) );
  if(  r->mark  ) return;
  r->mark = 1;
  switch(  ob  ? ob->t  : 0  ){
    case LIST: mark( ob->List.a ); mark( ob->List.b ); break;
  }
}
int sweep( record **ptr ){
  int count = 0;
  while(  *ptr  ){
    if(  (*ptr)->mark  ){
      (*ptr)->mark = 0;
      ptr = &(*ptr)->prev;
    } else {
      record *z = *ptr;
      if(  z->handle  ) *z->handle = NULL;
      *ptr = (*ptr)->prev;
      free( z );
      ++count;
    }
  }
  return  count;
}
int collect( object local_roots ){
  mark( local_roots );
  mark( global_roots );
  return  sweep( &allocation_list );
}

#define OBJECT(...) new_( (union uobject[]){{ __VA_ARGS__ }} )
object new_( object a ){
  record *r = alloc();
  object p = NULL;
  if(  r  ){
    r->prev = allocation_list;
    allocation_list = r;
    p = (void*)( ((char*)r) + offsetof( record, o ) );
    *p = *a;
  }
  return  p;
}

object Int( int i ){ return  OBJECT( .Int = { INTEGER, i } ); }
list cons( object a, object b ){ return  OBJECT( .List = { LIST, a, b } ); }
list one( object a ){ return  cons( a, NULL ); }
object car( list o ){ return  o  && o->t == LIST  ? o->List.a  : NULL; }
object cdr( list o ){ return  o  && o->t == LIST  ? o->List.b  : NULL; }

int eq( object a, object b ){
  return  !a && !b                    ? 1  :
          !a || !b                    ? 0  :
          a->t != b->t                ? 0  :
          a->t == INTEGER  ? a->Int.i == b->Int.i
                           : !memcmp( a, b, sizeof *a );
}

int eqint( object a, int i ){
  union uobject b = { .Int = { INTEGER, i } };
  return  eq( a, &b );
}

int match( object pat, object it, object *matched, object *tail ){
  if(  !pat  ){
    return  *tail = it,  1;
  }
  if(  pat->t != (it  ? it->t  : 0)  ) return  0;
  switch(  pat->t  ){
    case LIST:
      {
        object sink;
        if(  match( car( pat ), car( it ), & sink, tail )  ){
          return  *matched = it,  match( cdr( pat ), cdr( it ), & sink, tail );
        } 
      } break;
    case INTEGER:
      if(  eq( pat, it )  ){
        return  *matched = it,  1;
      } 
  }
  return  0;
}

list chars_from_file( FILE *f ){
  int c = fgetc( f );
  return  c != EOF  ? cons( Int( c ), chars_from_file( f ) )  : one( Int( c ) );
}

list logical_lines( list o ){
  static list pat;
  if(  !pat  )
    pat = add_global_root( cons( Int( '\\' ), one( Int( '\n' ) ) ), &pat );

  object matched, tail;
  DEBUG( if( car(o)->Int.i!=EOF )
         fprintf( stderr, "[%c%c]", car(o)->Int.i, car(cdr(o))->Int.i ); )
  if(  match( pat, o, &matched, &tail )  ){
    DEBUG( fprintf( stderr, "@" ); )
    car( tail )->Int.continues = car( o )->Int.continues + 1;
    return  logical_lines( tail );
  } else {
    object a = car( o );
    return  eqint( a, EOF )  ? o  : cons( a, logical_lines( cdr( o ) ) );
  }
}

list restore_continues( list o ){
  if(  !o  ) return  NULL;
  object a = car( o );
  if(  eqint( a, EOF )  ) return  o;
  object z = cdr( o );
  object r = cons( a, restore_continues( z ) );
  while(  a->Int.continues  ){
    r = cons( Int( '\\' ), cons( Int( '\n' ), r ) );
    --a->Int.continues;
  }
  return  r;
}

list strip_comments( list o ){
  static list single, multi;
  if(  !single  )
    single = add_global_root( cons( Int('/'), one(Int('/') ) ), &single );
  if(  !multi   )
    multi = add_global_root( cons( Int('/'), one(Int('*') ) ), &multi );

  object matched, tail;
  DEBUG( if(  car(o)->Int.i != EOF  )
          fprintf( stderr, "<%c%c>", car(o)->Int.i, car(cdr(o))->Int.i ); )
  if(  match( single, o, &matched, &tail )  ){
    DEBUG( fprintf( stderr, "@" ); )
    matched = car( tail );
    while(  tail && !eqint( matched, '\n' ) && !eqint( matched, EOF )  ){
      tail = cdr( tail );
      matched = car( tail );
    }
    if(  eqint( matched, '\n' )  ) tail = cdr( tail );  //Don't eat EOF
    return  strip_comments( tail );
  } else if(  match( multi, o, &matched, &tail )  ){
    DEBUG( fprintf( stderr, "@" ); )
    return  cons( Int( ' ' ),
                  strip_comments( nested_comment( cdr( tail ) ) ) );
  }

  object a = car( o );
  if(  eqint( a, '\'' ) || eqint( a, '"' )  )
    return  cons( a, skip_quote( a, cdr( o ) ) );
  return  eqint( a, EOF )  ? o
                           : cons( a, strip_comments( cdr( o ) ) );
}

list nested_comment( list o ){
  DEBUG( fprintf( stderr, "(%c%c)", car( o )->Int.i, car( cdr( o ) )->Int.i ); )
  static list end;
  if(  !end  )
    end = add_global_root( cons( Int( '*' ), one( Int( '/' ) ) ), &end ); 

  object matched, tail;
  if(  match( end, o, &matched, &tail )  )
    return  tail;
  if(  eqint( car( o ), EOF )  )
    fprintf( stderr, "Unterminated comment\n"),
    exit( 1 );
  return  nested_comment( cdr( o ) );
}

list skip_quote( object q, list o ){
  object a = car( o );
  if(  eqint( a, '\\' )  ){
    return  cons( a, cons( car( cdr( o ) ),
                           skip_quote( q, cdr( cdr( o ) ) ) ) );
  } else if(  eq( a, q )  ){
    return  cons( a, strip_comments( cdr( o ) ) );
  }
  if(  eqint( a, EOF )  )
    fprintf( stderr, "Unterminated literal\n"),
    exit( 1 );
  return  cons( a, skip_quote( q, cdr( o ) ) );
}

void print( list o ){
  switch(  o  ? o->t  : 0  ){
    case INTEGER: if(  o->Int.i != EOF  ) fputc( o->Int.i, stdout );
                  break;
    case LIST: print( car( o ) );
               print( cdr( o ) ); break;
  }
}


int main( int argc, char **argv ){
  list input = chars_from_file( argc > 1 ? fopen( argv[1], "r" )  : stdin );
  DEBUG( printf( "input:\n"); print( input ); )
  list logical = logical_lines( input );
  DEBUG( printf( "logical:\n"); print( logical ); )
  list stripped = strip_comments( logical );
  DEBUG( printf( "stripped:\n"); print( stripped ); )
  list restored = restore_continues( stripped );
  DEBUG( printf( "restored:\n"); )
  print( restored );
  DEBUG( printf( "@%d\n", collect( restored ) ); )
  FINAL_GC(
	 HANDLE_ROOTS( global_roots = NULL; )
         printf( "@%d\n", collect( NULL ) );
         input = logical = stripped = restored = NULL;
         )
}

[toc] | [prev] | [next] | [standalone]


#157259

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2020-12-13 20:57 -0800
Message-ID<86r1ntyog3.fsf@linuxsc.com>
In reply to#157255
luser droog <luser.droog@gmail.com> writes:

[...]

> So, here's my Version 5.  [...]
>
> //strpcom-v5.c:
> //$ make strpcom-v5 CFLAGS='-std=c99 -Wall -pedantic -Wextra -Wno-switch'
> //#define DEBUG(...) __VA_ARGS__
> #define DEBUG(...)
> [...]

I'd appreciate it if you would get rid of the DEBUG() macro
and find another way of enabling snippets of debugging
code that doesn't use the C preprocessor (except perhaps
for initializing a controlling variable, eg

    #ifndef DEBUG_LEVEL
    #define DEBUG_LEVEL 0
    #endif
    static const int debug = DEBUG_LEVEL;

and then test 'debug' later in the code using regular
language statements).

Also, try this test case

    (echo foo // blah ; echo bas) | your-executable

The output I expect has two lines.

[toc] | [prev] | [next] | [standalone]


#157276

Fromluser droog <luser.droog@gmail.com>
Date2020-12-14 20:44 -0800
Message-ID<dbfd87b8-f5e2-4f9d-9b72-a779eed9bb91n@googlegroups.com>
In reply to#157259
On Sunday, December 13, 2020 at 10:57:48 PM UTC-6, Tim Rentsch wrote:
> luser droog <luser...@gmail.com> writes: 
> 
> [...] 
> 
> > So, here's my Version 5. [...]
> > 
> > //strpcom-v5.c: 
> > //$ make strpcom-v5 CFLAGS='-std=c99 -Wall -pedantic -Wextra -Wno-switch' 
> > //#define DEBUG(...) __VA_ARGS__ 
> > #define DEBUG(...)
> > [...] 
> 
> I'd appreciate it if you would get rid of the DEBUG() macro 
> and find another way of enabling snippets of debugging 
> code that doesn't use the C preprocessor (except perhaps 
> for initializing a controlling variable, eg 
> 
> #ifndef DEBUG_LEVEL 
> #define DEBUG_LEVEL 0 
> #endif 
> static const int debug = DEBUG_LEVEL; 
> 
> and then test 'debug' later in the code using regular 
> language statements). 
> 
> Also, try this test case 
> 
> (echo foo // blah ; echo bas) | your-executable 
> 
> The output I expect has two lines.

Thanks. I'm working on it. I have these problem fixed (don't eat the newline
either). I'm working through the rest of the test cases from you and Anton.

This one currently triggers a segfault:

== '\<EOF>

[toc] | [prev] | [next] | [standalone]


#157660

Fromluser droog <luser.droog@gmail.com>
Date2020-12-23 11:15 -0800
Message-ID<64347a0c-73cc-4132-bba8-9b87da46888bn@googlegroups.com>
In reply to#157276
On Monday, December 14, 2020 at 10:44:29 PM UTC-6, luser droog wrote:
> On Sunday, December 13, 2020 at 10:57:48 PM UTC-6, Tim Rentsch wrote: 
> > luser droog <luser...@gmail.com> writes: 
> > 
> > [...] 
> > 
> > > So, here's my Version 5. [...] 
> > > 
> > > //strpcom-v5.c: 
> > > //$ make strpcom-v5 CFLAGS='-std=c99 -Wall -pedantic -Wextra -Wno-switch' 
> > > //#define DEBUG(...) __VA_ARGS__ 
> > > #define DEBUG(...) 
> > > [...] 
> > 
> > I'd appreciate it if you would get rid of the DEBUG() macro 
> > and find another way of enabling snippets of debugging 
> > code that doesn't use the C preprocessor (except perhaps 
> > for initializing a controlling variable, eg 
> > 
> > #ifndef DEBUG_LEVEL 
> > #define DEBUG_LEVEL 0 
> > #endif 
> > static const int debug = DEBUG_LEVEL; 
> > 
> > and then test 'debug' later in the code using regular 
> > language statements). 
> > 
> > Also, try this test case 
> > 
> > (echo foo // blah ; echo bas) | your-executable 
> > 
> > The output I expect has two lines.
> Thanks. I'm working on it. I have these problem fixed (don't eat the newline 
> either). I'm working through the rest of the test cases from you and Anton. 
> 
> This one currently triggers a segfault: 
> 
> == '\<EOF>

Made some progress (delayed by finals week). I organized all of Tim and Anton's 
test cases into a script:

if [ $# = 0 ]; then
  prog=./strpcom-v5
else
  prog=./$1
fi

$prog <test1 | diff - test1.out
$prog <test2 | diff - test2.out
$prog <test3 | diff - test3.out

function t {
echo -n "${2@Q}"
echo ---
echo -n "${2}" | $prog >output.$$ 2>&1
out=$(<output.$$)
if [ "${out}" != "${3}" ]; then
  echo case $1 failed
  echo "echo \"$2\" | $prog" != "\"$3\""
  echo -n "$3" | xxd
  echo -n "${out}" | xxd
fi
}

t 1 "''" "''"

t 2 "'z'" "'z'"

t 3 "\"" "Unterminated literal"

t 4 "'z'
" "'z'
"

t 5 "'
" "Unterminated literal"

t 6 "'" "Unterminated literal"

t 7 "'\a'
" "'\a'
"

t 8 "'\\
'" "'\\
'"

t 9 "'\\
z'" "'\\
z'"

t 10 "'\\" "Unterminated literal"

t 11 "'\\\\
a'" "'\\\\
a'"

t 12 "'\\\\" "Unterminated literal"

t 13 "'\\\\'" "'\\\\'"

t 14 "'\\\\z'" "'\\\\z'"

t 15 "'\\\\\\a'" "'\\\\\\a'"

t 16 "'\\\\

yyy'" "'\\\\

yyy'"

t 17 "'\\\\
\\'" "'\\\\
\\'"

t 18 '""' '""'

t 19 '"z"' '"z"'

t 20 '"
' "Unterminated literal"

t 21 '"' "Unterminated literal"

t 22 "\"\a\"" "\"\a\""

t 23 "\"\\
\"" "\"\\
\""

t 24 "\"\\
z\"" "\"\\
z\""

t 25 "\"\\" "Unterminated literal"

t 26 "\"\\\\
a\"" "\"\\\\
a\""

t 27 "\"\\\\" "Unterminated literal"

t 28 '"\\"' '"\\"'

t 29 '"\\z"' '"\\z"'

t 30 '"\\\a"' '"\\\a"'

t 31 '"\\

yyy"' '"\\

yyy"'

t 32 '"\\
\"' '"\\
\"'

t 33 '/' '/'

t 34 '/\' '/\'

t 35 '//' ''

t 36 '//\' ''

t 37 '//\
' ''

t 38 /z /z

t 39 '/\
z' '/\
z'

t 40 '/\
\
z' '/\
\
z'

t 41 '//z' ''

t 42 '/\
/z' ''

t 43 '/\
/\
z' ''

t 44 '//\\
z' ''

t 45 '//\\z' ''

t 46 '/*' 'Unterminated comment'

t 47 '/*\' 'Unterminated comment'

t 48 '/*\
' 'Unterminated comment'

t 49 '/**' 'Unterminated comment'

t 50 '/**\' 'Unterminated comment'

t 51 '/**\
' 'Unterminated comment'

t 52 '/\
*z*/' ' '

t 53 '/\
***/' ' '

t 54 '/\
*\\
*/' ' '

t 55 '/*z*/' ' '

t 56 '/***\
/' ' '

t 57 '/***\*\
/' ' '

t a1 '' ''

t a2 '
' '
'

t a3 '/' '/'

t a4 "\\" "\\"

t a5 "\\
\\" "\\
\\"

t a6 '\
\
' '\
\
'

t a7 '\
\
/\
\
\

' '\
\
/\
\
\

'

t a8 '\
\
/\
\
\
/\
a
' '
'

t a9 '\
\
/\
\
\
a
' '\
\
/\
\
\
a
'

t a10 'a/\
\
\
\
b
' '
'

t a11 'a/\
\
\
\
/b
' 'a
'

rm output.$$
exit


And I fixed all my crashing issues (I hope) but I'm still having a problem that
it likes to eat all the trailing newlines.

My output from testing:

./test
''\'''\'''---
''\''z'\'''---
'"'---
$'\'z\'\n'---
case 4 failed
echo "'z'
" | ./strpcom-v5 != "'z'
"
00000000: 277a 270a                                'z'.
00000000: 277a 27                                  'z'
$'\'\n'---
\'---
$'\'\\a\'\n'---
case 7 failed
echo "'\a'
" | ./strpcom-v5 != "'\a'
"
00000000: 275c 6127 0a                             '\a'.
00000000: 275c 6127                                '\a'
$'\'\\\n\''---
$'\'\\\nz\''---
''\''\'---
$'\'\\\\\na\''---
''\''\\'---
''\''\\'\'''---
''\''\\z'\'''---
''\''\\\a'\'''---
$'\'\\\\\n\nyyy\''---
$'\'\\\\\n\\\''---
'""'---
'"z"'---
$'"\n'---
'"'---
'"\a"'---
$'"\\\n"'---
$'"\\\nz"'---
'"\'---
$'"\\\\\na"'---
'"\\'---
'"\\"'---
'"\\z"'---
'"\\\a"'---
$'"\\\\\n\nyyy"'---
$'"\\\\\n\\"'---
'/'---
'/\'---
'//'---
'//\'---
$'//\\\n'---
'/z'---
$'/\\\nz'---
$'/\\\n\\\nz'---
'//z'---
$'/\\\n/z'---
$'/\\\n/\\\nz'---
$'//\\\\\nz'---
'//\\z'---
'/*'---
'/*\'---
$'/*\\\n'---
'/**'---
'/**\'---
$'/**\\\n'---
$'/\\\n*z*/'---
$'/\\\n***/'---
$'/\\\n*\\\\\n*/'---
'/*z*/'---
$'/***\\\n/'---
$'/***\\*\\\n/'---
''---
$'\n'---
case a2 failed
echo "
" | ./strpcom-v5 != "
"
00000000: 0a                                       .
'/'---
'\'---
$'\\\n\\'---
$'\\\n\\\n'---
case a6 failed
echo "\
\
" | ./strpcom-v5 != "\
\
"
00000000: 5c0a 5c0a                                \.\.
$'\\\n\\\n/\\\n\\\n\\\n\n'---
case a7 failed
echo "\
\
/\
\
\

" | ./strpcom-v5 != "\
\
/\
\
\

"
00000000: 5c0a 5c0a 2f5c 0a5c 0a5c 0a0a            \.\./\.\.\..
00000000: 5c0a 5c0a 2f5c 0a5c 0a5c                 \.\./\.\.\
$'\\\n\\\n/\\\n\\\n\\\n/\\\na\n'---
case a8 failed
echo "\
\
/\
\
\
/\
a
" | ./strpcom-v5 != "
"
00000000: 0a                                       .
$'\\\n\\\n/\\\n\\\n\\\na\n'---
case a9 failed
echo "\
\
/\
\
\
a
" | ./strpcom-v5 != "\
\
/\
\
\
a
"
00000000: 5c0a 5c0a 2f5c 0a5c 0a5c 0a61 0a         \.\./\.\.\.a.
00000000: 5c0a 5c0a 2f5c 0a5c 0a5c 0a61            \.\./\.\.\.a
$'a/\\\n\\\n\\\n\\\nb\n'---
case a10 failed
echo "a/\
\
\
\
b
" | ./strpcom-v5 != "
"
00000000: 0a                                       .
00000000: 612f 5c0a 5c0a 5c0a 5c0a 62              a/\.\.\.\.b
$'a/\\\n\\\n\\\n\\\n/b\n'---
case a11 failed
echo "a/\
\
\
\
/b
" | ./strpcom-v5 != "a
"
00000000: 610a                                     a.
00000000: 61                                       a

The work proceeds.
End of usenet message

[toc] | [prev] | [next] | [standalone]


#157663

FromAnton Shepelev <anton.txt@gmail.com>
Date2020-12-23 23:45 +0300
Message-ID<20201223234502.e7f2917dc9c2b63cfe8e989f@gmail.com>
In reply to#157660
luser droog:

> Made some progress (delayed by finals week). I organized
> all of Tim and Anton's test cases into a script:

Glad to see you working on it. I see some test cases with
unterminated comments and literals. Do you think a program
should report them? I though it was the natural task of the
compiler, but I think I can extend my program to handle
them.

-- 
()  ascii ribbon campaign -- against html e-mail
/\  http://preview.tinyurl.com/qcy6mjc [archived]

[toc] | [prev] | [next] | [standalone]


#157677

Fromluser droog <luser.droog@gmail.com>
Date2020-12-23 21:36 -0800
Message-ID<7f956966-7715-48c4-8451-efb2009caf1cn@googlegroups.com>
In reply to#157663
On Wednesday, December 23, 2020 at 2:45:17 PM UTC-6, Anton Shepelev wrote:
> luser droog:
> > Made some progress (delayed by finals week). I organized 
> > all of Tim and Anton's test cases into a script:
> Glad to see you working on it. I see some test cases with 
> unterminated comments and literals. Do you think a program 
> should report them? I though it was the natural task of the 
> compiler, but I think I can extend my program to handle 
> them.

Seems like a good idea to me, but I think it's not a strict requirement.

From the OP by Tim Rentsch:
>  If EOF is seen inside a
comment, do something sensible but it doesn't matter what as long
as it's sensible.

Consequently, it's not a universal testing script for all submissions. It will
need to be tailored to suit the choices made on this and other edge cases.

[toc] | [prev] | [next] | [standalone]


#157697

Fromluser droog <luser.droog@gmail.com>
Date2020-12-24 09:11 -0800
Message-ID<8d21c038-b765-4d2e-adc2-7fa9e7830d19n@googlegroups.com>
In reply to#157677
On Wednesday, December 23, 2020 at 11:37:09 PM UTC-6, luser droog wrote:
> On Wednesday, December 23, 2020 at 2:45:17 PM UTC-6, Anton Shepelev wrote: 
> > luser droog: 
> > > Made some progress (delayed by finals week). I organized 
> > > all of Tim and Anton's test cases into a script: 
> > Glad to see you working on it. I see some test cases with 
> > unterminated comments and literals. Do you think a program 
> > should report them? I though it was the natural task of the 
> > compiler, but I think I can extend my program to handle 
> > them.
> Seems like a good idea to me, but I think it's not a strict requirement. 
> 
> From the OP by Tim Rentsch:
> > If EOF is seen inside a 
> comment, do something sensible but it doesn't matter what as long 
> as it's sensible.
> Consequently, it's not a universal testing script for all submissions. It will 
> need to be tailored to suit the choices made on this and other edge cases.

I think the script may have other issues, too. I can't reproduce the missing
trailing newlines that it's reporting. When I type in the test case I'm seeing
newlines in the proper place. So I think this one's good now. But of
course the number of revisions I've had to do leave me less than 100% 
confident still. A lot of the functions feel longwinded but I'm not seeing
where to trim or factor them nicely at the moment.

Version 6:

//strpcom-v5.c:
//$ make strpcom-v5 CFLAGS='-std=c99 -Wall -pedantic -Wextra -Wno-switch'

#ifndef DEBUG_LEVEL
#define DEBUG_LEVEL 0
#endif
static const int debug_level = DEBUG_LEVEL;
static const int handle_roots = 1;


#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


typedef union uobject *object;
typedef object list;
typedef enum tag { INVALID, INTEGER, LIST } tag;
#define OBJECT(...) new_( (union uobject[]){{ __VA_ARGS__ }} )

union uobject { tag t;
       struct { tag t; int i, continues; } Int;
       struct { tag t; object a, b; } List;
};

typedef struct record {
  int mark;
  struct record *prev;
  object *handle;
  union uobject o;
} record;


record *allocation_list;
object global_roots;

static list     chars_from_file( FILE *f );
static list     logical_lines( list o );
static list     restore_continues( list o );
static list     strip_comments( list o );
static list     skip_quote( object q, list o );
static list     nested_comment( list o );
static void     print( list o );

static object   Int( int i );
static list     cons( object a, object b );
static list     one( object a );
static object   car( list o );
static object   cdr( list o );
static int      eq( object a, object b );
static int      eqint( object a, int i );
static int      match( object pat, object it, object *matched, object *tail );

static object   add_global_root( object o, object *op );
static int      collect( object local_roots );
static void       mark( object ob );
static int        sweep( record **ptr );
static record *   alloc();
static object   new_( object a );


int
main( int argc, char **argv ){
  list input = chars_from_file( argc > 1 ? fopen( argv[1], "r" )  : stdin );
  if(  debug_level >= 2  ) printf( "input:\n"), print( input );

  list logical = logical_lines( input );
  if(  debug_level >= 2  ) printf( "logical:\n"), print( logical );

  list stripped = strip_comments( logical );
  if(  debug_level >= 2  ) printf( "stripped:\n"), print( stripped );

  list restored = restore_continues( stripped );
  if(  debug_level >= 2  ) printf( "restored:\n");

  print( restored );

  if(  debug_level >= 2  ) printf( "@%d\n", collect( restored ) );
  if(  debug_level  ){
    if(  handle_roots  ){ global_roots = NULL; }
    printf( "@%d\n", collect( NULL ) );
    input = logical = stripped = restored = NULL;
  }
}

list
chars_from_file( FILE *f ){
  int c = fgetc( f );
  return  c != EOF  ? cons( Int( c ), chars_from_file( f ) )
                    : one( Int( c ) );
}

list
logical_lines( list o ){
  if(  !o  ) return  NULL;
  static list pat;
  if(  !pat  )
    pat = add_global_root( cons( Int( '\\' ), one( Int( '\n' ) ) ), &pat );

  object matched, tail;
  if(  debug_level >= 2  )
    if( car(o)->Int.i!=EOF )
      fprintf( stderr, "[%c%c]", car(o)->Int.i, car(cdr(o))->Int.i );
  if(  match( pat, o, &matched, &tail )  ){
    if(  debug_level >= 2  ) fprintf( stderr, "@" );
    car( tail )->Int.continues = car( o )->Int.continues + 1;
    return  logical_lines( tail );
  } else {
    object a = car( o );
    return  cons( a, logical_lines( cdr( o ) ) );
  }
}

list
restore_continues( list o ){
  if(  !o  ) return  NULL;
  object a = car( o );
  object z = cdr( o );
  object r = cons( a, restore_continues( z ) );
  while(  a->Int.continues  ){
    r = cons( Int( '\\' ), cons( Int( '\n' ), r ) );
    --a->Int.continues;
  }
  return  r;
}

list
strip_comments( list o ){
  if(  !o  ) return  NULL;
  static list single, multi;
  if(  !single  )
    single = add_global_root( cons( Int('/'), one(Int('/') ) ), &single );
  if(  !multi   )
    multi = add_global_root( cons( Int('/'), one(Int('*') ) ), &multi );

  object matched, tail;
  if(  debug_level >= 2  )
    if(  car(o)->Int.i != EOF  )
      fprintf( stderr, "<%c%c>", car(o)->Int.i, car(cdr(o))->Int.i );
  if(  match( single, o, &matched, &tail )  ){
    if(  debug_level >= 2  ) fprintf( stderr, "@" );
    object c;
    for(  c = car( tail );
          tail && ! (eqint( c, '\n' ) || eqint( c, EOF ));
	  c = car( tail = cdr( tail ) )  )
      ;
    return  cons( Int( '\n' ),
                  strip_comments( cdr( tail ) ) );
  } else if(  match( multi, o, &matched, &tail )  ){
    if(  debug_level >= 2  ) fprintf( stderr, "@" );
    return  cons( Int( ' ' ),
                  strip_comments( nested_comment( cdr( tail ) ) ) );
  }

  object a = car( o );
  if(  eqint( a, '\'' ) || eqint( a, '"' )  )
    return  cons( a, skip_quote( a, cdr( o ) ) );
  return  cons( a, strip_comments( cdr( o ) ) );
}

list
nested_comment( list o ){
  if(  !o  )
    fprintf( stderr, "Unterminated comment\n"),
    exit( 1 );
  if(  debug_level >= 2  )
    fprintf( stderr, "(%c%c)", car( o )->Int.i, car( cdr( o ) )->Int.i );
  static list end;
  if(  !end  )
    end = add_global_root( cons( Int( '*' ), one( Int( '/' ) ) ), &end ); 

  object matched, tail;
  if(  match( end, o, &matched, &tail )  )
    return  tail;
  if(  eqint( car( o ), EOF )  )
    fprintf( stderr, "Unterminated comment\n"),
    exit( 1 );
  return  nested_comment( cdr( o ) );
}

list
skip_quote( object q, list o ){
  if(  !o  )
    fprintf( stderr, "Unterminated literal\n"),
    exit( 1 );
  object a = car( o );
  if(  eqint( a, '\\' )  ){
    return  cons( a, cons( car( cdr( o ) ),
                           skip_quote( q, cdr( cdr( o ) ) ) ) );
  } else if(  eq( a, q )  ){
    return  cons( a, strip_comments( cdr( o ) ) );
  }
  if(  eqint( a, EOF )  )
    fprintf( stderr, "Unterminated literal\n"),
    exit( 1 );
  return  cons( a, skip_quote( q, cdr( o ) ) );
}

void
print( list o ){
  switch(  o  ? o->t  : 0  ){
    case INTEGER: if(  o->Int.i != EOF  ) fputc( o->Int.i, stdout );
                  break;
    case LIST: print( car( o ) );
               print( cdr( o ) ); break;
  }
}


object
Int( int i ){
  return  OBJECT( .Int = { INTEGER, i } );
}

list
cons( object a, object b ){
  return  OBJECT( .List = { LIST, a, b } );
}

list
one( object a ){
  return  cons( a, NULL );
}

object
car( list o ){
  return  o  && o->t == LIST  ? o->List.a  : NULL;
}

object
cdr( list o ){
  return  o  && o->t == LIST  ? o->List.b  : NULL;
}

int
eq( object a, object b ){
  return  !a && !b         ? 1                     :
          !a || !b         ? 0                     :
          a->t != b->t     ? 0                     :
          a->t == INTEGER  ? a->Int.i == b->Int.i  :
          !memcmp( a, b, sizeof *a );
}

int
eqint( object a, int i ){
  union uobject b = { .Int = { INTEGER, i } };
  return  eq( a, &b );
}

int
match( object pat, object it, object *matched, object *tail ){
  if(  !pat  ) return  *tail = it,  1;
  if(  pat->t != (it  ? it->t  : 0)  ) return  0;
  switch(  pat->t  ){
    case LIST:
      {
        object sink;
        if(  match( car( pat ), car( it ), & sink, tail )  ){
          return  *matched = it,
                  match( cdr( pat ), cdr( it ), & sink, tail );
        } 
      } break;
    case INTEGER:
      if(  eq( pat, it )  ){
        return  *matched = it,  1;
      } 
  }
  return  0;
}


object
add_global_root( object o, object *op ){
  if(  handle_roots  ){
    global_roots = cons( o, global_roots );
    record *r = ((void*)( (char*)o - offsetof( record, o ) ) );
    r->handle = op;
  }
  return  o;
}

void
mark( object ob ){
  if(  !ob  ) return;
  record *r = ((void*)( (char*)ob - offsetof( record, o ) ) );
  if(  r->mark  ) return;
  r->mark = 1;
  switch(  ob  ? ob->t  : 0  ){
    case LIST: mark( ob->List.a ); mark( ob->List.b ); break;
  }
}

int
sweep( record **ptr ){
  int count = 0;
  while(  *ptr  ){
    if(  (*ptr)->mark  ){
      (*ptr)->mark = 0;
      ptr = &(*ptr)->prev;
    } else {
      record *z = *ptr;
      if(  z->handle  ) *z->handle = NULL;
      *ptr = (*ptr)->prev;
      free( z );
      ++count;
    }
  }
  return  count;
}

int
collect( object local_roots ){
  mark( local_roots );
  mark( global_roots );
  return  sweep( &allocation_list );
}

record *
alloc(){
  return  calloc( 1, sizeof(record) );
}

object
new_( object a ){
  record *r = alloc();
  object p = NULL;
  if(  r  ){
    r->prev = allocation_list;
    allocation_list = r;
    p = (void*)( ((char*)r) + offsetof( record, o ) );
    *p = *a;
  }
  return  p;
}

[toc] | [prev] | [next] | [standalone]


#157716

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2020-12-24 15:30 -0800
Message-ID<86k0t6ye6v.fsf@linuxsc.com>
In reply to#157697
luser droog <luser.droog@gmail.com> writes:

> On Wednesday, December 23, 2020 at 11:37:09 PM UTC-6, luser droog wrote:
>
>> On Wednesday, December 23, 2020 at 2:45:17 PM UTC-6, Anton Shepelev wrote:
>>
>>> luser droog:
>>>
>>>> Made some progress (delayed by finals week).  I organized
>>>> all of Tim and Anton's test cases into a script:
>>>
> [...] I think this one's good now.  But of course the number of
> revisions I've had to do leave me less than 100% confident still.

I got this latest version, and it definitely looks better
(meaning, based on what the output looks like).  It still has a
small discrepancy compared to what I consider my reference
implementation, but I haven't tracked that down well enough to
have a test case for you.

I see that the debugging stuff is now done with if()'s, thank
you for that.

> A lot of the functions feel longwinded but I'm not seeing where
> to trim or factor them nicely at the moment.

Looking just rather quickly, how about strip_comments() - here
is a sketch:

First split off the initializations of 'single' and 'multi' to
someplace else (eg, main()).  It's inconvenient to have these be
function statics, make them be file-level statics instead.

Then what is left is something like this (please excuse the poor
name choices for the subfunctions):

    return  match( single, o, &matched, &tail )  ?  slsl_val(...)
        :   match( multi, o, &matched, &tail )   ?  slstar_val(...)
        :   starts_literal( car( o ) )           ?  literal_val(...)
        :   cons( a, strip_comments( cdr( o ) ) )
    ;

Of course I haven't compiled anything, just typed this in, but
maybe that gives you enough information so you can take it from
there.

[toc] | [prev] | [next] | [standalone]


#157728

Fromluser droog <luser.droog@gmail.com>
Date2020-12-24 23:18 -0800
Message-ID<5892009f-d600-486c-b93b-2ed2f1a2d001n@googlegroups.com>
In reply to#157716
On Thursday, December 24, 2020 at 5:31:09 PM UTC-6, Tim Rentsch wrote:
> luser droog <luser...@gmail.com> writes: 
> 
> > On Wednesday, December 23, 2020 at 11:37:09 PM UTC-6, luser droog wrote: 
> > 
> >> On Wednesday, December 23, 2020 at 2:45:17 PM UTC-6, Anton Shepelev wrote: 
> >> 
> >>> luser droog: 
> >>> 
> >>>> Made some progress (delayed by finals week). I organized 
> >>>> all of Tim and Anton's test cases into a script: 
> >>>
> > [...] I think this one's good now. But of course the number of
> > revisions I've had to do leave me less than 100% confident still.
> I got this latest version, and it definitely looks better 
> (meaning, based on what the output looks like). It still has a 
> small discrepancy compared to what I consider my reference 
> implementation, but I haven't tracked that down well enough to 
> have a test case for you. 
> 
> I see that the debugging stuff is now done with if()'s, thank 
> you for that.
> > A lot of the functions feel longwinded but I'm not seeing where 
> > to trim or factor them nicely at the moment.
> Looking just rather quickly, how about strip_comments() - here 
> is a sketch: 
> 
> First split off the initializations of 'single' and 'multi' to 
> someplace else (eg, main()). It's inconvenient to have these be 
> function statics, make them be file-level statics instead. 
> 
> Then what is left is something like this (please excuse the poor 
> name choices for the subfunctions): 
> 
> return match( single, o, &matched, &tail ) ? slsl_val(...) 
> : match( multi, o, &matched, &tail ) ? slstar_val(...) 
> : starts_literal( car( o ) ) ? literal_val(...) 
> : cons( a, strip_comments( cdr( o ) ) ) 
> ; 
> 
> Of course I haven't compiled anything, just typed this in, but 
> maybe that gives you enough information so you can take it from 
> there.

Thanks. That did the trick. Flushed out some other fishy bits.
When replacing a single-line comment with a newline it now
takes care to make a fresh object to hold the newline character
to make sure it isn't carrying any hidden line continues.

My test script is still giving false negatives. Using either
out="$(<output.$$)"
or
out="$(cat output.$$)"
all training newlines are disappearing at this point. I make ask for
help in comp.lang.shell.

So here's version 8 I guess. The only long function left is main() which may or
may not be worth messing with. I'm also not 100% thrilled with my 
'restore_continues()' function. There's probably a way to make it tail
recursive and more idiomatic.

//strpcom-v8.c:
//$ make strpcom-v8 CFLAGS='-std=c99 -Wall -pedantic -Wextra -Wno-switch'

#ifndef DEBUG_LEVEL
#define DEBUG_LEVEL 0
#endif
static const int debug_level = DEBUG_LEVEL;
static const int handle_roots = 1;


#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


typedef union uobject *object;
typedef object list;
typedef enum tag { INVALID, INTEGER, LIST } tag;
#define OBJECT(...) new_( (union uobject[]){{ __VA_ARGS__ }} )

union uobject { tag t;
       struct { tag t; int i, continues; } Int;
       struct { tag t; object a, b; } List;
};

typedef struct record {
  int mark;
  struct record *prev;
  object *handle;
  union uobject o;
} record;


static list     chars_from_file( FILE *f );
static list     logical_lines( list o );
static list       trim_continue( list o, list tail );
static list     restore_continues( list o );
static list     strip_comments( list o );
static list       single_remainder( list tail );
static list       multi_remainder( list tail );
static int        starts_literal( object a );
static list       literal_val( object a, list o );
static list     skip_quote( object q, list o );
static list     nested_comment( list o );
static void     print( list o, FILE *f );

static object   Int( int i );
static list     cons( object a, object b );
static list     one( object a );
static object   car( list o );
static object   cdr( list o );
static int      eq( object a, object b );
static int      eqint( object a, int i );
static int      match( object pat, object it, object *matched, object *tail );

static object   add_global_root( object o, object *op );
static int      collect( object local_roots );
static void       mark( object ob );
static int        sweep( record **ptr );
static record *   alloc();
static object   new_( object a );
static int      error( char *msg );


record *allocation_list;
object global_roots;
list   slnl; // patterns
list   single,
       multi;
list   starsl;

int
main( int argc, char **argv ){
  slnl   = add_global_root( cons( Int( '\\' ), one( Int( '\n' ) ) ), &slnl );
  single = add_global_root( cons( Int( '/' ), one( Int( '/' ) ) ), &single );
  multi  = add_global_root( cons( Int( '/' ), one( Int( '*' ) ) ), &multi  );
  starsl = add_global_root( cons( Int( '*' ), one( Int( '/' ) ) ), &starsl ); 

  list input = chars_from_file( argc > 1 ? fopen( argv[1], "r" )  : stdin );
  if(  debug_level >= 2  ) fprintf( stderr, "input:\n"), print( input, stderr );

  list logical = logical_lines( input );
  if(  debug_level >= 2  ) fprintf( stderr, "logical:\n"), print( logical, stderr );

  list stripped = strip_comments( logical );
  if(  debug_level >= 2  ) fprintf( stderr, "stripped:\n"), print( stripped, stderr );

  list restored = restore_continues( stripped );
  if(  debug_level >= 2  ) fprintf( stderr, "restored:\n");

  print( restored, stdout );
  fflush( stdout );

  if(  debug_level  ){
    if(  debug_level >= 2  ) fprintf( stderr, "@%d\n", collect( restored ) );
    if(  handle_roots  ){ global_roots = NULL; }
    fprintf( stderr, "@%d\n", collect( NULL ) );
    input = logical = stripped = restored = NULL;
  }
}

list
chars_from_file( FILE *f ){
  int c = fgetc( f );
  return  c != EOF  ? cons( Int( c ),
                            chars_from_file( f ) )
                    : one( Int( c ) );
}


list
logical_lines( list o ){
  if(  !o  ) return  NULL;
  if(  debug_level >= 2 && car(o)->Int.i != EOF  )
      fprintf( stderr, "[%c%c]", car(o)->Int.i, car(cdr(o))->Int.i );
  object matched, tail;
  return  match( slnl, o, &matched, &tail )  ? trim_continue( o, tail )
       :  cons( car( o ),
                logical_lines( cdr( o ) ) );
}

list
trim_continue( list o, list tail ){
  if(  debug_level >= 2  ) fprintf( stderr, "@" );
  return  car( tail )->Int.continues = car( o )->Int.continues + 1,
          logical_lines( tail );
}

list
restore_continues( list o ){
  if(  !o  ) return  NULL;
  object a = car( o );
  object z = cdr( o );
  object r = cons( a, restore_continues( z ) );
  while(  a->Int.continues  ){
    r = cons( Int( '\\' ),
              cons( Int( '\n' ),
                    r ) );
    --a->Int.continues;
  }
  return  r;
}

list
strip_comments( list o ){
  if(  !o  ) return  NULL;
  if(  debug_level >= 2 && car(o)->Int.i != EOF  )
      fprintf( stderr, "<%c%c>", car(o)->Int.i, car(cdr(o))->Int.i );
  object matched, tail;
  object a;
  return  match( single, o, &matched, &tail )  ? single_remainder( tail )
       :  match( multi, o, &matched, &tail )   ? multi_remainder( tail )
       :  starts_literal( a = car( o ) )       ? literal_val( a, cdr( o ) )
       :  cons( a,
                strip_comments( cdr( o ) ) );
}

list
single_remainder( list tail ){
  if(  debug_level >= 2  ) fprintf( stderr, "@" );
  object c;
  for(  c = car( tail );
        tail && ! (eqint( c, '\n' ) || eqint( c, EOF ));
	c = car( tail = cdr( tail ) )  )
    ;
  return  eqint( c, '\n' )  ? cons( Int( '\n' ), strip_comments( cdr( tail ) ) )
       :  tail;
}

list
multi_remainder( list tail ){
  if(  debug_level >= 2  ) fprintf( stderr, "@" );
  return  cons( Int( ' ' ),
                strip_comments( nested_comment( tail ) ) );
}

int
starts_literal( object a ){
  return  eqint( a, '\'' ) || eqint( a, '"' );
}

list
literal_val( object a, list o ){
  return  cons( a, skip_quote( a, o ) );
}

list
nested_comment( list o ){
  if(  !o  ) error( "Unterminated comment\n" );
  if(  debug_level >= 2  )
    fprintf( stderr, "(%c%c)", car( o )->Int.i, car( cdr( o ) )->Int.i );
  object matched, tail;
  return  match( starsl, o, &matched, &tail )  ? tail
       :  eqint( car( o ), EOF )               ? error( "Unterminated comment\n" ),NULL
       :  nested_comment( cdr( o ) );
}

list
skip_quote( object q, list o ){
  if(  !o  ) error( "Unterminated literal\n" );
  object a = car( o );
  return  eqint( a, '\\' )  ? cons( a, 
                                    cons( car( cdr( o ) ),
                                          skip_quote( q, cdr( cdr( o ) ) ) ) )
       :  eq( a, q )        ? cons( a,
                                    strip_comments( cdr( o ) ) )
       :  eqint( a, '\n' )
       || eqint( a, EOF )   ? error( "Unterminated literal\n" ),NULL
       :  cons( a,
                skip_quote( q, cdr( o ) ) );
}

void
print( list o, FILE *f ){
  switch(  o  ? o->t  : 0  ){
    case INTEGER: if(  o->Int.i != EOF  ) fputc( o->Int.i, f );
                  break;
    case LIST: print( car( o ), f );
               print( cdr( o ), f ); break;
  }
}


object
Int( int i ){
  return  OBJECT( .Int = { INTEGER, i } );
}

list
cons( object a, object b ){
  return  OBJECT( .List = { LIST, a, b } );
}

list
one( object a ){
  return  cons( a, NULL );
}

object
car( list o ){
  return  o && o->t == LIST  ? o->List.a  : NULL;
}

object
cdr( list o ){
  return  o && o->t == LIST  ? o->List.b  : NULL;
}

int
eq( object a, object b ){
  return  !a && !b         ? 1
       :  !a || !b         ? 0
       :  a->t != b->t     ? 0
       :  a->t == INTEGER  ? a->Int.i == b->Int.i
       :  !memcmp( a, b, sizeof *a );
}

int
eqint( object a, int i ){
  union uobject b = { .Int = { INTEGER, i } };
  return  eq( a, &b );
}

int
match( object pat, object it, object *matched, object *tail ){
  if(  !pat  ) return  *tail = it,  1;
  if(  pat->t != (it  ? it->t  : 0)  ) return  0;
  switch(  pat->t  ){
    case LIST: {
        object sink;
        if(  match( car( pat ), car( it ), & sink, tail )  )
          return  *matched = it,
                  match( cdr( pat ), cdr( it ), & sink, tail );
      } break;
    case INTEGER:
      if(  eq( pat, it )  ) return  *matched = it,  1;
  }
  return  0;
}


object
add_global_root( object o, object *op ){
  if(  handle_roots  ){
    global_roots = cons( o, global_roots );
    record *r = ((void*)( (char*)o - offsetof( record, o ) ) );
    r->handle = op;
  }
  return  o;
}

void
mark( object ob ){
  if(  !ob  ) return;
  record *r = ((void*)( (char*)ob - offsetof( record, o ) ) );
  if(  r->mark  ) return;
  r->mark = 1;
  switch(  ob  ? ob->t  : 0  ){
    case LIST: mark( ob->List.a ); mark( ob->List.b ); break;
  }
}

int
sweep( record **ptr ){
  int count = 0;
  while(  *ptr  ){
    if(  (*ptr)->mark  ){
      (*ptr)->mark = 0;
      ptr = &(*ptr)->prev;
    } else {
      record *z = *ptr;
      if(  z->handle  ) *z->handle = NULL;
      *ptr = (*ptr)->prev;
      free( z );
      ++count;
    }
  }
  return  count;
}

int
collect( object local_roots ){
  mark( local_roots );
  mark( global_roots );
  return  sweep( &allocation_list );
}

record *
alloc(){
  return  calloc( 1, sizeof(record) );
}

object
new_( object a ){
  record *r = alloc();
  object p = NULL;
  if(  r  ){
    r->prev = allocation_list;
    allocation_list = r;
    p = (void*)( ((char*)r) + offsetof( record, o ) );
    *p = *a;
  }
  return  p;
}

int
error( char *msg ){
  fprintf( stderr, "%s", msg );
  exit( EXIT_FAILURE );
  return 0777;
}

[toc] | [prev] | [next] | [standalone]


#157729

Fromluser droog <luser.droog@gmail.com>
Date2020-12-24 23:56 -0800
Message-ID<02a2342b-b823-42d2-8807-7e49d2b61aaan@googlegroups.com>
In reply to#157728
On Friday, December 25, 2020 at 1:18:56 AM UTC-6, luser droog wrote:
> So here's version 8 I guess. The only long function left is main() which may or 
> may not be worth messing with. I'm also not 100% thrilled with my 
> 'restore_continues()' function. There's probably a way to make it tail 
> recursive and more idiomatic. 
> 
[snip]
> list 
> restore_continues( list o ){ 
>   if( !o ) return NULL; 
>   object a = car( o ); 
>   object z = cdr( o ); 
>   object r = cons( a, restore_continues( z ) ); 
>   while( a->Int.continues ){ 
>     r = cons( Int( '\\' ), 
>     cons( Int( '\n' ), 
>           r ) ); 
>     --a->Int.continues; 
>   } 
>   return r; 
> } 
> 

A little better.

list
restore_continues( list o ){
  if(  !o  ) return  NULL;
  if(  car( o )->Int.continues-->0  ){
    return  cons( Int( '\\' ),
                  cons( Int( '\n' ),
			restore_continues( o ) ) );
  }
  return  cons( car( o ), restore_continues( cdr( o ) ) );
}

[toc] | [prev] | [next] | [standalone]


#157854

Fromluser droog <luser.droog@gmail.com>
Date2020-12-28 12:01 -0800
Message-ID<36739633-5e70-4b6f-a079-7c08863cd984n@googlegroups.com>
In reply to#157729
On Friday, December 25, 2020 at 1:57:03 AM UTC-6, luser droog wrote:
> On Friday, December 25, 2020 at 1:18:56 AM UTC-6, luser droog wrote: 
> > So here's version 8 I guess. The only long function left is main() which may or 
> > may not be worth messing with. I'm also not 100% thrilled with my 
> > 'restore_continues()' function. There's probably a way to make it tail 
> > recursive and more idiomatic. 
> >
> [snip]
> > list 
> > restore_continues( list o ){ 
> >   if( !o ) return  NULL; 
> >   object a = car( o ); 
> >   object z = cdr( o ); 
> >   object r = cons( a, restore_continues( z ) ); 
> >   while( a->Int.continues ){ 
> >     r = cons( Int( '\\' ), 
> >     cons( Int( '\n' ), 
> >           r ) ); 
> >     --a->Int.continues; 
> >   } 
> >   return  r; 
> > } 
> >
> A little better.
> list 
> restore_continues( list o ){ 
>   if( !o ) return  NULL;
>   if( car( o )->Int.continues-->0 ){ 
>   return  cons( Int( '\\' ), 
>   cons( Int( '\n' ), 
>         restore_continues( o ) ) ); 
>   } 
>   return  cons( car( o ), restore_continues( cdr( o ) ) ); 
> }

One more transform turns it into:

list
restore_continues( list o ){
  return  !o  ? NULL
       :  car( o )->Int.continues-->0  ?
            cons( Int( '\\' ),
                  cons( Int( '\n' ),
                        restore_continues( o ) ) )
       :  cons( car( o ),
                restore_continues( cdr( o ) ) );
}

which seems nicer.

I incorporated this and other cosmetic changes and uploaded at
browse:
https://github.com/luser-dr00g/strpcom/blob/622ce574bb11b3ecde8034b25bcdb1a0e23ba072/strpcom-v5.c
raw:
https://github.com/luser-dr00g/strpcom/raw/622ce574bb11b3ecde8034b25bcdb1a0e23ba072/strpcom-v5.c
full repo:
https://github.com/luser-dr00g/strpcom/archive/622ce574bb11b3ecde8034b25bcdb1a0e23ba072.zip
So there's a Version 8a but it doesn't behave any differently really from Version 8 posted upthread.

Also posted to codereview:
https://codereview.stackexchange.com/questions/254005/removing-c-comments-from-source

[toc] | [prev] | [next] | [standalone]


#157878

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2020-12-29 19:31 -0800
Message-ID<86r1n8ufz5.fsf@linuxsc.com>
In reply to#157854
luser droog <luser.droog@gmail.com> writes:

> On Friday, December 25, 2020 at 1:57:03 AM UTC-6, luser droog wrote:
>
>> On Friday, December 25, 2020 at 1:18:56 AM UTC-6, luser droog wrote:
>>
>>> So here's version 8 I guess.  The only long function left is
>>> main() which may or may not be worth messing with.  I'm also not
>>> 100% thrilled with my 'restore_continues()' function.  There's
>>> probably a way to make it tail recursive and more idiomatic.
>>
>> [snip]
>>
>>> list
>>> restore_continues( list o ){
>>>   if( !o ) return  NULL;
>>>   object a = car( o );
>>>   object z = cdr( o );
>>>   object r = cons( a, restore_continues( z ) );
>>>   while( a->Int.continues ){
>>>     r = cons( Int( '\\' ),
>>>     cons( Int( '\n' ),
>>>           r ) );
>>>     --a->Int.continues;
>>>   }
>>>   return  r;
>>> }
>>
>> A little better.
>> list
>> restore_continues( list o ){
>>   if( !o ) return  NULL;
>>   if( car( o )->Int.continues-->0 ){
>>   return  cons( Int( '\\' ),
>>   cons( Int( '\n' ),
>>         restore_continues( o ) ) );
>>   }
>>   return  cons( car( o ), restore_continues( cdr( o ) ) );
>> }
>
> One more transform turns it into:
>
> list
> restore_continues( list o ){
>   return  !o  ? NULL
>        :  car( o )->Int.continues-->0  ?
>             cons( Int( '\\' ),
>                   cons( Int( '\n' ),
>                         restore_continues( o ) ) )
>        :  cons( car( o ),
>                 restore_continues( cdr( o ) ) );
> }
>
> which seems nicer.

I did one incremental change on the previous iteration.  I'm not
doing any more.

> I incorporated this and other cosmetic changes and uploaded at
> browse:
> [github links]
> So there's a Version 8a but it doesn't behave any differently really
> from Version 8 posted upthread.

Github links are not counted as submissions.  Either get to a
point where the revised source is worth posting whole directly to
the newsgroup, or don't post anything (and keep working on the
program to get it to a point where it is worth posting).

> Also posted to codereview:
> [url]

I consider it bad manners for someone to put my name in a
stackexchange posting for a program I had nothing to do
with.  I ask that you not do this again.

[toc] | [prev] | [next] | [standalone]


#157713

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2020-12-24 14:47 -0800
Message-ID<86o8iiyg6z.fsf@linuxsc.com>
In reply to#157663
Anton Shepelev <anton.txt@gmail.com> writes:

> luser droog:
>
>> Made some progress (delayed by finals week).  I organized
>> all of Tim and Anton's test cases into a script:
>
> Glad to see you working on it.  I see some test cases with
> unterminated comments and literals.  Do you think a program
> should report them?  I though it was the natural task of the
> compiler, but I think I can extend my program to handle
> them.

The program should be well behaved on all inputs.  Things like
unterminated comments or unterminated strings are not lexically
well-formed, so how you treat them is up to you, but giving some
sort of diagnostic (normally on stderr) is one reasonable choice.

[toc] | [prev] | [next] | [standalone]


#157057

FromAnton Shepelev <anton.txt@gmail.com>
Date2020-12-08 01:59 +0300
Message-ID<20201208015930.831f44395024675505845f37@gmail.com>
In reply to#156943
Tim Rentsch:

> Short problem statement:  a C program to remove comments
> from C source input.
>
> Specifics:  Remove both /*...*/ and //... style comments.
> Don't worry about trigraphs.  Read from stdin, write to
> stdout, and diagnostics (if any) go to stderr.  If EOF is
> seen inside a comment, do something sensible but it
> doesn't matter what as long as it's sensible.  Use no
> 'goto' statements.  Limit function bodies to no more than
> 25 lines.

I started writing Wirth-like tokeniser, became tired of it
and swithced to an explicite state machine, producing the
dumbest entry in this public exercise.  It is too late, I
have to work in the morning, so am posting my program right
now, without extensive testing. Come, I do not even know C
well enough to construct the tests.

By the way, am I the only one to be hard-pressed to keep the
functions within the 25-line limit, for botjh of my
functions have exactly 25 lines.  I hope you have an
insecticide handy. Here it goes:

/* ------------------------------ No comments ------------------------------- *
/* A program to strip comments from a C file, by Anton Shepelev               */


/* Machine states: */
/* TODO: devise a consistent, annotated, but still very brief naming: */
typedef enum t_state
{  S_CD,  S_BC,  S_CR, S_SR, S_LC,
   S_CM1, S_BC0, S_CE, S_SE,     } t_state;

/* A state transition: */
/* TODO: buf is used in one entry only => hardcode: */
typedef struct
{  t_state state; /* state         */
   int     c;     /* input         */
   t_state next;  /* next state    */
   char    buf;   /* buffer input? */
   char    print; /* print  input? */
} t_trans;

/* Transition table: */
/* EOF input denotes the fall-back: */
t_trans xtab[] = {
/*   state  char   next buffer print  */
   { S_CD,  '/' , S_CM1,  1,     0 },
   { S_CD,  '"' , S_SR,   0,     1 },
   { S_CD,  '\'', S_CR,   0,     1 },
   { S_CD,  EOF , S_CD,   0,     1 },
   { S_CM1, '/' , S_LC,   0,     0 },
   { S_CM1, '*' , S_BC,   0,     0 },
   { S_CM1, EOF , S_CD,   0,     1 },
   { S_LC,  '\n', S_CD,   0,     1 },
   { S_LC,  EOF , S_LC,   0,     0 },
   { S_BC,  '*' , S_BC0,  0,     0 },
   { S_BC,  EOF , S_BC,   0,     0 },
   { S_BC0, '/' , S_CD,   0,     0 },
   { S_BC0, '*' , S_BC0,  0,     0 }, /* <== thanks to Bart's test case */
   { S_BC0, EOF , S_BC,   0,     0 },
   { S_SR,  '\\', S_SE,   0,     0 },
   { S_SR,  '"' , S_CD,   0,     1 },
   { S_SR,  EOF , S_SR,   0,     1 },
   { S_SE,  EOF,  S_SR,   0,     1 },
   { S_CR,  '\\', S_CE,   0,     0 },
   { S_CR,  '\'', S_CD,   0,     1 },
   { S_CR,  EOF,  S_CR,   0,     1 },
   { S_CE,  EOF,  S_CR,   0,     0 }
};

/* Perform a step on the state machine: */
/* OPT: nested array, indexed by 1) .state and 2) .char to avoid the loop: */
/*      i.e.: trans = state_tab[state][c]                                  */
void step( t_state *state, int c, int *buf )
{  t_trans *trans;
   int          i;

   i = 0;
   while( 1 ) /* transition look up */
   {  trans = &xtab[i];
      i     = i + 1;

      if( trans->state != *state ) continue;
      if( trans->c     !=  c     )
      if( trans->c     !=  EOF   ) continue;

      break;
   }

   if( trans->print )
   {  if( *buf != EOF ) putchar( *buf );
                        putchar(  c   );  }

   if( trans->buf ) *buf = c;
   else             *buf = EOF;

   *state = trans->next;
}

void main( void )
{  int     c, p, buf, stop;
   char    cont;
   t_state state;

   stop  = 0;
   state = S_CD;
   buf   = EOF;
   c     = EOF;
   while( 1 )
   {  p = c; c = getc( stdin );

      if( p == '\\' && c == '\n' )
      {  cont = 1; continue;  }

      if( cont )
      {  cont = 0; continue;  }

      if( p != EOF )
      {  step( &state, p, &buf );  }

      if( c == EOF )
      {  break;  }
   }
}

-- 
()  ascii ribbon campaign -- against html e-mail
/\  http://preview.tinyurl.com/qcy6mjc [archived]

[toc] | [prev] | [next] | [standalone]


Page 7 of 20 — ← Prev page 1 … 5 6 [7] 8 9 … 20  Next page →

Back to top | Article view | comp.lang.c


csiph-web