Google 그룹스는 더 이상 새로운 유즈넷 게시물 또는 구독을 지원하지 않습니다. 과거의 콘텐츠는 계속 볼 수 있습니다.

OO-Browser does not understand Lisp defstruct options?

조회수 7회
읽지 않은 첫 메시지로 건너뛰기

Jean-Louis Leroy

읽지 않음,
2000. 7. 23. 오전 3:00:0000. 7. 23.
받는사람
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

읽지 않음,
2000. 7. 23. 오전 3:00:0000. 7. 23.
받는사람
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

읽지 않음,
2000. 7. 23. 오전 3:00:0000. 7. 23.
받는사람
* 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

읽지 않음,
2000. 7. 23. 오전 3:00:0000. 7. 23.
받는사람
> 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개