From 902dfc17aec5156b076f9e2cf2759c4738772c47 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 14 Jan 2010 18:39:23 +0000 Subject: [PATCH] a few cleanups to the porting guide svn: r17652 --- .../teachpack/2htdp/scribblings/image.scrbl | 1 - .../teachpack/2htdp/scribblings/port.scrbl | 47 ++++++++++++------- .../2htdp/scribblings/porting-guide.scrbl | 22 --------- .../teachpack/htdp/scribblings/world.scrbl | 10 +++- 4 files changed, 38 insertions(+), 42 deletions(-) delete mode 100644 collects/teachpack/2htdp/scribblings/porting-guide.scrbl diff --git a/collects/teachpack/2htdp/scribblings/image.scrbl b/collects/teachpack/2htdp/scribblings/image.scrbl index c501c3a1f6..f14f849731 100644 --- a/collects/teachpack/2htdp/scribblings/image.scrbl +++ b/collects/teachpack/2htdp/scribblings/image.scrbl @@ -838,4 +838,3 @@ The baseline of an image is the place where the bottoms any letters line up, not Two images are equal if they draw exactly the same way, at their current size (not neccessarily at all sizes). -@include-section["porting-guide.scrbl"] diff --git a/collects/teachpack/2htdp/scribblings/port.scrbl b/collects/teachpack/2htdp/scribblings/port.scrbl index 518af14d03..b000d2c440 100644 --- a/collects/teachpack/2htdp/scribblings/port.scrbl +++ b/collects/teachpack/2htdp/scribblings/port.scrbl @@ -5,9 +5,10 @@ scribble/manual (for-label scheme (prefix-in htdp: teachpack/htdp/world) + (prefix-in htdp: htdp/image) (prefix-in 2htdp: teachpack/2htdp/universe) - (only-in lang/htdp-beginner check-expect) - 2htdp/image)) + (prefix-in 2htdp: 2htdp/image) + (only-in lang/htdp-beginner check-expect))) @; ----------------------------------------------------------------------------- @@ -31,14 +32,14 @@ In this document, we explain how to port programs that assume the old world @(begin #reader scribble/comment-reader (schemeblock -(require htdp/world) +(require #,(schememodname htdp/world)) )) @; --------------------------------- @(begin #reader scribble/comment-reader (schemeblock -(require 2htdp/universe) -(require htdp/image) +(require #,(schememodname 2htdp/universe)) +(require #,(schememodname htdp/image)) )) ] The table shows the old style on the left and the new style on the @@ -64,7 +65,7 @@ Here is the first program from the documentation for the world teachpack: @(begin #reader scribble/comment-reader (schemeblock -(require htdp/world) +(require #,(schememodname htdp/world)) ;; Number -> Scene (define (create-UFO-scene height) @@ -99,13 +100,13 @@ Let us now convert this program into the universe setting, step by step, staring with the @scheme[require] specification, which is converted as above: @port[ -@schemeblock[(require htdp/world)] +@schemeblock[(require #,(schememodname htdp/world))] @; --------------------------------- @(begin #reader scribble/comment-reader (schemeblock -(require 2htdp/universe) -(require htdp/image) +(require #,(schememodname 2htdp/universe)) +(require #,(schememodname htdp/image)) )) ] @@ -211,21 +212,19 @@ couple of hours to do it. @; ----------------------------------------------------------------------------- @section{Porting Image Programs} -robby's section - using the new image library in isolation: @port[ @(begin #reader scribble/comment-reader (schemeblock -(require htdp/image) +(require #,(schememodname htdp/image)) )) @; --------------------------------- @(begin #reader scribble/comment-reader (schemeblock -(require 2htdp/image) +(require #,(schememodname 2htdp/image)) )) ] @@ -235,16 +234,28 @@ using the new image library with the universe teachpack @(begin #reader scribble/comment-reader (schemeblock -(require htdp/world) +(require #,(schememodname htdp/world)) )) @; --------------------------------- @(begin #reader scribble/comment-reader (schemeblock -(require 2htdp/universe) -(require 2htdp/image) -)) -] +(require #,(schememodname 2htdp/universe)) +(require #,(schememodname 2htdp/image)) +))] + +why switch(?): faster image comparison, added rotate, scale, and curves, plus a bunch of new polygon primitives +@schemeblock[(htdp:rectangle 10 10 "outline" "black") + (2htdp:rectangle 10 10 "outline" "black")] +changes: + +no pinholes (although they will reappear in a different form, eventually) + +overlay arguments reversed (added underlay) + +line drawing is slightly different (outlines are the same) (ellipses?) + +star function is different (bring back old star function?) diff --git a/collects/teachpack/2htdp/scribblings/porting-guide.scrbl b/collects/teachpack/2htdp/scribblings/porting-guide.scrbl deleted file mode 100644 index 18ec7c328d..0000000000 --- a/collects/teachpack/2htdp/scribblings/porting-guide.scrbl +++ /dev/null @@ -1,22 +0,0 @@ -#lang scribble/doc - -@(require scribble/manual - (for-label (prefix-in htdp: htdp/image) - (prefix-in 2htdp: 2htdp/image))) - -@title{Porting from @schememodname[htdp/image]} - -why switch(?): faster image comparison, added rotate, scale, and curves, plus a bunch of new polygon primitives - -@schemeblock[(htdp:rectangle 10 10 "outline" "black") - (2htdp:rectangle 10 10 "outline" "black")] - -changes: - -no pinholes - -overlay arguments reversed (added underlay) - -lines drawn probably different somewhere (ellipses?) - -star function is different (bring back old star function?) diff --git a/collects/teachpack/htdp/scribblings/world.scrbl b/collects/teachpack/htdp/scribblings/world.scrbl index 230ce20454..8fde24d887 100644 --- a/collects/teachpack/htdp/scribblings/world.scrbl +++ b/collects/teachpack/htdp/scribblings/world.scrbl @@ -16,7 +16,15 @@ `((cellspacing . "6") (height . "600") (width . "70%"))) - (list (list (list (make-paragraph "This teachpack is deprecated. Use 2htdp/universe instead."))))) + (list (list (list (make-paragraph + (list "This teachpack is deprecated. Use " + (schememodname 2htdp/universe) + " instead. See the" + " " (secref "htdp-port" + #:tag-prefixes '("2htdp") + ;#:doc '(lib "teachpack/teachpack.scrbl") + ) + " section for information on how to adapt old code to the new teachpack.")))))) @emph{Note}: For a quick and educational introduction to the teachpack, see @link["http://www.ccs.neu.edu/home/matthias/HtDP/Prologue/book.html"]{How