Hi Factor folks. It looks like Factor doesn't like it very much when  
you set types on tuple slots that refer back to the tuple type itself.  
Tuple types that directly reference themselves are rejected by the  
parser:
-- --
( scratchpad ) TUPLE: foo { bar foo } ;
1: TUPLE: foo { bar foo } ;
                            ^
bad-slot-attribute instance
"delegate" f
"key"      foo
-- --

Now, if you have a inheritance tree, you can define subclasses that  
recur over the superclass like this:
-- --
TUPLE: quadtree { bounds rect } ;

TUPLE: quadtree-node < quadtree
     { ll quadtree }
     { lr quadtree }
     { ul quadtree }
     { ur quadtree } ;

TUPLE: quadtree-leaf < quadtree point value ;
-- --

This appears to work at first. However, if you attempt to redefine  
"quadtree", say by reloading the file that defines it, something breaks:
-- --
( scratchpad ) TUPLE: quadtree { bounds rect } ;
Generic word error>> does not define a method for the array class.
Dispatching on object: { "kernel-error" 15 12 f }
-- --

Looks like two bugs: one in the VM that causes a segfault when  
redefining the recursive structure, and another in the commandline  
listener where it tries to call error>> when reporting the kernel- 
error array. At this point, factor dumps you back to the prompt. This  
is on Intel Leopard, latest git pull (as of 10:00 PM PST Tuesday).

-Joe


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to