comp.lang.ada
 help / color / mirror / Atom feed
* Re: Newbie in distress :-)
       [not found] <7urnh6$4ov$1@news2.inter.net.il>
@ 1999-10-23  0:00 ` David C. Hoos, Sr.
       [not found]   ` <Pine.A41.3.96-heb-2.07.991023170713.120704A-100000@pluto.mscc.huji.ac.il >
                     ` (2 more replies)
  1999-10-28  0:00 ` Gautier
  1 sibling, 3 replies; 17+ messages in thread
From: David C. Hoos, Sr. @ 1999-10-23  0:00 UTC (permalink / raw)



Guy Cohen <the-twin@inter.net.il> wrote in message
news:7urnh6$4ov$1@news2.inter.net.il...
How do I free the memory captured by my program by using linked lists at the
end of the program?


I will appreciate if someone will send a working example of it.

All memory "captured" by your program is automatically "freed" or released
when the program terminates.







^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
       [not found]   ` <Pine.A41.3.96-heb-2.07.991023170713.120704A-100000@pluto.mscc.huji.ac.il >
@ 1999-10-23  0:00     ` Matthew Heaney
  1999-10-24  0:00       ` David Botton
  0 siblings, 1 reply; 17+ messages in thread
From: Matthew Heaney @ 1999-10-23  0:00 UTC (permalink / raw)


In article 
<Pine.A41.3.96-heb-2.07.991023170713.120704A-100000@pluto.mscc.huji.ac.i
l> , Ehud Lamm <mslamm@mscc.huji.ac.il>  wrote:

> However, if Guy wants to really explore interesting ways of controlling
> memory allocation/deallocation I would suggest exploring Controlled types
> and Storage Pools...


There is an example of a linked list, implemented using reference counts
and type Controlled, in the patterns archive:

<http://www.acm.org/archives/patterns.html>

Use the search engine to find "list" in the subject line.  The article
was titled "homogeneous lists", or something like that.

Matt




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
  1999-10-23  0:00 ` Newbie in distress :-) David C. Hoos, Sr.
       [not found]   ` <Pine.A41.3.96-heb-2.07.991023170713.120704A-100000@pluto.mscc.huji.ac.il >
@ 1999-10-23  0:00   ` Ehud Lamm
  1999-10-24  0:00     ` Robert Dewar
  1999-10-25  0:00   ` Ted Dennison
  2 siblings, 1 reply; 17+ messages in thread
From: Ehud Lamm @ 1999-10-23  0:00 UTC (permalink / raw)


On Sat, 23 Oct 1999, David C. Hoos, Sr. wrote:

|
|Guy Cohen <the-twin@inter.net.il> wrote in message
|news:7urnh6$4ov$1@news2.inter.net.il...
|How do I free the memory captured by my program by using linked lists at the
|end of the program?
|
|
|I will appreciate if someone will send a working example of it.
|
|All memory "captured" by your program is automatically "freed" or released
|when the program terminates.


This as well as a reference to using Unchecked_Deallocation was given to
the student. The topic is of course also included in the text book.

However, if Guy wants to really explore interesting ways of controlling
memory allocation/deallocation I would suggest exploring Controlled types
and Storage Pools...

Ehud Lamm mslamm@mscc.huji.ac.il
http://purl.oclc.org/NET/ehudlamm <== My home on the web 
Check it out and subscribe to the E-List- for interesting essays and more!







