[plt-scheme] MrFlow's snips-and-arrows library

From: Guillaume Marceau (gmarceau at cs.brown.edu)
Date: Sun Apr 6 19:49:31 EDT 2003

I am using the snip-and-arrows library to display typing relation on
top of the user's code. In some cases, I get the following exception:

   add-one-arrow-end: untacked arrow already exists

What does that means? Does it means I am using the interface
incorrectly? The documentation mentions a seventh generation long curse
for using the interface incorrectly. So naturally, I am a bit worried. ;)

The exception is thrown when I move the  mouse over some of the 
highlighted syntax, but not always.

This is how I initialize the library:

(init-snips-and-arrows-gui-for-syntax-objects
 (get-definitions-text)
 (lambda (label) 
   (let ([result
          (if (not (graph-node-mem? arrows label)) empty
            (append 
             (map 
              (lambda (succ) (list label succ
                              (graph-edge-label arrows label succ)))
              (graph-succs arrows label))
             (map
              (lambda (pred) (list pred label
                              (graph-edge-label arrows pred label)))
              (graph-preds arrows label))))])
     (debug "get arrows of" label ":" result)
     result))
                
 (lambda (label)
   (if (graph-node-mem? arrows label)
       (let ([s (make-object style-delta% 'change-weight 'bold)])
         (send s set-delta-foreground "red")
         s)
     (make-object style-delta% 'change-nothing))))


This is my debug dump:

get arrows of [syntax: 214:89] : (([syntax: 214:89] [syntax: 152:37] orange)) 
get arrows of [syntax: 214:89] : (([syntax: 214:89] [syntax: 152:37] orange)) 
get arrows of [syntax: 214:89] : (([syntax: 214:89] [syntax: 152:37] orange)) 
get arrows of [syntax: 214:48] : (([syntax: 152:10] [syntax: 214:48] green)) 
get arrows of [syntax: 214:48] : (([syntax: 152:10] [syntax: 214:48] green)) 
get arrows of [syntax: 214:48] : (([syntax: 152:10] [syntax: 214:48] green)) 
get arrows of [syntax: 214:48] : (([syntax: 152:10] [syntax: 214:48] green)) 
get arrows of [syntax: 154:33] : (([syntax: 154:33] [syntax: 141:21] orange) ([syntax: 152:37] [syntax: 154:33] orange)) 
get arrows of [syntax: 154:33] : (([syntax: 154:33] [syntax: 141:21] orange) ([syntax: 152:37] [syntax: 154:33] orange)) 
add-one-arrow-end: untacked arrow already exists

The first seven get-arrow worked, and the arrow appeared and
disappeared correctly. When I moved the mouse over to another piece of
syntax (syntax 154:33), I received the exception.

Thanks for any pointers.


-- 
  "In Google non est, ergo non est." 

- Guillaume




Posted on the users mailing list.