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


Groups > comp.lang.c > #106470

Re: More problems with lcc-win

Newsgroups comp.lang.c
Date 2017-03-19 02:17 -0700
References (13 earlier) <2f653ac7-3cc2-4ed3-99e9-c2f140bb80ff@googlegroups.com> <20170318201159.412ccf346b1d16ac1cd26a61@gmail.com> <e884c351-e369-4589-9485-1d5bf8776e62@googlegroups.com> <20170318224617.8ba0815b43a3f2270bd04cfa@gmail.com> <52603bfb-c5ae-4852-8ab8-2f3fe21b1d3b@googlegroups.com>
Message-ID <72d2fc7e-93fb-4dc3-b006-caf2643ffcbb@googlegroups.com> (permalink)
Subject Re: More problems with lcc-win
From mertesthomas@gmail.com

Show all headers | View raw


Am Sonntag, 19. März 2017 02:01:22 UTC+1 schrieb supe...@casperkitty.com:
> On Saturday, March 18, 2017 at 4:48:35 PM UTC-5, GOTHIER Nathan wrote:
> >                                In comparison to that C programs
> > > are usually not portable at all (they need to be changed to
> > > fit to a different os).
> > 
> > The port-ability depends on the availability of a compiler or an
> > interpreter, nothing less nothing more.
> > 
> > Your C bashing in a desperate attempt to promote your Seed7 language is
> > ridiculous...
> 
> A language that promises certain features will only be usable on systems that
> have such features, but will allow programs that require those features to be
> run without modification on all systems that support them.
> 
> If a language offers optional features, then programs that require those
> features will only be usable on systems that support then, but the language
> will be usable on systems that can't support those features, for the purpose
> of running programs that don't require them.
> 
> There are many features which are supported by many systems upon which C
> is run, and which many programs require, but which the C Standard does not
> acknowledge in any way whatsoever.  Some of these features are available,
> wit consistent syntax, on most compilers for commonplace platforms, though
> they may require suitable configuration of compiler options.  Others are
> supported different ways on different systems and require different code
> to handle them.
> 
> I'm not familiar with seed7 myself, but perhaps Thomas Mertes would like
> to offer up a program that reads one key from the console, without echo
> or buffering, and then returns its ASCII code.  In a C compiler for MS-DOS
> such a program would be:
> 
>     #include <conio.h>
>     int main(void) { return getch(); }

The Seed7 equivalent would be:

    $ include "seed7_05.s7i";
      include "keybd.s7i";

    const proc: main is func
      begin
        exit(ord(getc(KEYBOARD)));
      end func;

The handling of a return value from main is operating system
dependent. E.g.: It needs operating system dependent handling to
make the return value from main visible at the command line.
Therefore I would prefer a program that writes the ASCII code:

    $ include "seed7_05.s7i";
      include "keybd.s7i";

    const proc: main is func
      begin
        writeln(ord(getc(KEYBOARD)));
      end func;

This program behaves the same on Linux, OS X, FreeBSD, OpenBSD and
Windows. Even when you press function or cursor keys you get the
same result.

The Seed7 release contains a program named kbd.sd7, which shows
key-code and description of the keys pressed. Naturally key-code and
description are the same at all supported operating systems. There
is also a program named gkbd.sd7, which does the same while it
displays a window with a moving dot. This program reads also from
the file KEYBOARD and delivers the same results on all supported
operating systems as the console program kbd.sd7. Under the hood
graphic and console programs use different driver libraries to read
a key. So the driver libraries do not only differ between operating
systems, but also between console and graphic programs.

Reading single key presses without echo is just a small part of
the effort to reach portability. For other areas (doing graphics,
reading directory contents, starting processes, database access,
network access, etc.) there are also driver libraries.

[snip]
> ....  From
> what I've read here, however, I would expect a seed7 equivalent would be
> portable to all systems that support seed7, which would be a much larger
> set.  Perhaps people who think C is more portable than seed7 would like to
> suggest how the above simple program might be written in portable C?  Or
> maybe they don't think any program that would need such an ability should be
> considered "portable".

The Fox and the Grapes...


Regards,
Thomas Mertes

-- 
Seed7 Homepage: http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, portable, runs under linux/unix/windows.

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


Thread