^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
  1999-10-23  0:00   ` Ehud Lamm
@ 1999-10-24  0:00     ` Robert Dewar
  1999-10-24  0:00       ` Aidan Skinner
                         ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Robert Dewar @ 1999-10-24  0:00 UTC (permalink / raw)


In article
<Pine.A41.3.96-heb-2.07.991023170713.120704A-100000@pluto.mscc.h
uji.ac.il>,
  Ehud Lamm <mslamm@mscc.huji.ac.il> wrote:
> The topic is of course also included in the text book.

I fear students are unlearning the technique of reading
books, in favor of throwing a quick question to some newsgroup
in the hopes of finding an answer.

The problem of course is that this does not scale well. It is
not nearly so productive to send a message to the newsgroup
that says:

"I have to write some Ada code for designing nuclear fusion
reactors, and I am pretty much a newbie when it comes to nuclear
fusion. I wondered if anyone could give me some quick pointers,
or some code that I could adapt. Thanks a million."

:-)

One of the things we need to teach our students is how to read
(and learn from the reading of) reference materials of various
levels of sophistication.

My final exam in my yearly honors assembly language and
processor architecture course tries to
get at this issue. These are second year students, and the exam
is open book two hours.

I give them a reference manual for a completely new machine that
I designed, a small machine, but not necessarily a simple one
(last year, the machine was a small EPIC machine). They have
to read the reference manual, which gives the instruction set
and the ABI for the machine, and then write some simple programs
and answer questions about programs for the machine, and answer
some general questions about the strong and weak points of the
particular architecture.

I tell them, spend the first half hour reading, don't put pen
to paper till 30 minutes is up :-)


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
  1999-10-24  0:00     ` Robert Dewar
@ 1999-10-24  0:00       ` Aidan Skinner
  1999-10-25  0:00         ` Ted Dennison
  1999-10-24  0:00       ` Ehud Lamm
  1999-10-25  0:00       ` Robert A Duff
  2 siblings, 1 reply; 17+ messages in thread
From: Aidan Skinner @ 1999-10-24  0:00 UTC (permalink / raw)


On Sun, 24 Oct 1999 01:31:18 GMT, Robert Dewar
<robert_dewar@my-deja.com> wrote: 

>I fear students are unlearning the technique of reading
>books, in favor of throwing a quick question to some newsgroup
>in the hopes of finding an answer.

I don't know, some are. In my Computer Systems lecture on Friday the
lecturer asked how many people read news (there's a couple of internal
newsgroups apparently being setup), maybe 10% of the class put their
hands up. It's probably a lot different in the US, where net
penetration is a lot higher (I hate local phonecall rates) though.

>(and learn from the reading of) reference materials of various
>levels of sophistication.

I really want to say that I think this will be a lot better when the
FAQ is posted here regularly, but I don't think that the sort of
person who posts these questions is the sort of person who lurks for a
while before posting...

- Aidan (who really likes books, and is glad that his university has
  an excellent library)

-- 
"I say we just bury him and eat dessert"
http://www.skinner.demon.co.uk/aidan/




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
  1999-10-24  0:00     ` Robert Dewar
  1999-10-24  0:00       ` Aidan Skinner
@ 1999-10-24  0:00       ` Ehud Lamm
  1999-10-25  0:00       ` Robert A Duff
  2 siblings, 0 replies; 17+ messages in thread
From: Ehud Lamm @ 1999-10-24  0:00 UTC (permalink / raw)


In article <7utnh6$gjs$1@nnrp1.deja.com>,
  Robert Dewar <robert_dewar@my-deja.com> wrote:
> In article
> <Pine.A41.3.96-heb-2.07.991023170713.120704A-100000@pluto.mscc.h
> uji.ac.il>,
> I fear students are unlearning the technique of reading
> books, in favor of throwing a quick question to some newsgroup
> in the hopes of finding an answer.

Yes. But I don't get mad, I get even :-)

I take it that by asking in a newsgroup the student is showing a genuine
interest in the subject - so I put him in the direction of in depth material.
In this group good ideas are suggesting the Rational, Ada design documents
etc.

These are always good to read, so why not suggest them?


>
> One of the things we need to teach our students is how to read
> (and learn from the reading of) reference materials of various
> levels of sophistication.
>

Concerning the "unlearning" of thinking skills (since the students still know
how to read - at least from the screen :-)

you might enjoy to E-List's I wrote, which after reading your post jumlped to
mind:

* Is there a charcter trait for curiosity
* Stimulating learning - possible?

Hope you enjoy these

