Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PLT Scheme scribble/lp first steps

1 view
Skip to first unread message

Slow Thought

unread,
May 23, 2010, 5:25:39 PM5/23/10
to
I'm trying to take my first steps in literate programming via Scheme.
The following works fine:

#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?

Eli Barzilay

unread,
May 23, 2010, 9:18:57 PM5/23/10
to
Slow Thought <slowt...@gmail.com> writes:

> 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!

Slow Thought

unread,
May 23, 2010, 9:53:55 PM5/23/10
to
On May 23, 8:18 pm, Eli Barzilay <e...@barzilay.org> wrote:

>
> 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!)

Eli Barzilay

unread,
May 24, 2010, 5:15:06 PM5/24/10
to
Slow Thought <slowt...@gmail.com> writes:

...and it's fixed now.

Slow Thought

unread,
May 26, 2010, 3:37:56 PM5/26/10
to
On May 24, 4:15 pm, Eli Barzilay <e...@barzilay.org> wrote:
>
> ...and it's fixed now.
>
Now that's customer service! Is it supposed to be #lang scheme behind
#lang scribble/lp?

Eli Barzilay

unread,
May 26, 2010, 9:09:02 PM5/26/10
to
Slow Thought <slowt...@gmail.com> writes:

Yeah -- IIRC, the plan was to make it customizeable but there wasn't
any need for anything beyond the `scheme' language yet.

0 new messages