a few cleanups to the porting guide
svn: r17652
This commit is contained in:
parent
857c3bbb17
commit
902dfc17ae
|
@ -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"]
|
||||
|
|
|
@ -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?)
|
||||
|
|
|
@ -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?)
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user