--
Ehud Lamm mslamm@mscc.huji.ac.il
http://purl.oclc.org/NET/ehudlamm
Check it out and subscribe to the E-List


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
  1999-10-24  0:00       ` David Botton
@ 1999-10-24  0:00         ` Ehud Lamm
  1999-10-24  0:00           ` David Botton
  1999-10-24  0:00         ` Guy Cohen
  1999-10-28  0:00         ` Another " Charles Hixson
  2 siblings, 1 reply; 17+ messages in thread
From: Ehud Lamm @ 1999-10-24  0:00 UTC (permalink / raw)


In article <19991024.4074369@db3.max5.com>,
  David Botton <David@Botton.com> wrote:
> May also be found at:
>
> Heterogeneous, Reference-Counted Lists (Heaney)=20
> http://www.adapower.com/alg/hetroref.html
>
> Homogeneous, Reference-Counted Lists (Heaney)=20
> http://www.adapower.com/alg/homoref.html
>

Well if we are talking of AdaPower, there is also an example of a "simple
controlled list" from me.

Let's put it in the FAQ: check AdaPower!

--
Ehud Lamm mslamm@mscc.huji.ac.il
http://purl.oclc.org/NET/ehudlamm
Check it out and subscribe to the E-List


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
  1999-10-23  0:00     ` Matthew Heaney
@ 1999-10-24  0:00       ` David Botton
  1999-10-24  0:00         ` Ehud Lamm
                           ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: David Botton @ 1999-10-24  0:00 UTC (permalink / raw)


May also be found at:

Heterogeneous, Reference-Counted Lists (Heaney) 
http://www.adapower.com/alg/hetroref.html

Homogeneous, Reference-Counted Lists (Heaney) 
http://www.adapower.com/alg/homoref.html

> Use the search engine to find "list" in the subject line.  The article
> was titled "homogeneous lists", or something like that.








^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
  1999-10-24  0:00       ` David Botton
  1999-10-24  0:00         ` Ehud Lamm
@ 1999-10-24  0:00         ` Guy Cohen
  1999-10-28  0:00         ` Another " Charles Hixson
  2 siblings, 0 replies; 17+ messages in thread
From: Guy Cohen @ 1999-10-24  0:00 UTC (permalink / raw)


Thanks David and Matt!!!!

:-))))))))))
Guy Cohen







^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
  1999-10-24  0:00         ` Ehud Lamm
@ 1999-10-24  0:00           ` David Botton
  0 siblings, 0 replies; 17+ messages in thread
From: David Botton @ 1999-10-24  0:00 UTC (permalink / raw)


> Well if we are talking of AdaPower, there is also an example of a 
"simple
> controlled list" from me.

Simple Controlled List (Lamm)
http://www.adapower.com/alg/controlled_list.zip

Sorry, I was just pointing to easy to use URLs for Matthew Heaney's 
examples that he was referring to. There are a number of other 
examples that would help the questioner, I should have indicated that.

> Let's put it in the FAQ: check AdaPower!

In addition to the AdaFAQ-list@adapower.com, I am in the process of 
adding the web based AdaFAQ itself that will allow people to add to 
the FAQ on-line. The mail list will be for discussing the FAQ, 
comments, requests to change its organization, etc.

David Botton








^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
  1999-10-23  0:00 ` Newbie in distress :-) David C. Hoos, Sr.
       [not found]   ` <Pine.A41.3.96-heb-2.07.991023170713.120704A-100000@pluto.mscc.huji.ac.il >
  1999-10-23  0:00   ` Ehud Lamm
@ 1999-10-25  0:00   ` Ted Dennison
  2 siblings, 0 replies; 17+ messages in thread
From: Ted Dennison @ 1999-10-25  0:00 UTC (permalink / raw)


In article <7usf0h$du2$1@ash.prod.itd.earthlink.net>,
  "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com> wrote:
>
> Guy Cohen <the-twin@inter.net.il> wrote in message
> news:7urnh6$4ov$1@news2.inter.net.il...
>> How do I free the memory captured by my program by using linked lists
>> at the end of the program?

> All memory "captured" by your program is automatically "freed" or
> released when the program terminates.

