scsh-users
[Top] [All Lists]

Functional PostScript

To: scsh@zurich.csail.mit.edu
Subject: Functional PostScript
From: stktrc <stktrc@yahoo.com>
Date: 20 Nov 2003 11:28:09 +0100
Sender: news <news@sea.gmane.org>
Shouldn't the following two code snippets produce the same output in
Functional PostScript (1.0)?

(define (foo1)
  (translate 100 100
   (let ((l (scale 2 2 (line (pt 0 0) (pt 1 0)))))
     (compose l l))))

(define (foo2)
  (translate 100 100
   (compose (scale 2 2 (line (pt 0 0) (pt 1 0)))
            (scale 2 2 (line (pt 0 0) (pt 1 0))))))

Their outputs differ in the following way:

--- foo1.ps             Thu Nov 20 11:21:47 2003
+++ foo2.ps             Thu Nov 20 11:21:41 2003
@@ -18,7 +18,7 @@
  save 2 2 sca
  0 0 l
  1 0 l
- set 100 100 m
+ set 0 0 m
  save 2 2 sca
  0 0 l
  1 0 l

It only shows up if there is a transformation involved and it doesn't
matter if it's a scale, rotate or translate.


<Prev in Thread] Current Thread [Next in Thread>