× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Steve Richter wrote:

When you have a GC you can write code like so:
CustomerRecord[] customers = GetListOfCustomers( arg1: arg2 ) ;

without it:
CustomerRecord[] customers ;
GetListOfCustomers( customers: arg1: arg2 ) ;
// dont forget to free the customers struct!

This is, at best, tangentially related to garbage collection.

Sure, a routine that returns data by reference would be easier to manage if you had garbage collection -- so there's a relationship there -- but it's not a very strong one.

I guess what I'm saying is this: If you ask the compiler developers for "garbage collection", it won't be clear to them that what you're really looking for is for procedures to return values by reference, and to use GC to simplify the management of that dynamic memory. Instead, they'll leave the return values alone, and add garbage collection to dynamic allocations -- which would help very few people.

I certainly agree that what you're asking for would be a useful feature -- but it would not be near the top of my wish list. There certainly have been times when I've wanted a huge return value that can be used in an expression, and where returning by value was too inefficient... but, it has been relatively rare.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.