Path: utzoo!attcan!uunet!mcvax!hp4nl!eutrc3!euteal!mart From: mart@euteal.UUCP (Mart van Stiphout) Newsgroups: comp.lang.misc Subject: Re: Turing programming language. Summary: Reaction on Mark Mendells explanation of the Turing syntax. Keywords: programming language Message-ID: <12@euteal.UUCP> Date: 23 Jan 89 22:22:07 GMT References: <11@euteal.UUCP> <89Jan20.111000est.4328@turing.toronto.edu> Organization: Eindhoven University of Technology, The Netherlands Lines: 58 > I think that loop statement in Turing is simple and easy to use. It is more > powerful than the equivalent Pascal loops. For example: Let me explain my objections to the Turing loop syntax. My main objection is the location of the exit criterion. It is inside the loop and generally will be surrounded by (lots ?) of code. As we all know, the correctness of loops can be shown by pre- and postconditions and the invariant relation. In my view, the stop criterion should not be located somewhere in the middle of the loop. Furthermore, in my opinion your Pascal examples of loops proof their superiority to the Turing loops: the loop type is clear in a glance. I think it's ok to use different notations for different loops I'm not the greatest C fan, but I think C loops are just what you need for correct loops. Let me compare the C and Turing loops: C Turing initialisation for ( initialisation; condition; increment ) loop { exit when not condition ... code ... ... code ... } end loop initialisation initialisation do { loop ... code ... ... code ... while condition exit when condition end loop And what do you think of the following C version of your 1.5 loop? while ( i = read() ) { ...code... } > You have a better point with collections. The Turing syntax: I really like the idea of indexing linked list as if they were arrays. At the moment I am really fed up with the minimal support of languages like Pascal and C for linked lists. I always have to create records (structs) and `next' pointers. Accessing or adding list elements always requires extra source code for rather trivial operations. Why can't there be a programming language with type list that automatically allocates memory if needed and allows treatment of list in a similar way as arrays. Arrays are so much easier to handle, give fewer errors and the code looks much better. I'm really interested in other peoples opinions on these ideas. --------------- Mart van Stiphout Eindhoven University of Technology email: mart@euteal.eutrc3.hp4nl.mcvac.uucp