If we are talking heap (and not stack) here, that's not nessecarily
true. It depends on your OS (so it isn't really an Ada issue). vxWorks
doesn't work that way. I suspect many of the other "small" OS'es that
have Ada compilers on them are the same way (DOS, psos, AmigaDOS, etc.).

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
  1999-10-24  0:00       ` Aidan Skinner
@ 1999-10-25  0:00         ` Ted Dennison
  0 siblings, 0 replies; 17+ messages in thread
From: Ted Dennison @ 1999-10-25  0:00 UTC (permalink / raw)


In article <slrn81573m.pl.aidan@skinner.demon.co.uk>,
  aidan@skinner.demon.co.uk wrote:
> I really want to say that I think this will be a lot better when the
> FAQ is posted here regularly, but I don't think that the sort of
> person who posts these questions is the sort of person who lurks for a
> while before posting...

True, but then one person can just post a RTFFAQ message, rather than
having these long threads about it. If you want to be really helpful,
you can even give the hapless one a FAQ paragraph #.

Of course in this case the FAQ entry would be something like "This is
comp.lang.ada, not comp.basic.data_structures. Put down your beer for a
minute and try reading that textbook your parents spent $50 on." :-)

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
  1999-10-24  0:00     ` Robert Dewar
  1999-10-24  0:00       ` Aidan Skinner
  1999-10-24  0:00       ` Ehud Lamm
@ 1999-10-25  0:00       ` Robert A Duff
  1999-10-26  0:00         ` Aidan Skinner
  2 siblings, 1 reply; 17+ messages in thread
From: Robert A Duff @ 1999-10-25  0:00 UTC (permalink / raw)


Robert Dewar <robert_dewar@my-deja.com> writes:

> I fear students are unlearning the technique of reading
> books, in favor of throwing a quick question to some newsgroup
> in the hopes of finding an answer.

The technique of *writing* books seems to be getting lost, too.
I can't count the number of computer programs I've used recently where I
want to read the manual, so I can learn everything this program can do.
But the documentation consists of a twisty maze of tiny snippets of
information connected together with hyper-links, in which I wander
aimlessly, re-reading the same paragraphs over and over...

Or am I just showing my age?

I used to do a lot of caving when I was in college -- crawling around
under the ground through dark passsageways without a map, but with a
carbide lantern ("I wonder where this one leads?"  "Have we been here
before?") getting all muddy, &c.  Reading documentation these days
reminds me of caving.

> I give them a reference manual for a completely new machine that
> I designed, a small machine, but not necessarily a simple one
> (last year, the machine was a small EPIC machine).

You mean they haven't seen the book until they get into the exam?  
I don't see the point of that -- why not let them read it ahead of time?

- Bob




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
  1999-10-25  0:00       ` Robert A Duff
@ 1999-10-26  0:00         ` Aidan Skinner
  0 siblings, 0 replies; 17+ messages in thread
From: Aidan Skinner @ 1999-10-26  0:00 UTC (permalink / raw)


On Mon, 25 Oct 1999 18:09:16 GMT, Robert A Duff <bobduff@world.std.com> wrote:

>The technique of *writing* books seems to be getting lost, too.

I dunno, I've read some *real* dross from the distant past[1]. But
there does seem to be more of it, especially in the computing area. 

>But the documentation consists of a twisty maze of tiny snippets of
>information connected together with hyper-links, in which I wander
>aimlessly, re-reading the same paragraphs over and over...
>
>Or am I just showing my age?

Nah, I was only born in 1980 and I've had the same experience, this
particularly seems to be a problem with shareware applications. Free
software seems to be better though.

OTOH I'm a compulsive reader, and tend to have about 9 books on the go
at one time.

>You mean they haven't seen the book until they get into the exam?  
>I don't see the point of that -- why not let them read it ahead of time?

I think this way it teaches people the value of properly written
documentation, and also checks that they've understood the principles
behind what they're doing and can't just regurgitate the correct
answer by rememebring as large a possible set of questions as they
can.

- Aidan

[1] Although I have to say that the worst book I've ever attempted to
read was Battlefield Earth by L Ron Hubbard and that was only
1960-something. I was warned, unfortuantely I didn't listen. I've
since learned. 
-- 
"I say we just bury him and eat dessert"
http://www.skinner.demon.co.uk/aidan/
OpenPGP Key Fingerprint: 9858 33E6 C755 7D34 B5C5  316D 9274 1343 FBE6 99D9




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Another Newbie in distress :-)
  1999-10-24  0:00       ` David Botton
  1999-10-24  0:00         ` Ehud Lamm
  1999-10-24  0:00         ` Guy Cohen
@ 1999-10-28  0:00         ` Charles Hixson
  1999-10-28  0:00           ` David Botton
  2 siblings, 1 reply; 17+ messages in thread
From: Charles Hixson @ 1999-10-28  0:00 UTC (permalink / raw)


Those are nice distinction.  I'm going to check the differences in
implementation between heterogeneous and homogeneous.

But the one that bothers me is "Storage Pools". Intuitively a storage pool
is essentially a block of storage that is allocated and freed, however...
If I remember my spec's correctly, anything that is declared in the package
declaration exists permanently from the time that the package in called.
This means that the reference to the storage pool would never get freed.  Or
it means that I don't understand what a storage pool is (likely).

I really don't want to go around implementing garbage collectors.  Reference
counters won't collect networks (trees, ok,  lattices, ok, but not
networks).  The only thing that looks like it would do the job is mark and
sweep, but that's much better when done inside the language.  Storage pools
might be able to do the job, but they would need to release their storage
when the last external reference disappeared.  If they don't, then I get a
viscious memory leak.  I've seen several references to storage pools, but
haven't found a good source of info.

