[cedet-semantic] Re: wrong-type-argument stringp semanticdb-table

"Eric M. Ludlam" <eric@...> writes:
>>>> drkm <darkman_spam@...> seems to think that:
>>Steve Kelem <steve.kelem@...> writes:
>>> As ugly as it is, I suggest prefixing all functions in a package with
>>> the package name.
>> Yes. And using aliases if it seems to be reasonable. It helps at
>>least to resolve conflicts, if not to reduce them.
> The function "class-name" is a part of Common Lisp which is why it is
> unprefixed by EIEIO.
Yes, I know. But Emacs Lisp is not Common Lisp. And developpers of
Emacs packages does not all know Common Lisp. So what is good is
Common Lisp may be not in Emacs Lisp.
The case of class-name is one that seems to be reasonable. But if
it was an alias of, say, eieio-class-name, it would be easier to
resolve a conflict with the CC Mode's class-name, when it appears.
IMHO.
--drkm

Hi,
> Eric or David, i think only the Backtrace of this posting is
> interesting for you...could you recognize any cedet-problem??
[...]
>>-----------------------------------------------------
>>The contents of the *Backtrace* buffer were
>>
>>Debugger entered--Lisp error: (wrong-type-argument stringp
>>semanticdb-table) string-match("/" semanticdb-table 0)
>>split-string(semanticdb-table "/")
>>class-name(semanticdb-table)
[...]
It looks like the problem is in the function `class-name' which is
defined like this in latest eieio.el (I checked that this definition
was also used in 0.18beta2):
(defun class-name (class)
"Return a Lisp like symbol name for CLASS."
(if (not (class-p class))
(signal 'wrong-type-argument (list 'class-p class)))
;; I think this is supposed to return a symbol, but to me CLASS is a
;; symbol, and I wanted a string. Arg!
(format "#<class %s>" (symbol-name class)))
What's weird is that it don't call `split-string'. The macro
`class-p' don't call it either. So, IMO, there is a conflict with a
`class-name' function provided by another package.
Could you, please, check that, and give us a feedback?
Regards
David

David PONCE wrote:
>Hi,
>
>
>>Eric or David, i think only the Backtrace of this posting is
>>interesting for you...could you recognize any cedet-problem??
>>
>>
>[...]
>
>
>>>-----------------------------------------------------
>>>The contents of the *Backtrace* buffer were
>>>
>>>Debugger entered--Lisp error: (wrong-type-argument stringp
>>>semanticdb-table) string-match("/" semanticdb-table 0)
>>>split-string(semanticdb-table "/")
>>>class-name(semanticdb-table)
>>>
>>>
>[...]
>
>It looks like the problem is in the function `class-name' which is
>defined like this in latest eieio.el (I checked that this definition
>was also used in 0.18beta2):
>
>(defun class-name (class)
> "Return a Lisp like symbol name for CLASS."
> (if (not (class-p class))
> (signal 'wrong-type-argument (list 'class-p class)))
> ;; I think this is supposed to return a symbol, but to me CLASS is a
> ;; symbol, and I wanted a string. Arg!
> (format "#<class %s>" (symbol-name class)))
>
>What's weird is that it don't call `split-string'. The macro
>`class-p' don't call it either. So, IMO, there is a conflict with a
>`class-name' function provided by another package.
>
>Could you, please, check that, and give us a feedback?
>
>Regards
>David
>
describe-function class-p
class-p is a Lisp macro in `eieio'.
(class-p CLASS)
Return t if CLASS is a valid class vector.
CLASS is a symbol. Defclass will assign the class symbol to itself, so
the shortcut (class-p foo) will work. The form (class-p 'foo) is more
robust.
locate-library eieio
Library is file
c:/Gnu/share/lib/emacs/site-lisp/cedet-1.0beta3b/eieio/eieio.elc
Here's the culprit:
describe-function class-name
class-name is a compiled Lisp function in `CC'.
(class-name &optional STR)
Gets the classname from the given string or the current buffer name.
The problem is that I have a macro package that I wrote to insert
doxygen-style comments in C++ programs.
Because of the flat namespace for emacs functions, my "class-name"
function clashed with the one in eieio. (Imagine that!)
I changed mine from class-name to cc-class-name, and the problem went away.
As ugly as it is, I suggest prefixing all functions in a package with
the package name.
RMS & others: Is there any other way to emulate namespaces in emacs lisp
packages?
Thanks for your help,
Steve

Steve Kelem <steve.kelem@...> writes:
> As ugly as it is, I suggest prefixing all functions in a package with
> the package name.
Yes. And using aliases if it seems to be reasonable. It helps at
least to resolve conflicts, if not to reduce them.
--drkm

"Eric M. Ludlam" <eric@...> writes:
>>>> drkm <darkman_spam@...> seems to think that:
>>Steve Kelem <steve.kelem@...> writes:
>>> As ugly as it is, I suggest prefixing all functions in a package with
>>> the package name.
>> Yes. And using aliases if it seems to be reasonable. It helps at
>>least to resolve conflicts, if not to reduce them.
> The function "class-name" is a part of Common Lisp which is why it is
> unprefixed by EIEIO.
Yes, I know. But Emacs Lisp is not Common Lisp. And developpers of
Emacs packages does not all know Common Lisp. So what is good is
Common Lisp may be not in Emacs Lisp.
The case of class-name is one that seems to be reasonable. But if
it was an alias of, say, eieio-class-name, it would be easier to
resolve a conflict with the CC Mode's class-name, when it appears.
IMHO.
--drkm