On Wednesday, August 30, 2017 at 2:39:04 PM UTC-4, dvanhorn wrote:
> How can I make definitions-area examples using the HtDP languages in 
> Scribble? 
> I tried the following, but since the evaluator corresponds to the 
> interactions-area, it complains about definitions not being allowed: 
> #lang scribble/manual 
> @(require racket/sandbox scribble/example) 
> @title{Notes} 
> @(define my-evaluator 
>    (parameterize ([sandbox-output 'string] 
>                   [sandbox-error-output 'string]) 
>      (make-evaluator '(lib "lang/htdp-beginner.ss")))) 
> @examples[ 
>  #:no-prompt 
>  #:eval my-evaluator 
>  (define (distance x y) (sqrt (+ (sqr x) (sqr y)))) 
>  (distance (distance 3 4) 5)] 

I just wanted to follow up on this since I still haven't been able to make 
HtDP-definitions-window examples work in Scribble.  I would like to be able 
to write something like this:

#lang scribble/manual
@(require racket/sandbox

@(define isl-eval
  (make-base-eval #:lang '(special intermediate-lambda)))

@title{An Example}

@examples[#:eval isl-eval
@#reader scribble/comment-reader (racketblock
;; factorial : Natural -> Natural
;; Compute n!
(check-expect (factorial 5) 120)
(define (factorial n)
  (cond [(zero? n) 1]
        [else (* n (factorial (sub1 n)))])))]

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 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to