David Botton wrote:

> May also be found at:
>
> Heterogeneous, Reference-Counted Lists (Heaney)
> http://www.adapower.com/alg/hetroref.html
>
> Homogeneous, Reference-Counted Lists (Heaney)
> http://www.adapower.com/alg/homoref.html
>
> > Use the search engine to find "list" in the subject line.  The article
> > was titled "homogeneous lists", or something like that.






^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Newbie in distress :-)
       [not found] <7urnh6$4ov$1@news2.inter.net.il>
  1999-10-23  0:00 ` Newbie in distress :-) David C. Hoos, Sr.
@ 1999-10-28  0:00 ` Gautier
  1 sibling, 0 replies; 17+ messages in thread
From: Gautier @ 1999-10-28  0:00 UTC (permalink / raw)
  To: Guy Cohen

> How do I free the memory captured by my program by using linked lists at the
> end of the program?
> I will appreciate if someone will send a working example of it.

An example (maybe not the best way!)
  http://members.xoom.com/_XOOM/gdemont/uza_html/unz_huft__adb.htm#12_12

From...
  http://members.xoom.com/gdemont/unzipada.htm

HTH

Gautier




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Another Newbie in distress :-)
  1999-10-28  0:00         ` Another " Charles Hixson
@ 1999-10-28  0:00           ` David Botton
  0 siblings, 0 replies; 17+ messages in thread
From: David Botton @ 1999-10-28  0:00 UTC (permalink / raw)


As a start, there are a two articles related to storage pools on AdaPower:

* Garbage collection using the Storage_Size attribute (Botton)
http://www.adapower.com/lang/storage_size.html

* Memory Management with Storage Pools (Vo)
http://www.adapower.com/lang/mempool.html

Charles Hixson wrote in message <38188F8E.C3CCBFA4@mail.earthlink.net>...

>But the one that bothers me is "Storage Pools".






^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~1999-10-28  0:00 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <7urnh6$4ov$1@news2.inter.net.il>
1999-10-23  0:00 ` Newbie in distress :-) David C. Hoos, Sr.
     [not found]   ` <Pine.A41.3.96-heb-2.07.991023170713.120704A-100000@pluto.mscc.huji.ac.il >
1999-10-23  0:00     ` Matthew Heaney
1999-10-24  0:00       ` David Botton
1999-10-24  0:00         ` Ehud Lamm
1999-10-24  0:00           ` David Botton
1999-10-24  0:00         ` Guy Cohen
1999-10-28  0:00         ` Another " Charles Hixson
1999-10-28  0:00           ` David Botton
1999-10-23  0:00   ` Ehud Lamm
1999-10-24  0:00     ` Robert Dewar
1999-10-24  0:00       ` Aidan Skinner
1999-10-25  0:00         ` Ted Dennison
1999-10-24  0:00       ` Ehud Lamm
1999-10-25  0:00       ` Robert A Duff
1999-10-26  0:00         ` Aidan Skinner
1999-10-25  0:00   ` Ted Dennison
1999-10-28  0:00 ` Gautier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox