Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OO-Browser does not understand Lisp defstruct options?

7 views
Skip to first unread message

Jean-Louis Leroy

unread,
Jul 23, 2000, 3:00:00 AM7/23/00
to
When presented with this code:

(defstruct (test (:print-function my-print-test))
x)

(defun my-print-test (atest stream depth)
(print "ok" stream))


...oo-browser says "invalid feature entry, `[structure],-(test,
(defstruct (test'

Is this a known bug and does anybody have a solution? Tia...
--
Jean-Louis Leroy
http://users.skynet.be/jll

Rob Warnock

unread,
Jul 23, 2000, 3:00:00 AM7/23/00
to
Jean-Louis Leroy <j...@skynet.be> wrote:
+---------------

| (defstruct (test (:print-function my-print-test))
| x)
| (defun my-print-test (atest stream depth)
| (print "ok" stream))
|
| ...oo-browser says "invalid feature entry, `[structure],-(test,
| (defstruct (test'
+---------------

Neither CLISP nor CMUCL has any problem with it [except that picky ol'
CMUCL complains if you don't have a (declare (ignorable atest depth))]:

> (defstruct (test (:print-function my-print-test))
x)

TEST


> (defun my-print-test (atest stream depth)

(declare (ignorable atest depth))
(print "ok" stream))
MY-PRINT-TEST
> (make-test :x 37)
"ok"
>


-Rob

-----
Rob Warnock, 41L-955 rp...@sgi.com
Applied Networking http://reality.sgi.com/rpw3/
Silicon Graphics, Inc. Phone: 650-933-1673
1600 Amphitheatre Pkwy. PP-ASEL-IA
Mountain View, CA 94043


Erik Naggum

unread,
Jul 23, 2000, 3:00:00 AM7/23/00
to
* Jean-Louis Leroy <j...@skynet.be>

| Is this a known bug and does anybody have a solution? Tia...

I don't use OO-Browser, but it shouldn't be too hard to find the
place where it picks out the name of the struct, unless it uses
regexps to do it, of course, and test for a list and if so, use its
first element, instead of the whole thing. From the error message,
it looks like it uses regexps, which would provide yet another good
example of why using regexps is the wrong solution in the general
case and real parsing is not replaceable with regexps hacks. If it
does use regexps, all hope is probably lost, and you have rewrite a
lot of hairy code to get a simple thing like this fixed.

#:Erik
--
If this is not what you expected, please alter your expectations.

Jean-Louis Leroy

unread,
Jul 23, 2000, 3:00:00 AM7/23/00
to
> If it does use regexps, all hope is probably lost, and you have
> rewrite a lot of hairy code to get a simple thing like this fixed.

I've started looking into it and it seems that the elisp part uses
regexps to parse the output of a C program (some version of
etags??). It looks like the problem is in there, in a function that
seems reasonably understandable. I'll try a couple of hours and post
my results in case of success.

OO-browser does look very nice.

0 new messages