Re: How come Ada isn't more popular?




Maciej Sobczak <no.spam@xxxxxxxxxxx> writes:

Dmitry A. Kazakov wrote:


For handling cycles there are weak pointers.

Not only.

Not at all you wanted to say.

If you have cycles, then you'd better rethink the design.

let rec fac n = if n = 0 then 1 else n * (fac (n-1));;

a) closure
b) cycle

:-).

A lot of OO models with callback also require cycles. E.g. A knows B
and B registers a callback with A in certain situations.

The difference is between a) graph treated as a mesh (or mess) of
nodes which "own" each other and b) graph treated as a collection of
nodes.

The former might have ownership cycles between nodes, but not the
latter, where ownership is an acyclic relation between graph and nodes.

I agree that this kind of restructuring is not always possible, but
^^^^^^^^^^^^^^^^^^^^^

!!.

Regards -- Markus

.



Relevant Pages

  • Re: Securing a future for anonymous functions in Python
    ... >>to handle simple manipulation of callback arguments (e.g., ... Not sure what you mean by closure here. ... external environment needed to be captured for use by a function definition ... for a lambda expression, ISTM. ...
    (comp.lang.python)
  • Re: Closures
    ... > So I'm trying to get my head around exactly what a "closure" is. ... Not `a callback is a primitive, ... There is a built in sort method which has default ... specific callback for each sort key because we don't know what the user ...
    (comp.lang.scheme)
  • Re: Objective C blocks
    ... across a problem where I thought "you know, a closure would be just what ... But I think the most obvious case is callback functions. ... any number of C APIs where you have to provide a function pointer and ... a void * pointer which gets passed as an argument to it. ...
    (comp.lang.c)
  • Closures
    ... So I'm trying to get my head around exactly what a "closure" is. ... Recently I read a closure was a "generic representation of a callback" ... There is a built in sort method which has default ...
    (comp.lang.scheme)