I think the main issue is that `htdp/bsl/runtime` changed the way it
configures the printer. Instead of setting `current-print`, it sets
`global-port-print-handler`. Meanwhile, `interaction` prints within the
sandbox only if `current-print` is changed from its default value,
which is `pretty-print-handler`. Since the default value is in place
with the revised `htdp/bsl/runtime`, `global-port-print-handler` isn't
used for rendering results.

You can work around that problem by replacing

   (me '(current-print pretty-print-handler))

with

   (me '(current-print (lambda (v) (unless (void? v) (print v)))))


Meanwhile it seems that `htdp/bsl/runtime` was never configured to add
a `make-` prefix for printing structure instances. To fix that, after

    (call-in-sandbox-context me (lambda () (namespace-require module-lang)))

add

    (me '(require mzlib/pconvert))
    (me '(add-make-prefix-to-constructor #t))


At Mon, 8 Feb 2016 20:58:44 -0800 (PST), Suzanne Menzel wrote:
> Prior to v6.3, I was able to create a BSL evaluator with the following set up:
> 
> @(define-syntax-rule
>   (*sl-eval module-lang reader def ...)
>   ;; ===>>>                                        
>                                                            
>   (let ()
>     (define me (make-base-eval))
>     (me '(require (only-in racket empty? first rest cons? sqr true false)))
>     (me '(require lang/posn))
>     (me '(require racket/pretty))
>     (me '(current-print pretty-print-handler))
>     (me '(pretty-print-columns 65))
>     (me 'def)
>     ...
>     (call-in-sandbox-context me (lambda () (error-print-source-location #f)))
>     (call-in-sandbox-context me (lambda ()
>                                           ((dynamic-require 'htdp/bsl/runtime 
> 'configure)
>                                               (dynamic-require reader 
> 'options))))
>     (call-in-sandbox-context me (lambda () (namespace-require module-lang)))
> 
>     (interaction-eval #:eval me (require 2htdp/image))
>     (interaction-eval #:eval me (require 2htdp/batch-io))
>     ;; --- splice in the defs                      
>                                                            
>     me))
> 
> @(define-syntax-rule
>   (bsl-eval def ...)
>   (*sl-eval 'lang/htdp-beginner 'htdp/bsl/lang/reader def ...))
> 
> I would expect the following to show the results in the way they appear in 
> BSL:
> 
> @interaction[#:eval (bsl-eval)
> (cons 'a (cons 'b '()))
> (make-posn 1 2)
> ]
> 
> Instead of getting this (which is what I want):
> 
> > (cons 'a (cons 'b '()))     
> (cons 'a (cons 'b '()))
> > (make-posn 1 2)     
> (make-posn 1 2)
> 
> I'm now get this:
> 
> > (cons 'a (cons 'b '()))     
> '(a b)
> > (make-posn 1 2)     
> (posn 1 2)
> 
> Is there something about the set up that I need to change so that the output 
> syntax is consistent with BSL?
> 
> -- 
> 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.

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