#lang scheme
(define (define-U! . xy-pairs)
(set! U (list->vector
(let ((u null))
(let loop ((next-x (car xy-pairs))
(next-y (cadr xy-pairs))
(rest (cddr xy-pairs)))
(if (null? rest)
(list (make-rectangular next-x next-y))
(cons (make-rectangular next-x next-y)
(loop (car rest)
(cadr rest)
(cddr rest)))))))))
(define U null)
The following does not:
#lang scribble/lp
@chunk[ <define-U!>
(define (define-U! . xy-pairs)
(set! U (list->vector
(let ((u null))
(let loop ((next-x (car xy-pairs))
(next-y (cadr xy-pairs))
(rest (cddr xy-pairs)))
(if (null? rest)
(list (make-rectangular next-x next-y))
(cons (make-rectangular next-x next-y)
(loop (car rest)
(cadr rest)
(cddr rest)))))))))
(define U null)]
The error is: expand: unbound identifier in module in: xy-pairs
It seems very straightforward to me. What does or doesn't scribble/lp
see?
> I'm trying to take my first steps in literate programming via
> Scheme. The following works fine:
> [...]
>
> The following does not:
>
> #lang scribble/lp
> @chunk[ <define-U!>
> (define (define-U! . xy-pairs)
> [...])
> (define U null)]
>
> The error is: expand: unbound identifier in module in: xy-pairs It
> seems very straightforward to me. What does or doesn't scribble/lp
> see?
It looks like there's a bug with a dotted rest argument which causes
this. (Otherwise your code should have worked fine.)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!
>
> It looks like there's a bug with a dotted rest argument which causes
> this. (Otherwise your code should have worked fine.)
>
Then I'm sane! I knew it (shhh, I'm talking!)
Yeah -- IIRC, the plan was to make it customizeable but there wasn't
any need for anything beyond the `scheme' language yet.