[plt-scheme] Newbie macro problem
Cool, you're working on a genetic programming
compiler! I guess you got the idea from the genetic
algorithm scheduler developed by the Rice compiler
group?
http://softlib.rice.edu/MSCP/publications.html
Noel
--- John Clements <clements at brinckerhoff.org> wrote:
> Oh, piffle. Have you seen my new compiler?
>
> (define (my-compiler input desired-result)
> (let outer-loop ()
> (let ([compiled
> (let loop ()
> (case (random 3)
> ((0) null)
> ((1) (random-symbol))
> ((2) (cons (loop) (loop)))))])
> (try-compiled compiled desired-result)
> (outer-loop))))
>
> (define (try-compiled sexp desired-result)
> (when (equal? (eval sexp) desired-result)
> (begin (printf "is this the s-expression you're
> looking for?\n~v\n"
> sexp)
> (abort))))
__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/