Paste: is this expected dispatch order?

Author: kenanb
Mode: factor
Date: Thu, 28 Apr 2011 15:23:31
Plain Text |
TUPLE: t1 s1 s2 ;
TUPLE: t2 < t1 ;
PREDICATE: p1 < t1 s2>> ;
GENERIC: foo ( class -- print )
M: t1 foo drop "t1" ;
M: t2 foo drop "t2" ;
M: p1 foo drop "p1" ;


! "t2 new t >>s2" outputs "p1"
! dispatch order of generic word foo: { t1 t2 p1 }

Annotation: bug?

Author: kenanb
Mode: factor
Date: Thu, 28 Apr 2011 16:34:14
Plain Text |
( scratchpad ) TUPLE: t1 s1 s2 ;
TUPLE: t2 < t1 ;
TUPLE: t3 < t2 ;
PREDICATE: p1 < t1 s2>> ;
GENERIC: foo ( class -- print )
M: t1 foo drop "t1" ;
M: t2 foo drop "t2" ;
M: t3 foo drop "t3" ;
M: p1 foo drop "p1" ;

( scratchpad ) t3 new t >>s2

--- Data stack:
T{ t3 f f t }
( scratchpad ) foo

--- Data stack:
"p1"
( scratchpad ) 

New Annotation

Summary:
Author:
Mode:
Body: