Re: How come Ada isn't more popular?




Robert A Duff <bobduff@xxxxxxxxxxxxxxxxxxxx> writes:

Markus E Leypold
<development-2006-8ecbb5cc8aREMOVETHIS@xxxxxxxxxxxxxxxxxxxxx> writes:

If yout have only downward scopes for "closures" and memory allocation
this will, finally, interact badly with the fact that "implicit
(i.e. static type safe) casting" of classes is also only possible
downwards. My impression is, that all these things together rule out
some useful designs, that would otherwise possible. Or to say it
differenty: Object orientation w/o indeterminable scopes, upward
closures and GC doesn't work well. Some abstractions cannot be
implemented.

Why do we call these closures "downward" and "upward" instead of the
other way around?

I don't know. It's a pathological condition anyway :-). I'm using this
vocabulary as I find it.


A downward closure (allowed in Ada 2005, and to some
extent in Ada 83) is a procedure that is passed IN to another procedure,
which is toward the TOP of the call stack (up!).

It's passed downward th call chain.


An upward closure (not
directly supported in Ada, but supported in Lisp et al) is a procedure
that is passed OUT (return value, 'out' parameter, setting a global
variable) -- which means it's being passed DOWN toward the BOTTOM of the
call stack.

(Of course, the call stack is not quite a stack anymore, if
upward closures are allowed!)

Depends. Just yesterday I've been imagining a system which basically
uses a stack, but when passing a "closure" upwards, copies parts of
the stack to the heap.

Chicken scheme I think, also uses a stack (in som unusal ways), but
still has closure.


It seems to me "inward" and "outward" closures would be clearer
terminology, for what are normally called "downward" and "upward",
respectively.

What you call outward closures are just closure. There was a
discussion at comp.lang.functional which convinced me, that closure
should better be called procdures (because it's rathe the natural way
how things should work) and what is presently called downwards closure
should better be called somthing different, like, say stack bound
procedures (to indicate that their lifetime depends on the stack).

But it's certainly too late now to change established if misleading
terminology.

Regards -- Markus


.



Relevant Pages

  • Re: Groovy (war Re: [PROST]Re: CDC Plugin fuer Eclipse)
    ... Warum müsste man continuations erlauben Stackvariablen in den Heap zu verschieben? ... Ein activation record speichert die Parameter und lokalen Variablen der Funktion und eine Information, ... Da diese activation records klassischerweise auf einem Stack verwaltet werden, kann man hier Stackspace sparen - Endrekursion ist damit genauso effizient wie eine klassische Iteration mit einem Sprung. ...
    (de.comp.lang.java)
  • Re: How to implement lexical closures?
    ... there will also be a frame pointer to the ... technically a closure is simply a pairing of a function ... the environment is the stack of activation frames. ... A number of early imperative languages had ...
    (comp.compilers)
  • Re: How come Ada isnt more popular?
    ... the stack to the heap. ... still has closure. ... upward, of you prefer), then people say it supports "full closures". ... place (whether inward only, ...
    (comp.lang.ada)
  • Re: How come Ada isnt more popular?
    ... the stack to the heap. ... still has closure. ... upward, of you prefer), then people say it supports "full closures". ... place (whether inward only, ...
    (comp.lang.ada)
  • Re: How come Ada isnt more popular?
    ... downwards. ... A downward closure (allowed in Ada 2005, ... which is toward the TOP of the call stack. ... An upward closure (not ...
    (comp.lang.ada)