Package: graphene
Macro graphene:with-point
Lambda Listgraphene:with-point ((var &rest args) &body body) SyntaxArgumentsDetails The graphene:with-point macro allocates a new graphene:point-t instance, initializes the point with the given
values and executes the body that uses the point.
After execution of the body the allocated memory for the point is released. When no argument is given the components of the point are initialized to zero. The initialization with two single floats uses the graphene:point-init function. The initialization from another point is done with the graphene:point-init-from-point function. That is the default when no type specifier for the value is given. If the value has the type specifier graphene:vec2-t the point is initialized with the graphene:point-init-from-vec2 function. NoteExamples(graphene:with-point (p) (list (graphene:point-x p) (graphene:point-y p))) => (0.0 0.0) (graphene:with-point (p 1.5 1.7) (list (graphene:point-x p) (graphene:point-y p))) => (1.5 1.7)Use a vector for initialization of the point. (graphene:with-vec2 (v 3.5 4.5) (graphene:with-point (p (v graphene:vec2-t)) (list (graphene:point-x p) (graphene:point-y p)))) => (3.5 4.5) | See also |
2024-1-20