::

Gisp Documentation


[The development is: On going]

Documentation:

  • Gisp Macros

    • AnyifIf cond is true evaluates success, else evaluates fail.
      • Booleancond
      • Anysuccess
      • Anyfail
    • AnycondTakes couple of condition and body, evaluates conditions until finds something true and evaluates its paired body.
      • Booleancond1
      • Anybody1
      • Boolean...
      • Any...
    • FunctionlambdaCreates a function with params and body
      • Listparams
      • Anybody
    • FunctionAnyApplies the function f on each element of args
      • Functionf
      • argsSequence
    • NildefDefines a symbol with a value
      • Atomsymbol
      • Anyvalue
    • NildefnDefines a symbol with a function.
      • Atomsymbol
      • Listparams
      • Anybody
    • AnyprognEvaluates multiple bodies and returns the value of the last one.
      • Anybody1
      • Any...
    • AnyletBinds pairs of symbols and values, and then evaluates the body.
      • Listbinds
      • Anybody
    • AnyreduceEvaluates function with each element of seq and the result of the evaluation of it on the previous element. Starting with start as first result.
      • Functionfunction
      • Anystart
      • Sequenceseq
    • ListmapEvaluate the function on the sequence seq returning a list of evaluated elements.
      • Functionfunction
      • Sequenceseq
    • ListfilterFilter a sequence seq evaluating function on each element of seq and returning only the ones evaluating the function to true.
      • Functionfunction
      • Sequenceseq
    • ListsortSort a sequence seq using function as comparator.
      • Functionfunction
      • Sequenceseq
    • AnydoseqProviding a sequence and a symbol in binds, evaluates body multiple times on each element of the sequence binded to the symbol. Returns the value of the last evaluation.
      • Listbinds
      • Anybody
    • AnyprofileEvaluate body and prints the tag and how much time the evaluation took. Returns the value of the evaluation.
      • Stringtag
      • Anybody
  • Gisp Core: Utilities

    • SequencepartitionSubdivide a sequence in groups of n elements incrementing by step
      • Numbern
      • Numberstep
      • Sequenceseq
    • SequenceflattenFlatten nested sequence into a single flat one
      • Sequencel
    • Sequencereplace-first-and-lastReplace the first and last elements of a sequence.
      • Sequenceseq
      • AnynewFirst
      • AnynewLast
  • Gisp Core: Points

    • PointpointCreates a Point with absolutes coordinates.
      • Numberx
      • Numbery
    • VecvecCreates a Vec structure with length len and direction dir in radians.
      • Numberlen
      • Numberdir
    • Numberpoint-distanceCalculate the distance between two Points.
      • Pointa
      • Pointb
    • Numberpoint-angleCalculate the angle between two Points.
      • Pointa
      • Pointb
    • Pointpoint-betweenCreates a new intermediate point between two Points pos is a floating number between 0 and 1 that defines. The distance between the two points. 0 returns point a,1 returns point b, 0.5 returns the middle point between a and b, etc...
      • Pointa
      • Pointb
      • Numberpos
    • Pointpoint-move-by-vectorCreates a new Point which is moved by a certain ammount in a certain direction defined by a Vector structure.
      • Pointp
      • Vecvect
    • voiddraw-pointDraw a point on the screen
      • Pointp
    • voiddraw-pointsDraw a points on the screen
      • PointListpoints
  • Gisp Core: Lines

    • LinelineCreates a Line joining points.
      • Pointa
      • Pointb
    • Numberline-slopeGet the slope of a line.
      • Linel
    • Pointline-intersectionGet the intersection point between two lines, uses infinite lines.
      • Linel1
      • Linel2
    • Booleanpoint-on-line?Checks if a point is on a line
      • Pointpoint
      • Lineline
    • Pointsegment-intersectionGet the intersection point between two lines, returns nil if l1 and l2 doesn't intersects.
      • Linel1
      • Linel2
    • Numberpoint-position-respect-lineGet the position of a point to a line. Returns 1, -1 or 0.
      • Pointp
      • Linel
    • Shapepoints-sort-clockwise-around-centroidSort a Point list of a Shape around its centroid.
      • Shapepoints
  • Gisp Core: Circles

    • voiddraw-circlesDraw a set of circles on the screen.
      • PointListpoints
      • Numberr
  • Gisp Core: Shapes

    • voidreg-shapeDraws a regular shape into the context.
      • Contextcontext
      • Pointcenter
      • Numberside
      • Numbersize
      • Numberangle
    • voiddraw-shapeDraw a shape on the screen.
      • PointListpoints
    • voiddraw-shapesDraw a set of shapes on the screen.
      • ShapeListshapes
    • Pointshape-centroidCalculate the centroid of the shape.
      • Shapepoints
    • Shapeshape-move-by-vectorMove a shape by a vector.
      • Shapeshape
      • Vecvect
  • Gisp Core: Paths

    • voiddraw-pathDraw a path on the screen.
      • PointListpoints
    • voiddraw-pathsDraw a list of Paths on the screen.
      • PathListpaths
    • Pathline-to-pathConvert a line to a segmented path.
      • Linel
      • Numbern
    • Pathpath-disposeDispose randomly a path through its segments.
      • Pathp
      • NumbernoiseX
      • NumbernoiseY
    • PointListchaikin-segmentSubfunction of path-smooth
      • Pointa
      • Pointb
      • Numberchaikin
    • path-smoothApproximate a Path with the chaikin subdivision algorythm, smoothing the original Path.
      • Pathpath
      • Numberiteration
      • Numberchaikin
  • Core: Math operations

    • Number+Adds all the number arguments
      • Numbern
      • Numbers...
    • Number-Subtracts all the number arguments
      • Numbern
      • Numbers...
    • Number*Multiplies all the number arguments
      • Numbern
      • Numbers...
    • Number/Divide all the number arguments
      • Numbern
      • Numbers...
    • NumberabsCalculate the abs of a radiant value
      • Numbern
    • NumbersinCalculate the sin of a radiant value
      • Numbern
    • NumbercosCalculate the cos of a radiant value
      • Numbern
    • NumberdsinCalculate the sin of a degree value
      • Numbern
    • NumberdcosCalculate the cos of a degree value
      • Numbern
    • NumberradTransform a degree value into radians
      • Numbern
    • NumberdegTransform a radians value into degrees
      • Numbern
    • NumberintCasts a number to an integer value
      • Numbern
    • NumberfloorGet the floor value of a number
      • Numbern
    • NumberceilGet the ceil value of a number
      • Numbern
    • NumberminGet the minimum value of all the arguments
      • Numbern
      • Numbers...
    • NumbermaxGet the maximum value of all the arguments
      • Numbern
      • Numbers...
    • NumberpowCalculate the power of the first argument base with the second value as exponent
      • Numberbase
      • Numberexp
    • NumbermodCalculate the modulo
      • Numbern
      • Numberdiv
    • NumbersignGet the sign of a number
      • Numbern
    • NumbersqrtCalculate the square root of a number
      • Numbern
    • NumberlogCalculate the natural log of a number
      • Numbern
    • Numberlog10Calculate the log base 10 of a number
      • Numbern
    • Numberatan2Calculate the atan2 of an X and Y value
      • Numbery
      • Numberx
    • Numberbit-andBitwise and operator
      • Numbera
      • Numberb
    • Bool<Compare to number
      • Numbera
      • Numberb
    • Bool>Compare to number
      • Numbera
      • Numberb
    • Bool<=Compare to number
      • Numbera
      • Numberb
    • Bool>=Compare to number
      • Numbera
      • Numberb
    • ListrangeCreate a range list with all the number between min (default 0 if omitted) and a max
      • Numbermin
      • Numbermax
    • voidseedSets the starting point for the random number generator. seed paramter is random if not provided.
      • Numberseed
    • NumberrandGet a random number between min inclusive (default 0) and max exclusive
      • Numbermin
      • Numbermax
    • NumbergaussGet a random number weighted within a gaussian distribution
      • Numbercenter
      • Numberamplitude
    • Numbermandelbrot-pointCalculate the mandelbrot value of a specific point
      • Numbera
      • Numberb
      • Numbermax-iterations
      • Numberinfinity
    • NumberrescaleRescale a value from a min and max to a newmin and a newmax
      • Numbern
      • Numbermin
      • Numbermax
      • Numbernewmin
      • Numbernewmax
  • Core: List operations

    • ListconsCreate a cons structure between two atoms
      • Atoma
      • Atomb
    • ListlistCreate a list structure
      • Anya
      • Any...
    • AnycarGet the first element of a list
      • Listlist
    • ListcdrGet all but the first element of a list
      • Listlist
    • ListreverseReverse a list structure
      • Listlist
    • List/VectorconcatConcatenate two structures together
      • List/Vectora
      • List/Vectorb
    • List/VectorappendAppends an item at the end of an existing collection
      • List/Vectora
      • Anyb
    • List/VectorinsertInsert an item at the front of an existing collection
      • List/Vectora
      • Anyb
    • AnyfirstGet the first element of a list
      • Lista
    • AnylastGet the last element of a list
      • Lista
    • Bool=Checks if the first two element are equal
      • Anya
      • Anyb
    • Boolnumber?Checks if the first argument is a number
      • Anya
    • Boolpair?Checks if the first argument is a pair
      • Anya
    • Boolsymbol?Checks if the first argument is an atom
      • Anya
    • Boolnil?Checks if the first argument is null
      • Anya
    • Boolnot-nil?Checks if the first argument is not null
      • Anya
    • BoolnotInvert a boolean value
      • Anya
    • BoolandApply AND between two booleans
      • Booleana
      • Booleanb
    • Boolempty?Checks if the first argument is an empty collection
      • Anya
  • Core: Strings

    • StringstrConcatenate strings together
      • Anya
      • Any...
  • Core: Data structures

    • VectorvectorCreates a vector
      • Anyval
      • Any...
    • VectorvectorConvert a list into a vector
      • Listval
    • HashMaphashmapCreate an hashmap structure from a set of keys and values
      • String/Keywordkey
      • Anyval
      • Any...
    • Vector/HashMapgetGet an element from a structure m at key k
      • Vector/HashMapm
      • String/Keywordk
    • List/VectortakeTake n elements from a collection coll starting from start
      • Numbern
      • Numberstart
      • List/Vectorcoll
    • List/VectordropDrop n elements from a collection coll
      • Numbern
      • List/Vectorcoll
    • NumbercountCounts the elements of a structure m
      • Vector/HashMapm
    • Vector/HashMapassocAssociate a value at the key in a structure m
      • Vector/HashMapm
      • String/Keywordkey
      • Anyvalue
  • Core: Cairo

    • Surfacemake-surfaceCreates a new surface of width w and height h
      • Stringpath
      • Numberw
      • Numberh
    • voidsurface-statusPrints the status of a surface s
      • Surfaces
    • Contextmake-contextCreate a context for a suraface
      • Surfaces
    • voidsurface-cleanClean a surface destroying it
      • Surfaces
    • voidlineDraw a line to a context
      • Contextc
      • Pointp1
      • Pointp2
    • voidcircleDraw a circle to a context
      • Contextc
      • Pointcenter
      • Numberradius
    • voidsurface-to-pngExport a surface to a png file
      • Surfaces
      • stringname
  • Gisp Core: Simplxe-noise

    • Generator (List of HashMaps)simplex-noiseCreate e simplex noise generator
      • Numberlargest
      • Numberpersistance
      • Numberstarting
    • Numbersimplex-noise-valueExtract a value from a previously defined generator at x and y
      • Generatorgenerator
      • Numberx
      • Numbery