comp.lang.ada
 help / color / mirror / Atom feed
From: Hyman Rosen <hyrosen@mail.com>
Subject: Re: Charles: Generic_Find
Date: Tue, 12 Nov 2002 08:48:13 -0500
Date: 2002-11-12T08:48:13-05:00	[thread overview]
Message-ID: <1037108893.573381@master.nyc.kbcfp.com> (raw)
In-Reply-To: <slrnat1er9.rg.randhol+news@kiuk0152.chembio.ntnu.no>

Preben Randhol wrote:
> Victor Porton wrote:
>>Why Generic_Find is generic? Why not just pass the predicate
>>as a function access? Doing so would avoid the need of
>>generic instantiation.
> 
> Doesn't sound to me like a good Ada solution to do that. Sounds more
> like C++

Hey! VP is commenting on Charles, which is based on the C++ STL,
whose version of find is a template. The C++ standard library
uses generic instantiation almost everywhere.

Anyway, in C++ the reason to have the predicate be generic is
the many varieties of objects that can stand in for a predicate.
It also introduces potentially significant optimization
opportunities, since for predicates, function call overhead can
easily dwarf the amount of computation done by the predicate
itself.




  reply	other threads:[~2002-11-12 13:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-11 17:16 Charles: Generic_Find Victor Porton
2002-11-12  8:07 ` tmoran
2002-11-12  8:27 ` Preben Randhol
2002-11-12 13:48   ` Hyman Rosen [this message]
2002-11-12 14:49     ` Frank J. Lhota
2002-11-13 19:31       ` Matthew Heaney
2002-11-13 19:19   ` Matthew Heaney
2002-11-14 10:03     ` Preben Randhol
2002-11-13 19:18 ` Matthew Heaney
replies disabled

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