[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

You just found a wand of polymorphism (+2, cursed)




	I'm facing a bizare TEXT% and SNIP% behavior about wich I'm
seeking some insight.

	In an empty editor I insert a TEST-SNIP% object (derived from
the STRING-SNIP% class) and just after it I insert a plain
#\newline. When I get back the inserted snip (with find-snip), the
returned object is no longer a TEST-SNIP% instance: evaluating
« (is-a?  (find-snip 0 'after #f) test-snip%) » yields a #f. I
expected here to have my snip back as it was inserted.

	And now something stranger: if the snip is inserted alone
(without the trailing #\newline) then the same expression evaluates to
#t. At this point I doubt of my sanity.

	This behavior was observed with version 103 on unix. A sample
reproducing it is available at
<URL:http://hobbes.bsd-dk.dk/~elrond/snips-type.scm>.

	Also: how can I find the class of a given unknown object such
as the one I got back from FIND-SNIP?

	Thanks for you kind help.

-- 
%!PS        '(#<radical-libre> ("Bertrand Petit" . "elrond@phoe.frmug.org"))
297.6 420.9 translate 90 rotate 0 setgray gsave 0 1 1{pop 0 180 moveto 100
180 170 100 170 -10 curveto 180 -9 180 -9 190 -10 curveto 190 100 100 180
0 180 curveto fill 180 rotate}for grestore/Bookman-LightItalic findfont
240 scalefont setfont -151.536392 -63.7998886 moveto (bp)show showpage