-
Notifications
You must be signed in to change notification settings - Fork 1
Purl Language Reference
nanki edited this page Sep 13, 2010
·
2 revisions
Reverse polish notation separated by colon.
- Number
- ex. 1, -1.5, 1E3
-
- Operator
- ex. mul, to.png
-
- String
- You can use “::” for single colon(“:”) in string literal.
ex. (Hello World), (http:://www.yahoo.com/)
- op1 op2 swap op2 op1
- swap two values on the stack.
-
- op pop
- pop the top element of the stack.
-
- … n get result
- get n-th element from the top of the stack.
-
- … n pull result
- bring the n-th element from the top of the stack to the top.
-
- … n length slice result
- bring the elements starting at n-th element to the top for length elements.
-
- op dup op op
- duplicate op.
-
- … n reverse result
- reverse the top n elements.
-
- … m n stripe result
- encode the top m × n elements into m × n matrix, transpose it and serialize it into n × m elements.
- image to.png binary content-type
- convert image to PNG stream.
- image to.jpg binary content-type
- convert image to JPEG stream.
- image to.jpeg binary content-type
- convert image to JPEG stream.
- image to.gif binary content-type
- convert image to GIF stream.
- … n to.json binary content-type
- pack last n elements to JSON array.
- id load image
- load image from database.
- image geom image width height
- image x y width height crop image
- image angle rotate image
- image x1 y1 x2 y2 extend image
- image1 image2 composite image
- composite two images.
- image radius blur image
- image radius shadow image
- image radius round image
- image opacity opacify image
- image radius dropshadow image
- is swap:dup:2:pull:shadow:swap:composite
- image width height resize image
- resize image.
-
- image width height resize.upto image
- resize image preserving aspect ratio.
-
- image width height resize.fitto image
- resize image preserving aspect ratio.
- image large image
- image medium image
- image small image
- op1 op2 add result
- op1 + op2
-
- op1 op2 sub result
- op1 – op2
-
- op1 op2 mul result
- op1 * op2
-
- op1 op2 div result
- op1 / op2
-
- op1 op2 mod result
- op1 mod op2
- width height ctx context
- prepare cairo surface and return context.
-
- context ctx image
- rendering to image.
-
- context r g b rgb context
- set current color.
-
- context width linewidth context
- set line-width.
-
- context x y moveto context
- move current point to x, y.
-
- context x y lineto context
- line to x, y.
-
- context x y radius angle1 angle2 arc context
- context x y radius angle1 angle2 arc.cw context
- add arc to current path. begins at angle1(degree) to angle2(degree) clockwise.
-
- context x y radius begin end arc.ccw context
- add arc to current path. begins at angle1(degree) to angle2(degree) counterclockwise.
-
- context x y radius circle context
- add circle to current path.
-
- context stroke context
- draw current path.
-
- context fill context
- fill current path.
- ( operators )
- define macro.
- … macro call result
- expand macro.
- … macro n times result
- expand macro n times.
- … macro n each result
- expand macro after each of the top n elements.
- … macro m n each.n result
- expand macro after each group of m of the top n groups.
- … macro m n each.stripe result
- is equivalent to m n stripe macro m n each.n.
use Lambda module.
- op1 op2 num add.2 result1 result2
- op1 + num, op2 + num
-
- op1 op2 num sub.2 result1 result2
- op1 – num, op2 – num
-
- op1 op2 num mul.2 result1 result2
- op1 * num, op2 * num
-
- op1 op2 num div.2 result1 result2
- op1 / num, op2 / num
-
- op1 op2 num mod.2 result1 result2
- op1 mod num, op2 mod num