home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.fortran      Putting John Backus on a giant pedestal      5,127 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,760 of 5,127   
   Lawrence D'Oliveiro to All   
   DEALLOCATE Of Non-ALLOCATEd Should Be No   
   17 Oct 24 00:51:26   
   
   From: ldo@nz.invalid   
      
   It’s annoying to find that if you try to DEALLOCATE an ALLOCATABLE   
   variable that has not been ALLOCATEd (or that has already been   
   DEALLOCATEd), this is an error.   
      
   The usual practice is for storage-disposal calls to be harmless no-ops if   
   called with a NULL pointer (or equivalent). This is true of the C/POSIX   
   free(3) call , for example,   
   and also for the “delete” statement in C++.   
      
   This way, one can simplify cleanup by 1) ensuring all temporary pointers   
   are initialized to NULL at the start, and 2) unconditionally freeing all   
   of them at the end.   
      
   I suppose Fortran tries to simplify things by handling both conventions   
   automatically, but this still causes irritations in other places, like   
   loops.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca