Re: Allocating arrays inside a subroutine.



Fortran 90 and 95 were designed originally for such things to be done with pointers, but the use of pointers has some disadvantages (both performance and semantics). Most of us think that this was a design mistake. It was later corrected (in the f95 allocatable TR and in 2003), but these are not yet universally supported, so we are still suffering from the original bad decision 15 years later.

As I understood Richard Maine, they wanted to get F90 and F95 out in time
- well, no later than they were already - and thought they needed more time
to think through all the ramifications of making the extensions described
in the TR. That seems like a wise decision to me.

Now, not including the capability to initialize a POINTER to NULL() in F90,
_that_ was a mistake.

Jan
.



Relevant Pages

  • Re: [PATCH 7/7] uts namespaces: Implement CLONE_NEWUTS flag
    ... I still think it's a design mistake to add zillions of pointers to task_struct ... The design point is not every kernel object. ... On clone check the clone flags against the bit mask. ...
    (Linux-Kernel)
  • Re: What is a null pointer constant?
    ... This may have made sense when null pointers really *were* all-bits-zero, but the only reason for keeping it that way after this assumption was dropped was the hysteria of the raisins. ... But while that's a very useful fiction for learning the language, that doesn't mean the language should support it in light of the cases when the fiction breaks down, sometimes badly. ... to C, the semantics of 'if' would be redefined to test booleans only, and == and!= would return booleans. ... Redefining its semantics to something less primitive and error-prone is simply no longer an option. ...
    (comp.std.c)
  • Re: [PATCH] kfree_skb() bug in 2.4.22
    ... > and vfreeand they have a sanity check for NULL before processing, ... > well as those are also the well-known semantics for the userspace free ... Passing NULL pointers around usually indicates poorly designed ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: [PATCH][2.6.6-rc3] gcc-3.4.0 fixes
    ... You're assuming pointers have uniform representation. ... different types of representations in the past. ... A cast fundamentally involves an assignment conversion, ... Even if we allow its use as an lvalue, the semantics ...
    (Linux-Kernel)
  • Re: Instantiating private types with discriminants?
    ... Ada's pointers are transparent to record member/discriminant and array ... Syntactically transparent, but not semantically. ... target type if its referential counterpart in client contexts. ... exclude any misunderstandings about semantics of a given operation. ...
    (comp.lang.ada)