More problems with lcc-win mertesthomas@gmail.com - 2017-03-15 00:29 -0700
  Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 11:27 +0100
    Re: More problems with lcc-win scott@slp53.sl.home (Scott Lurndal) - 2017-03-15 13:18 +0000
      Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 15:22 +0100
        Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-15 08:26 -0700
    Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-15 08:25 -0700
      Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 16:46 +0100
        Re: More problems with lcc-win David Brown <david.brown@hesbynett.no> - 2017-03-15 17:07 +0100
          Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-15 09:52 -0700
            Re: More problems with lcc-win scott@slp53.sl.home (Scott Lurndal) - 2017-03-15 16:57 +0000
              Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-15 10:11 -0700
                Re: More problems with lcc-win scott@slp53.sl.home (Scott Lurndal) - 2017-03-15 18:17 +0000
            Re: More problems with lcc-win Richard Heathfield <rjh@cpax.org.uk> - 2017-03-15 17:21 +0000
              Re: More problems with lcc-win GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-03-15 18:42 +0100
                Re: More problems with lcc-win scott@slp53.sl.home (Scott Lurndal) - 2017-03-15 18:20 +0000
                Re: More problems with lcc-win Richard Heathfield <rjh@cpax.org.uk> - 2017-03-15 18:59 +0000
                Re: More problems with lcc-win BartC <bc@freeuk.com> - 2017-03-15 18:20 +0000
                Re: More problems with lcc-win GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-03-15 19:39 +0100
                Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-15 12:44 -0700
                Re: More problems with lcc-win BartC <bc@freeuk.com> - 2017-03-15 20:19 +0000
                Re: More problems with lcc-win David Brown <david.brown@hesbynett.no> - 2017-03-16 10:03 +0100
                Re: More problems with lcc-win BartC <bc@freeuk.com> - 2017-03-16 11:15 +0000
                Re: More problems with lcc-win BartC <bc@freeuk.com> - 2017-03-16 11:32 +0000
                Re: More problems with lcc-win David Brown <david.brown@hesbynett.no> - 2017-03-16 13:41 +0100
                Re: More problems with lcc-win GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-03-16 08:52 +0100
                Re: More problems with lcc-win David Brown <david.brown@hesbynett.no> - 2017-03-16 09:57 +0100
                Re: More problems with lcc-win antispam@math.uni.wroc.pl - 2017-03-16 13:53 +0000
                Re: More problems with lcc-win jm.bourguet@gmail.com - 2017-03-16 07:14 -0700
                Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-16 08:59 -0700
              Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-15 12:43 -0700
                Re: More problems with lcc-win Richard Heathfield <rjh@cpax.org.uk> - 2017-03-15 20:39 +0000
            Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 23:56 +0100
        Re: More problems with lcc-win Richard Heathfield <rjh@cpax.org.uk> - 2017-03-15 16:33 +0000
          Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 17:47 +0100
            Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-15 10:04 -0700
              Re: More problems with lcc-win jacob navia <jacob@jacob.remcomp.fr> - 2017-03-16 00:52 +0100
                Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-15 18:02 -0700
                Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-15 18:23 -0700
                Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-17 13:45 -0700
                Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-18 00:23 +0100
                Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-18 00:29 +0100
                Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-18 00:31 +0100
                Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-17 17:01 -0700
                Re: More problems with lcc-win Richard Heathfield <rjh@cpax.org.uk> - 2017-03-20 16:41 +0000
                Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-20 18:32 +0100
                Re: More problems with lcc-win Richard Heathfield <rjh@cpax.org.uk> - 2017-03-20 18:18 +0000
                Re: More problems with lcc-win bart4858@gmail.com - 2017-03-20 12:31 -0700
                Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-20 21:05 +0100
                Re: More problems with lcc-win BartC <bc@freeuk.com> - 2017-03-20 20:45 +0000
                Re: More problems with lcc-win Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-20 20:18 +0000
                Re: More problems with lcc-win David Brown <david.brown@hesbynett.no> - 2017-03-21 09:56 +0100
                Re: More problems with lcc-win Jorgen Grahn <grahn+nntp@snipabacken.se> - 2017-03-21 21:08 +0000
                Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-21 22:19 +0100
                Re: More problems with lcc-win Jorgen Grahn <grahn+nntp@snipabacken.se> - 2017-03-22 06:29 +0000
                Re: More problems with lcc-win supercat@casperkitty.com - 2017-03-21 16:12 -0700
                Re: More problems with lcc-win gordonb.s97bd@burditt.org (Gordon Burditt) - 2017-03-24 01:13 -0500
                Re: More problems with lcc-win supercat@casperkitty.com - 2017-03-24 08:16 -0700
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-26 03:18 -0700
                Re: More problems with lcc-win BartC <bc@freeuk.com> - 2017-03-26 12:35 +0100
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-29 05:17 -0700
                Re: More problems with lcc-win supercat@casperkitty.com - 2017-03-26 14:04 -0700
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-29 05:48 -0700
                Re: More problems with lcc-win BartC <bc@freeuk.com> - 2017-03-21 23:21 +0000
                Re: More problems with lcc-win Jorgen Grahn <grahn+nntp@snipabacken.se> - 2017-03-22 06:18 +0000
                Re: More problems with lcc-win gordonb.1neik@burditt.org (Gordon Burditt) - 2017-03-21 18:45 -0500
                Re: More problems with lcc-win jm.bourguet@gmail.com - 2017-03-22 01:02 -0700
                Re: More problems with lcc-win David Brown <david.brown@hesbynett.no> - 2017-03-22 10:35 +0100
                Re: More problems with lcc-win scott@slp53.sl.home (Scott Lurndal) - 2017-03-22 13:21 +0000
                Re: More problems with lcc-win BartC <bc@freeuk.com> - 2017-03-22 14:08 +0000
                Re: More problems with lcc-win scott@slp53.sl.home (Scott Lurndal) - 2017-03-22 15:37 +0000
                Re: More problems with lcc-win Gareth Owen <gwowen@gmail.com> - 2017-03-22 21:09 +0000
                Re: More problems with lcc-win scott@slp53.sl.home (Scott Lurndal) - 2017-03-21 13:09 +0000
                Re: More problems with lcc-win Jorgen Grahn <grahn+nntp@snipabacken.se> - 2017-03-21 21:15 +0000
                Re: More problems with lcc-win Ian Collins <ian-news@hotmail.com> - 2017-03-18 12:44 +1300
                Re: More problems with lcc-win jameskuyper@verizon.net - 2017-03-17 16:59 -0700
                Re: charsets Noob <root@127.0.0.1> - 2017-03-18 18:30 +0100
                Re: More problems with lcc-win David Brown <david.brown@hesbynett.no> - 2017-03-16 10:18 +0100
            Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-15 15:06 -0700
              Re: More problems with lcc-win Richard Heathfield <rjh@cpax.org.uk> - 2017-03-15 22:23 +0000
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-15 15:43 -0700
                Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 23:53 +0100
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-16 08:35 -0700
                Re: More problems with lcc-win Richard Heathfield <rjh@cpax.org.uk> - 2017-03-15 23:13 +0000
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-16 06:28 -0700
                Re: More problems with lcc-win Richard Heathfield <rjh@cpax.org.uk> - 2017-03-16 16:56 +0000
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-16 14:53 -0700
              Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-15 16:18 -0700
                Re: More problems with lcc-win scott@slp53.sl.home (Scott Lurndal) - 2017-03-16 18:03 +0000
                Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-16 19:29 +0100
                Re: More problems with lcc-win Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-16 21:38 +0000
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-17 08:58 -0700
                Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-17 09:45 -0700
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-17 10:33 -0700
                Re: More problems with lcc-win "James R. Kuyper" <jameskuyper@verizon.net> - 2017-03-17 14:20 -0400
                Re: More problems with lcc-win GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-03-17 20:18 +0100
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-18 00:44 -0700
                Re: More problems with lcc-win BartC <bc@freeuk.com> - 2017-03-18 13:31 +0000
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-18 15:54 -0700
                Re: More problems with lcc-win scott@slp53.sl.home (Scott Lurndal) - 2017-03-20 13:27 +0000
                Re: More problems with lcc-win GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-03-18 15:15 +0100
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-18 11:39 -0700
                Re: More problems with lcc-win GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-03-18 20:11 +0100
                Re: More problems with lcc-win BartC <bc@freeuk.com> - 2017-03-18 19:45 +0000
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-20 00:35 -0700
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-18 14:22 -0700
                Re: More problems with lcc-win GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-03-18 22:46 +0100
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-18 16:12 -0700
                Re: More problems with lcc-win supercat@casperkitty.com - 2017-03-18 18:01 -0700
                Re: More problems with lcc-win GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-03-19 03:21 +0100
                Re: More problems with lcc-win Ian Collins <ian-news@hotmail.com> - 2017-03-19 15:32 +1300
                Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-19 02:17 -0700
    Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-15 14:25 -0700
      Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 23:49 +0100
  Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 11:28 +0100
    Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-15 14:35 -0700
      Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 23:44 +0100
  Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 13:06 +0100
    Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-15 14:43 -0700
      Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 23:43 +0100
  Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 13:19 +0100
    Re: More problems with lcc-win mertesthomas@gmail.com - 2017-03-15 14:50 -0700
  Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-15 08:24 -0700
    Re: More problems with lcc-win jacobnavia <jacob@jacob.remcomp.fr> - 2017-03-15 16:47 +0100
      Re: More problems with lcc-win jameskuyper@verizon.net - 2017-03-15 09:04 -0700
      Re: More problems with lcc-win Keith Thompson <kst-u@mib.org> - 2017-03-15 09:15 -0700
        Re: More problems with lcc-win gazelle@shell.xmission.com (Kenny McCormack) - 2017-03-15 19:59 +0000
      Re: More problems with lcc-win Richard Heathfield <rjh@cpax.org.uk> - 2017-03-15 16:32 +0000

csiph-web