Re: Newbie - stuck - need a small push on higher order procedures



"Mike" <mcu87992@xxxxxxxxxxxxxx> writes:
BTW - While I can use 'let' in coding (but possibly not the right way :),
the requirement didn't allow me to use it. I prefer local variables
(personal choice) but once I stopped being distracted by the use of 'first
'rest I was able to do this easily. I don't know what happens to the
objects ('first and 'rest) in terms of memory use - don't know how to
release them or destroy them. I'd expect Scheme does this house-keeping
automatically. I expect Scheme does have destructors - just not up to that
part in the reference materials :).

Yes, there's a garbage collector. Any lisp object that is not refered
anymore will be automatically deleted and its space reclaimed.

But there is no destructor function automatically called when this occurs.

You have to explicitely call destructors (to free external resources)
before losing references to your objects.


--
__Pascal Bourguignon__ http://www.informatimago.com/

"Specifications are for the weak and timid!"
.



Relevant Pages

  • Re: How to update an agrument passed by name in scheme
    ... what would you call the thing in Scheme with an external representation of the form (x. ... I was not trying to give an introductory treatment. ... that any use of the two words "by" and "reference" consecutively in the same sentence trigger a rewrite rule in your brain. ... confusion -- precisely the kind of confusion that we are seeing here. ...
    (comp.lang.scheme)
  • Re: How to update an agrument passed by name in scheme
    ... people say "say how much easier it is to do this thing in Scheme as opposed to whatever other language". ... But passing by reference is exceptionally easy in some of those other languages, and not so easy in Scheme, which, based on this thread, cannot be done trivially. ... that foo is an ordinary procedure, then without even knowing what foo does, we can safely conclude that the result of the expression is 5. ...
    (comp.lang.scheme)
  • Re: arrays = pointers?
    ... If it turns out that the memory scheme used by .NET is less efficient than other possible schemes, well...let's just say that wouldn't be the first time some major blunder was made when creating some computer architecture. ... If something is referenced only once or twice, then it doesn't matter how long it takes to resolve that reference. ... And it would require the compiler to do more work. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to update an agrument passed by name in scheme
    ... Scheme, which, based on this thread, cannot be done trivially. ... passed by reference in Scheme. ... What the OP meant by "passed by name" can also be described as "passing a variable by reference". ... In Algol 60, the problem was that the language had side effects, which don't mix well with call by name. ...
    (comp.lang.scheme)
  • Re: ownership problem?
    ... Memory is only one type of resource. ... > recommend the use of Factories with destructors that release the ... is reference counted objects, and when an object falls out of ...
    (comp.lang.python)