- [Function]
(
rewrite-generation
pattern [fresh])
Returns an entire generation from a rewrite pattern as a list. If fresh is true then the generation is first rewritten before it is returned, otherwise the pattern's existing generation is returned. The default value of fresh is false.
Examples:
Example 1. Returning successive generations from a rewrite pattern.
(define pat1 (new rewrite :of '((a :-> (a b)) (b :-> c) (c :-> a)))) (rewrite-generation pat1) ⇒ (a) (rewrite-generation pat1 #t) ⇒ (a b) (rewrite-generation pat1 #t) ⇒ (a b c) (rewrite-generation pat1 #t) ⇒ (a b c a) (rewrite-generation pat1 #t) ⇒ (a b c a a b) (rewrite-generation pat1 #t) ⇒ (a b c a a b a b c) (rewrite-generation pat1) ⇒ (a b c a a b a b c)
See also:
rewrite
[Class]- Pattern classes [Topic]