[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Do we have to worry about the names of generic functions?
From: |
Andreas Rottmann |
Subject: |
Re: Do we have to worry about the names of generic functions? |
Date: |
Thu, 13 May 2004 20:08:54 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) |
Rob Browning <address@hidden> writes:
> Andreas Rottmann <address@hidden> writes:
>
>> Yes, but when the non-generic are procedures, you can "upgrade" them:
>>
>> (define quit (ensure-generic quit))
>
> Hmm, but since you really don't know about all the other modules out
> there, it seems like the safest thing when using really general names
> might be to do this for all of your exported generics. Although that
> feels a bit crufty, and I presume still doesn't protect you from
> exports that aren't a procedure or a method.
>
You'd only do the above when you *know* a module imported has
e.g. "quit". You can't do much about stuff in modules you don't
import; I wonder what "#:generics merge" does when it encounters a
procedure and generic that have the same name...
That aside, another reason I think prefixes are basically unecessary
is that the importer can always do something like
(use-modules ((g-wrap) #:renamer (symbol-prefix-proc 'gw:)))
if he insists on prefixed names. You could do something even more
fancy like prefixing only the non-class symbols (i.e. those not like
<FOO>).
Andy
--
Andreas Rottmann | address@hidden | address@hidden | address@hidden
http://yi.org/rotty | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62
Make free software, not war!
Re: Do we have to worry about the names of generic functions?, Rob Browning, 2004/05/13