Closed ghost closed 3 years ago
We can define function (same name) and variable in different code block. But when reference function and variable can influences every code block even in different scribble file.
define
Files like this .\content.scrbl .\complie_content.cmd .\common.rkt
.\complie_content.cmd
scribble content.scrbl
.\common.rkt
#lang racket (require scribble/core scribble/racket scribble/eval racket/syntax scribble/manual) (provide (all-defined-out) (all-from-out scribble/eval)) (define basic-eval (make-base-eval)) (interaction-eval #:eval basic-eval (require racket racket/base racket/list)) (define-syntax re (syntax-rules () [(_ #:eval . rest) (interaction #:eval . rest)] [(_ . rest) (interaction #:eval basic-eval . rest)]))
In content.scrbl
#lang scribble/doc @(require (for-label racket) scribble/manual "common.rkt") @re[ (define (foo x y z) 1) (foo 1 2 3) ] @re[ (define (foo x y z) 2) ] @re[ (foo 1 2 3) ] @re[ (define bar 1) ] @re[ bar ]
I read document but not found obvious way to avoid this. Is any method I can avoid this feature ? Thanks.
Can any of the code in your example be removed while still preserving the failure? Shorter failing programs are easier to debug.
We can
define
function (same name) and variable in different code block. But when reference function and variable can influences every code block even in different scribble file.Files like this .\content.scrbl .\complie_content.cmd .\common.rkt
.\complie_content.cmd
.\common.rkt
In content.scrbl
I read document but not found obvious way to avoid this. Is any method I can avoid this feature ? Thanks.