Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.os.vms    |    DEC's VAX* line of computers & VMS.    |    264,096 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 262,527 of 264,096    |
|    =?UTF-8?Q?Arne_Vajh=C3=B8j?= to All    |
|    Re: ISO: The Eiffel OO programming langu    |
|    26 Mar 25 20:37:48    |
   
   From: arne@vajhoej.dk   
      
   On 3/26/2025 8:19 PM, Arne Vajhøj wrote:   
   > On 3/26/2025 7:55 PM, Lawrence D'Oliveiro wrote:   
   >> On Wed, 26 Mar 2025 18:43:36 -0400, Arne Vajhøj wrote:   
   >>> Ada has a lot of good features.   
   >>   
   >> There’s a project called “SPARK” which is putting together a more   
   >> verifiable subset of Ada, with the aim of eventually including the   
   >> whole language.   
   >   
   > I have no experience with Spark, but my understanding is that it is   
   > a subset of Ada with added contracts for verification.   
   >   
   > But even "plain" Ada is very good.   
   >   
   > Question: can one call a language where lower and upper bounds   
   > of integer types are given by CPU architecture and not by   
   > the problem domain for type safe?   
   >   
   > If the answer is no, then that eliminates a lot of languages.   
      
   Maybe not great Ada but illustrating the point:   
      
   $ type typsaf.adb   
   with Ada.Text_IO, Ada.Integer_Text_IO;   
   use Ada.Text_IO, Ada.Integer_Text_IO;   
      
   procedure typsaf is   
      
   type one_to_ten is range 1..10;   
      
   v : one_to_ten;   
      
   begin   
    v := 1;   
    for i in 1..20 loop   
    Put("Adding 1 to ");   
    Put(integer(v), Width => 2);   
    New_Line;   
    v := v + 1;   
    end loop;   
   end typsaf;   
   $ gnat make typsaf.adb   
   gcc -c typsaf.adb   
   gnatbind -x typsaf.ali   
   gnatlink typsaf.ali   
   $ r typsaf   
   Adding 1 to 1   
   Adding 1 to 2   
   Adding 1 to 3   
   Adding 1 to 4   
   Adding 1 to 5   
   Adding 1 to 6   
   Adding 1 to 7   
   Adding 1 to 8   
   Adding 1 to 9   
   Adding 1 to 10   
      
   raised CONSTRAINT_ERROR : typsaf.adb:16   
      
   Arne   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca