cawright.99
2018-10-23 11:54:19

@philip.mcgrath - a short example file #lang racket (struct foo (bar baz) #:transparent) (foo 'a 'b) (foo 'a (delay b)) fails with b:unbound identifier in: b but


philip.mcgrath
2018-10-23 17:39:42

@cawright.99 Your example doesn’t have a definition for b. Also, forgive me if you know this already, but 'b is the symbol named “b”, which doesn’t necessarily have anything to do with the value that might or might not be bound to the identifier b.


zenspider
2018-10-23 20:01:49

Took me a while to get this working… but:

(define-struct node (arc)                #:mutable #:transparent)
(define-struct arc (trigger destination) #:mutable #:transparent)

(shared ([s1 (make-node (make-arc 'some-trigger s2))]
         [s2 (make-node (make-arc 'some-other-trigger s1))])
  (values s1 s2))

zenspider
2018-10-23 20:02:20
#0=(node (arc 'some-trigger (node (arc 'some-other-trigger #0#))))
#0=(node (arc 'some-other-trigger (node (arc 'some-trigger #0#))))

cawright.99
2018-10-24 00:43:13

@philip.mcgrath - yes, that fragment was not meant to be posted - I worked out some stuff while writing it, and posted it with an abberant<CR>! :slightly_smiling_face: Thanks very much for your patient help. @zenspider I couldn’t get it working - now I see how you did it - again, thanks!