From dmurdoch at pair.com  Sat Oct 11 01:12:50 2003
From: dmurdoch at pair.com (Duncan Murdoch)
Date: Sat Oct 11 01:20:22 2003
Subject: [Rd] An artifact of base being namespace
In-Reply-To: <16262.42910.138312.205452@gargle.gargle.HOWL>
References: <FC2BADAC-FA6E-11D7-92F4-0003931A3C9E@stat.wisc.edu>
	<16262.42910.138312.205452@gargle.gargle.HOWL>
Message-ID: <uteeov43hd0lg5bjd7k069kdku96oa00t0@4ax.com>

On Fri, 10 Oct 2003 14:35:42 +0200, you wrote:

>    Saikat> This is most problematic when you are creating a
>    Saikat> generic for an existing function in base (as you
>    Saikat> very well could for log). This often makes the
>    Saikat> ability to make new generics out of existing
>    Saikat> functions somewhat useless.
>
>Assuming you're right, I'm much less sure that this consequence
>has been intended in all situations.  But I'd need to see
>concrete examples to understand your last sentence.

I think this depends on whether we want all simple functions to act
like generics, or whether we want a distinction.  Does it ever matter
to a function in base like log10 whether log is a simple function or a
generic?

If so, then the current behaviour is right.  Whoever wrote those
functions back in the mists of time expected log to be a simple
function, so the namespace should guarantee that it stays as one until
explicitly changed within the namespace.

But if the distinction between generics and simple functions is only
for efficiency (dispatching a generic is slower), then I think the
generic should be created in the namespace where the simple function
was originally declared.  Then log10 would call the generic which
would dispatch to the newly created method for Saikat's data.

My feeling is that the latter is what we really want.

Duncan Murdoch


[Rd] An artifact of base being namespace
Duncan Murdoch