Porting Postscript code to TRANSCRIPT

Dar Scott dsc at swcp.com
Sat Jan 17 03:00:22 EST 2004


On Saturday, January 17, 2004, at 12:05 AM, Alejandro Tejada wrote:

> But, this code was made in Postscript.
>
> If you understand Postscript,
>
> Could you explain me how did works this code?
>
> http://www.tinaja.com/text/fuzzybez.html

PostScript is like forth.  /x is a quote of a symbol.  A sequence in 
braces is a quoted code sequence.  def defines a command.  The commands 
are executed in order on a stack.

For example:

/delta1 {mat 2 get mat 0 get sub dup mul mat 3 get mat 1 get sub
  dup mul add sqrt} def

==>

function delta
   return sqrt( ((mat[2]-mat[0])^2) + ((mat[3]-mat[1])^2) )
end delta

That is not a full explanation, but it might help you in reading the 
code.

Dar Scott



More information about the use-livecode mailing list