using #lang Plait, I have defined these two types:

(define-type Property
  (property [name : Symbol]
            [value : (Boxof Symbol)]))

(define-type Tag
   [name : String]
   [id : String]
   [properties : (Listof Property)]
   [value : Content-Type]
   [children : (Boxof (Listof Tag))]))

I also defined an instances of types Property and Tag as follows:

(define r (property 'color (box 'red)))
(define b (property 'color (box 'blue)))
(define g (property 'color (box 'green)))
(define s (property 'size (box '50s)))

(define t2 (tag "div" "2"
                (list r s)
                (text "This is a text")
                (box empty)))

(define t3 (tag "div" "3"
                (text "This is a text")
                (box empty)))

(define t1 (tag "div" "1"
                (list r s)
                (text "This is a text")
                (box (list t2 t3))))

Now, I want to define a function (insert-tags-in-tag : Tag -> (Listof Tag) 
->Tag), that, say, inserts t2 and t3 in t1 as children.
I can do that, if I know how to access children field of the Tag type.

The signature of my function is:
(define (insert-tags-in-tag (t1  (list t2 t3))

I can't make the implementation of the (...), as I am trying to see if 
Plait provides an accessor function for the fields. Otherwise, I guess, I 
will need to implement my own interp. 
I think I searched the documentation, but couldn't find mention for such a 

Appreciate your help.

You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to