Frink Changelog

What's new in Frink 2024-04-21

Apr 22, 2024
  • Fixed a "The frame is decorated" error that seems to be generated in newer versions of Swing if the background color is set multiple times.

New in Frink 2024-04-20 (Apr 21, 2024)

  • Added precision-preserving negate[x] function.
  • Added two different exponential fit functions to curveFit.frink. These allow you two different ways to fit an exponential curve to a data series.

New in Frink 2024-04-19 (Apr 19, 2024)

  • Added a new convenience method, graphics.caption[text, align="bottom", angle=0 degrees] to add quick text to the specified side of a graphics object. align is optional but defaults to "bottom". If specified, align must be one of the following strings: "top", "bottom", "left", or "right" indicating the side of the graphic where the text will be placed. See the Graphics with Text section of the documentation for more information.

New in Frink 2024-04-12 (Apr 12, 2024)

  • Added a function factorUnits[unit] which factors a unit into a array of [scale, dimensions] where scale is a dimensionless number indicating a scale and dimensions is a unit with scale of 1 and the basic dimensions of the original unit.

New in Frink 2024-03-18 (Mar 19, 2024)

  • The output of the methods[expr] function is now sorted.
  • Added a general image.applyKernel[array2d] method to apply an arbitrary filter / kernel to an image and return a new image. See the Image Methods documentation for more.

New in Frink 2024-02-27 (Feb 28, 2024)

  • Added image.edgeDetect[] which applies an edge detect filter to an image and returns a new image.

New in Frink 2024-02-26 (Feb 27, 2024)

  • Added image.unsharpMask[width, amount] which performs an unsharp mask on an image (sharpening the image) and returns a new image. Amount is usually 1 for 100% sharpening, but can be lower or higher.
  • Updated the final conversion factor for the British pound for 2023.

New in Frink 2024-02-24 (Feb 25, 2024)

  • Added image.gaussianBlur[width] which performs a Gaussian blur on an image and returns a new image.

New in Frink 2024-02-06 (Feb 6, 2024)

  • Fixed certain cases of VoxelArray.makeSupertoroid where the eccentricity of the smaller circle was a floating-point number that triggered numerical instability of the underlying algorithm. This often manifested as the inner part of the toroid not being rendered. See Frink's 3-D routines for more.

New in Frink 2024-02-03 (Feb 5, 2024)

  • Added methods img.mirrorX[] and img.mirrorY[] to flip an image horizontally or vertically. See the images documentation for more.

New in Frink 2024-01-21 (Jan 23, 2024)

  • Updated the sample program GeometricMedian.frink to find the point that minimizes the sum of the distances to other points.

New in Frink 2024-01-21 (Jan 22, 2024)

  • Updated the sample program GeometricMedian.frink to find the point that minimizes the sum of the distances to other points.

New in Frink 2023-12-31 (Jan 1, 2024)

  • Updated copyright dates for 2024. Happy New Year!
  • Updated sanity checks to 2024 for economic routines.
  • Updated calculations and predictions for deltaT for 2024. It is currently hardcoded to 69.175 s.
  • Released a new version of Frink: The Next Generation (version 2023-12-31). This merges all changes from the main branch.

New in Frink 2023-12-21 (Dec 25, 2023)

  • Added allShortestDistances[startNode] algorithms to Graph.frink, which finds all possible distances from the start node to all reachable nodes.

New in Frink 2023-12-20 (Dec 20, 2023)

  • Added Writer.printAndClose[expr] method to quickly write and close a file.

New in Frink 2023-12-10 (Dec 11, 2023)

  • Added function allEqual[list, target] Returns true if all of the items in the EnumeratingExpression list are equal to target. See the Enumerating Expression Functions sections of the documentation for more.

New in Frink 2023-12-02 (Dec 2, 2023)

  • Added string functions lastIndexOf[str, substr] and lastIndexOf[str, substr, startPos] . For more information, see the Substrings section of the documentation.

New in Frink 2023-11-27 (Nov 28, 2023)

  • Added set methods .copyAndPut[value] and .copyAndRemove[value]. For more information, see the Sets section of the documentation.

New in Frink 2023-11-26 (Nov 27, 2023)

  • Added algorithms for topological sort and all topological sorts to to Graph.frink, allowing you to create topological sorts or dependency graphs.
  • Updated the sample program GraphTest.frink with tests of topological sort and all topological sorts.

New in Frink 2023-11-18 (Nov 19, 2023)

  • Fixed the definition of the sverdrup. Thanks to Ken Mankoff for the report.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2023-11-13 (Nov 13, 2023)

  • Added permutationCount[m,n] function which returns the number of permutations of m things being taken n at a time, with order being important. This is sometimes called "mPn". This is equivalent to m!/((m-n)!) but calculated efficiently by calling factorialRatio[m,m-n] internally.

New in Frink 2023-10-30 (Oct 30, 2023)

  • Fixed a possible error in VoxelArray.makeSphere when coordinates were just so in Frink's 3-D routines.

New in Frink 2023-09-20 (Oct 30, 2023)

  • Added getBitBool[num, bit] function to return the specified bit of an integer as a boolean value.

New in Frink 2023-08-18 (Aug 19, 2023)

  • Added several functions for querying Unicode properties of characters and strings, for example, querying the Unicode block property. See the Unicode Properties section of the documentation for details.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2023-07-31 (Jul 31, 2023)

  • Added new dimension names electric_resistivity with dimensions ( ohm m ) and its reciprocal electric_conductivity with dimensions 1 / (ohm m) for use of bulk properties of materials (which is relevant to the current "superconductor" discussion.)

New in Frink 2023-07-01 (Jul 2, 2023)

  • Added a new, much more flexible planarEmboss method to Frink's VoxelArray class. These allow you to emboss a bitmap into the top of an object and add or remove from the surface of the object with variable depth based on the gray level of the pixels.. This lets, you, say, etch text or images or textures into an object. See Frink's 3-D routines. Also see the sample programs planarEmbossTest.frink for an example of its use.

New in Frink 2023-06-14 (Jun 15, 2023)

  • The parseInt[str, base] function can now take an array (or other enumerating expression) of strings as input.

New in Frink 2023-06-12 (Jun 13, 2023)

  • Fixed a problem in the jar file so the constraint solver classes could be constructed by name. Thanks to Hakan Kjellerstrand for the report.

New in Frink 2023-05-24 (Jun 12, 2023)

  • Added a new, much more flexible cylindricalEmboss method to Frink's VoxelArray class. These allow you to "wrap" a bitmap around any object and add or remove from the surface of the object with variable depth based on the gray level of the pixels.. This lets, you, say, etch text or images or textures into an object. See Frink's 3-D routines. Also see the sample programs cylindricalEmbossGrayTest.frink for an example of its use.
  • Added an unzip function to seperate the columns of an array or other enumerating expression into seperate arrays.
  • Fixed some formatting in MathML.frink which raised a ConformanceException when formatting some multiplication and exponentiation expressions which had units with dimensions as their first argument.
  • Added a first cut at a rudimentary Constraint Programming solver! This will be extended in the future. It is already able to solve some interesting constraint problems:
  • constraintAllDifferent.frink - Tests the allDifferent constraint.
  • constraintSudoku.frink and constraintSudokuTest.frink - Uses the allDifferent constraint to solve any Sudoku problem, no matter how difficult (and find all possible solutions if there are multiple solutions) in just a few lines of code.
  • constraintNQueens.frink - a solver for an arbitrarily-large N-queens problem.
  • constraintSorter.frink - demonstrates less than, greater than, equals constraints, etc.
  • Added the MathML.frink library to format Frink expressions in "standard" mathematical notation using the MathML standard (including stuff like square root symbols, stacked fractions, raised exponents, etc.) MathML Presentation has been supported in Firefox for a long time and was recently added to Google Chrome.
  • The amazing Frink system-of-equations solver and, to a lesser extent, the single-equation solver can now typeset equations in standard mathematical form using MathML and the above library! Just click the "MathML" button if your browser supports it!
  • For example, see this quadratic equation solver.
  • Added floodFill method to Frink's VoxelArray class. This allows you to fill an object and, say, compute its volume. See Frink's 3-D routines. Also see the sample program floodFillTest.frink for an example of its use.
  • Added cylindricalEmboss and sphericalEmboss methods to Frink's VoxelArray class. These allow you to "wrap" a bitmap around any object and add or remove from the surface of the object where the pixels in the bitmap are dark. This lets, you, say, etch text or images into an object. See Frink's 3-D routines. Also see the sample programs cylindricalEmbossTest.frink and sphericalEmbossTest.frink for an example of their use.
  • Added multiple coordinate transformations to Frink's graphics libraries. These allow you to convert between alt-azimuth, spherical, and cylindrical coordinates.
  • The Matrix.frink sample program has added and improved algorithms for calculating many decompositions of matrices including QR decomposition and calculating least-squares fit to a system of equations, allowing you to perform a best-fit algorithm to a curve.
  • Added sample programs LeastSquares.frink and LeastSquaresTest.frink to demonstrate fitting curves to arbitrary equations, and calculating the goodness of their fits.
  • Added a fast version of Floyd's algorithm to Graph.frink, allowing you to calculate the lengths of all shortest paths between all nodes in a graph in an efficient fashion.

New in Frink 2023-03-18 (Mar 20, 2023)

  • The initial value of all of the elements of a new Java array can be specified with the three-argument version of the function: newJavaArray[classname, length, initValue].

New in Frink 2023-01-30 (Jan 31, 2023)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.
  • Updated final UK currency data for 2022.
  • Refactored file-reading functions like read, readLines, and lines to allow reading from more Java data types including java.io.File, java.io.InputStream, and java.net.URL.
  • Added getSymbolsAsSymbols[expr] function.

New in Frink 2023-01-05 (Jan 6, 2023)

  • Added minmax[array] function to return the smallest and largest items in an array simultaneously. The return value is a two-item array [min, max]

New in Frink 2022-12-31 (Jan 2, 2023)

  • Updated copyright dates for 2023. Happy New Year!
  • Updated sanity checks to 2023 for economic routines.
  • Updated calculations and predictions for deltaT for 2023. It is currently hardcoded to 69.164 s.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.
  • Released a new version of Frink: The Next Generation (version 2022-12-31). This merges all changes from the main branch.
  • Released a new version of the frink-tng.war file from Frink: The Next Generation (version 2022-12-31).

New in Frink 2022-12-13 (Dec 13, 2022)

  • The International System of Units (SI) has been approved to have 4 new prefixes to extend beyond the yotta (1024) and the yocto (10-24). Frink now contains these prefixes in its standard data file.

New in Frink 2022-12-12 (Dec 13, 2022)

  • Updated the new library for processing graphs (graphs in the graph-theoretical sense of an object with nodes and edges) called Graph.frink to have sanity checks for all of the findShortestPath... algorithms to ensure that the start node and end node are actually in the graph.
  • In addition to the above, all of the findShortestPath... algorithms now reliably return undef if there is no path from the start node to the end node. Previously, they could loop forever or throw errors inside the methods.
  • Updates to the Tree.frink sample library for tree manipulation and traversal include a dump method to print an indented text representation of a Tree's structure.

New in Frink 2022-12-08 (Dec 9, 2022)

  • Important: Fixed a potential problem when calling from a class method to a function outside the class. In some cases, the class's internal variables could be accidentally modified. Please update as soon as possible.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.
  • Released a new version of Frink: The Next Generation (version 2022-12-08). This merges all changes from the main branch.
  • Released a new version of the frink-tng.war file from Frink: The Next Generation (version 2022-12-08).

New in Frink 2022-12-04 (Dec 4, 2022)

  • Array.transpose[] no longer fails on an empty array.
  • Added knapsack.frink and knapsackTest.frink sample programs with solvers for various versions of the Knapsack Problems (which are about fitting the most valuable items into a knapsack of fixed capacity.)
  • I have a feeling that the Advent of Code problems will have a knapsack-packing problem this year. Day 3 was about rucksacks...
  • Updates to the Tree.frink sample library for tree manipulation and traversal include an API change for traversing trees.

New in Frink 2022-10-20 (Nov 21, 2022)

  • The Matrix.frink sample program has added and improved algorithms for calculating many decompositions of matrices including the Cholesky-Crout and Cholesky-Banachiewicz decompositions, and calculating transpose and conjugate operations.

New in Frink 2022-11-15 (Nov 16, 2022)

  • Updated the TLS/SSL certificates for frinklang.org. Please let me know if you find anything that's not working.

New in Frink 2022-11-04 (Nov 5, 2022)

  • Updated the definition of the unit gasoline to match U.S. EPA definitions for the MPGe (miles per gallon electric). The MPGe was defined to be the number of miles that can be traveled by an electric vehicle using 33.7 kWh of energy. This changes the energy density in the unit gasoline from 1.4e8 J/gallon (which is about 38.88 kWh/gallon) to 33.70 kWh/gallon.
  • The previous definition may have been more accurate for very efficient combustion of gasoline, but this makes it match with EPA definitions and the MPGe. Please see the standard data file for more information about this change and to see current uncertainties and historical variations in the energy content of gasoline and other fuels.
  • Added the MPGe and its synonym mpge (for symmetry with the existing all-lowercase mpg) to represent miles per gallon electric. This unifies the current definition of the unit gasoline to match the MPGe.

New in Frink 2022-10-18 (Oct 18, 2022)

  • The method array.shuffle[] now returns the shuffled array so methods can be chained.
  • The trim[string] function can now be applied to arrays of strings.
  • Improved the error message and removed an exception when trying to verify that a class implements an interface when the class implements no interfaces.

New in Frink 2022-10-10 (Oct 10, 2022)

  • Updated sanity checks for Java 18 and 19.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-09-28 (Sep 28, 2022)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-09-18 (Sep 19, 2022)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-09-12 (Sep 13, 2022)

  • Added a readBytes[url] function to read to an array of byte.
  • Made some (hopefully invisible) internal changes to the read function for better error-handling.
  • Fixed three-argument function base64Encode[expression, encoding,lineLength] to work correctly when expression is a Java array of bytes and the encoding is undef.

New in Frink 2022-09-11 (Sep 11, 2022)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-09-08 (Sep 9, 2022)

  • Added getColumn and setColumn methods and functions for two-dimensional arrays. See the Column Operations section of the documentation for more details.

New in Frink 2022-09-04 (Sep 5, 2022)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-08-28 (Aug 29, 2022)

  • Updated the new library for processing graphs (graphs in the graph-theoretical sense of an object with nodes and edges) called Graph.frink with Prim's algorithm for finding a minium spanning tree and Kruskal's algorithm for finding a minimum spanning forest. This update also adds many new functions for iterating through edges in a graph and a copy constructor.
  • Updated the sample program GraphTest.frink with tests of Kruskal's algorithm, and many improvements to readability of other tests.

New in Frink 2022-08-23 (Aug 24, 2022)

  • Updated the new library for processing graphs (graphs in the graph-theoretical sense of an object with nodes and edges) called Graph.frink with the breadth-first algorithm for finding the shortest path in a graph that has all equal weights.
  • Updated the sample program GraphTest.frink with tests of the breadth-first shortest-path algorithm.

New in Frink 2022-07-31 (Aug 1, 2022)

  • Added functions mostCommon[vals] and leastCommon[vals] which are specializations of the countToArray[vals] that only return the most or least common item(s) in a collection. See the Enumerating Expression Functions sections of the documentation for more.
  • Released a new version of Frink: The Next Generation (version 2022-06-09). This merges all changes from the main branch.

New in Frink 2022-07-25 (Jul 26, 2022)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-06-30 (Jul 1, 2022)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-06-11 (Jun 12, 2022)

  • Added a missing class to the jar file.

New in Frink 2022-06-09 (Jun 10, 2022)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-06-07 (Jun 8, 2022)

  • Added columnize[array, columns] function which turns a one-dimensional array (or enumerating expression) into a two-dimensional array with columns number of columns. This can be used with the table formatting functions above to pretty-print a large array in columns for display. See the Formatting Tables section of the documentation for details.

New in Frink 2022-05-23 (May 24, 2022)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-05-05 (May 5, 2022)

  • Updated links in the FAQ to more modern NIST Handbooks and fixed internal links in Special Publication 811. NIST Handbook 133 apparently supersedes NIST Handbook 44.
  • Added paintAlongHull method to Frink's VoxelArray class. This allows you to move a tool along the hull of a 3-D object, adding or removing material from the object and making larger or smaller. This can be used to give a "rounded" shape and is similar to the Minkowski sum method in tools like OpenSCAD. See Frink's 3-D routines.
  • Released a new version of Frink: The Next Generation (version 2022-05-05). This merges all changes from the main branch.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-04-27 (Apr 27, 2022)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-04-18 (Apr 19, 2022)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-04-01 (Apr 2, 2022)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.
  • Released a new version of Frink: The Next Generation (version 2022-04-01). This merges all changes from the main branch.

New in Frink 2022-03-16 (Mar 17, 2022)

  • Added function URLDecode[str, encoding="UTF8"] to decode part of a URL.
  • Added default encoding "UTF8" to the function URLEncode[str, encoding="UTF8"] to encode part of a URL.

New in Frink 2022-03-13 (Mar 14, 2022)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.
  • Added function lcm[array] which returns the least common multiple of an array (or enumerating expression) of integers.
  • Added function gcd[array] which returns the greatest common denominator of an array (or enumerating expression) of integers.

New in Frink 2022-03-10 (Mar 11, 2022)

  • The range operator can now take single-character strings as bounds.

New in Frink 2022-03-09 (Mar 10, 2022)

  • Added a formatMatrixCompact function which can format a table with Unicode bracket characters making traditional matrix brackets surrounding it. This is smaller than formatMatrix. See the Formatting Tables section of the documentation for details.

New in Frink 2022-03-02 (Mar 3, 2022)

  • Fixed an issue in the cached currency file which caused currency conversions not to read from cache.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-02-21 (Feb 22, 2022)

  • Updated Historical British Price Data for the final data for the year 2021.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2022-02-14 (Feb 15, 2022)

  • Added a new constructor to construct a java.util.Comparator that uses a Frink function to perform the comparisons. See the Iterating over Java Collections section of the documentation for more.

New in Frink 2022-01-30 (Jan 31, 2022)

  • Added method dict.get[key, altValue=undef] which be used to look up the value corresponding to the key or return the alternate value altValue if the dictionary does not contain that key.
  • Added samples of sorting dictionaries by key or value.

New in Frink 2021-01-17 (Jan 18, 2022)

  • Made an improvement to greatCircleMap.frink which draws world maps centered on your location. The names of the countries are now centered around the untransformed polygon, making country names closer to the edge of the map to be located better.

New in Frink 2021-01-11 (Jan 12, 2022)

  • Fixed a null pointer exception in the nth function when requesting an item off the end of an enumerating expression.

New in Frink 2021-01-07 (Jan 8, 2022)

  • Reverted the recent change to char[array] that changed its behavior by returning an array of separate characters.

New in Frink 2021-12-31 (Jan 1, 2022)

  • Updated copyright dates for 2022. Happy New Year!
  • Updated sanity checks to 2022 for economic routines.
  • Updated calculations and predictions for deltaT for 2022. It is currently hardcoded to 69.294 s. USNO's servers that typically serve this information and predictions have been down for at least 27 months.
  • Released a new version of Frink: The Next Generation (version 2021-12-31). This merges all changes from the main branch.

New in Frink 2021-12-23 (Dec 24, 2021)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-12-19 (Dec 20, 2021)

  • Made CoordinateTransformer3DFloat.IDENTITY public. This class was very useful in Advent of Code 2021 Day 19.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-12-11 (Dec 12, 2021)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-12-04 (Dec 4, 2021)

  • Added single-argument method dict.increment[key] which is similar to the two-argument dict.increment[key, increment] but which always increments by 1.

New in Frink 2021-11-26 (Nov 26, 2021)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-11-14 (Nov 15, 2021)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-10-30 (Oct 30, 2021)

  • Added multiple convenience methods for creating cylinders from frink.graphics.Point3DFloat objects in Frink's VoxelArray class. See Frink's 3-D routines.

New in Frink 2021-10-29 (Oct 29, 2021)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-10-23 (Oct 24, 2021)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-10-17 (Oct 18, 2021)

  • Released a new version of Frink: The Next Generation (version 2021-10-17). This merges all changes from the main branch.

New in Frink 2021-10-14 (Oct 15, 2021)

  • Added function toASCIIHigh[str] to convert a string to a 7-bit ASCII safe representation that can be passed as input to Frink. This differs from the existing toASCII[str] in that it keeps high Unicode codepoints (above uFFFF as a single Unicode codepoint in a format that looks like u{1F384}.
  • Added several functions for querying Unicode properties of characters and strings, for example, querying the Unicode General Category property. See the Unicode Properties section of the documentation for details.

New in Frink 2021-10-10 (Oct 10, 2021)

  • Added isNegativeUnit[expr/I>] function which returns true if the expression is a unit of any kind (including dimensionless numbers) with a negative sign, false otherwise.
  • Updated the sample program, formatEquation.frink to print subtraction operations more like standard mathematical notation.

New in Frink 2021-10-06 (Oct 7, 2021)

  • Updated function formatBracketsCompact[expr] to format a table surrounded by Unicode square bracket characters, or ordinary square brackets if it fits into a single line. Brackets are now smaller (putting brackets only on the sides) and use better Unicode characters. See the FormattingTables section of the documentation for details.
  • Updated the sample program, formatEquation.frink, which demonstrates using table formatting functions to format equations into standard mathematical format, to use more compact brackets and parentheses.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-09-30 (Oct 1, 2021)

  • Added functions rotateLeft and rotateRight to rotate the bits of an integer left or right by a specified number of bits. See the Number Theory section of the documentation for more information.
  • Released a new version of Frink: The Next Generation (version 2021-09-30). This merges all changes from the main branch.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-09-25 (Sep 26, 2021)

  • Further updates to secant.frink to fix a divide-by-zero error in secant[x] in some cases. Thanks to Dr. Alberto Di Lullo for the bug report. Additional contributions to making these functions even more robust are welcome.
  • If you always want to sort a multi-dimensional array by column number, you can easily get an appropriate sorting function that sorts by a specified column by calling byColumn[int] and passing that as a sorting function. The column number is zero-based. For example, sort[list, byColumn[1]]. See the sorting section of the documentation for examples.

New in Frink 2021-09-24 (Sep 25, 2021)

  • Released a new version of Frink: The Next Generation (version 2021-09-24). This merges all changes from the main branch.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-09-22 (Sep 22, 2021)

  • Fixes to the exactSeasons program that calculates the equinoxes and solstices to high accuracy by adding a new function to secant.frink that works more correctly when finding angles around zero. This was causing autumnal equinox calculations that were off by exactly one hour.
  • Performance improvements for VoxelArray.makeSphere in Frink's VoxelArray class. See Frink's 3-D routines.

New in Frink 2021-09-17 (Sep 17, 2021)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.
  • Added libraries to generate screw threads for 3-D printing. These are available in the following files:
  • screwThreadsTest3Start.frink (generates a 3-start thread)
  • screwThreadsTest.frink (generates standard garden hose fittings)
  • screwThreads.frink (contains routines to parametrically generate screw threads)
  • parametric3D.frink (contains smart algorithms to move a tool based on a parametrized function in 3D.)

New in Frink 2021-08-24 (Aug 25, 2021)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-08-15 (Aug 16, 2021)

  • Added function< CODE>formatParensCompact[expr] to format a table surrounded by Unicode square bracket characters, or ordinary square brackets if it fits into a single line. See the FormattingTables section of the documentation for details.
  • Added a sample program, formatEquation.frink, which demonstrates a first cut at formatting equations into standard mathematical format.

New in Frink 2021-08-12 (Aug 13, 2021)

  • Added function getOperatorSymbol[expr] return the symbol for an expression that represents a mathematical operator like + or *. See the Other Functions section of the documentation for details.
  • Added functions formatParens[expr] and formatParensCompact[expr] to format a table surrounded by Unicode parenthees characters. See the FormattingTables section of the documentation for details.

New in Frink 2021-08-10 (Aug 11, 2021)

  • Added functions isOperator[expr] and getOperatorPrecedence[expr] to determine if an expression represents a mathematical operator like + or *. See the Other Functions section of the documentation for details.
  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-07-27 (Jul 27, 2021)

  • If you are using a Java data structure that puts Frink or Java data types into a data structure that needs a java.util.Comparator to perform the comparisons (e.g. java.util.PriorityQueue,) you can get Frink's default comparator (which follows the same semantics as Frink's three-way comparison operator <=> , you can get a java.util.Comparator by calling getDefaultComparator[]. Frink's default comparator will also compare Java objects that implement the java.util.Comparable interface so it can be used for Frink and Java data types.
  • Added new methods for creating solids of rotation to Frink's VoxelArray class, to create a variety of shapes. See Frink's 3-D routines.
  • See the sample program VoxelSolidOfRotation.frink for a demonstration of making solids of rotation. This program makes nice little 3-D nameplates or chopstick rests for 3-D printing.

New in Frink 2021-07-03 (Jul 3, 2021)

  • Updated the currency conversion source to work again. As always, the availability of internet-based sources cannot be guaranteed and this fix may be temporary.

New in Frink 2021-06-25 (Jun 26, 2021)

  • Fixed some VoxelArray functions to correctly use the new extended range allowed by the new BiggerBitSet implementation.
  • Added getNextSetBitIndex and getPreviousSetBitIndex methods to VoxelArray.
  • Added getMinSetZ and getMaxSetZ methods to VoxelArray.

New in Frink 2021-06-11 (Jun 12, 2021)

  • Rewrote many of the internals of VoxelArray for 3-D printing. Most importantly, it was rewritten to use an improved BitSet, called BiggerBitSet.
  • BiggerBitSet is an improvement on Java's java.util.BitSet class in a few ways:
  • BiggerBitSet uses long instead of int to address bits in its API which greatly increases the size of bits addresable. The implementation of BitSet allows a maximum number of pixels of (2^31 - 1) or 2147483647, which is about 2 billion pixels. If 3-D printing at a resolution of 0.1 mm/pixel, this gives a maximum size of about 5.07 inches on a side.
  • ((2^31-1))^(1/3) 0.1 mm -> in
  • This is not quite big enough to fit a modern 3-D printer's bed.
  • With this class's API, the number of pixels is increased by a factor of 64. The calculation is:
  • ((2^31-1) * 64)^(1/3) 0.1 mm -> in
  • which gives a cube of about 20 inches on a side. This is enough of an improvement to warrant the class.
  • BiggerBitSet does not not allow itself to be dynamically resized; this should give a performance improvement over BitSet. BitSet takes a lot of effort to check dynamic ranges, to validate invariants and resize with every set operation.
  • BiggerBitSet is constant across Java releases and implements functions (especially those to set a range of values quickly and efficiently) which did not exist in earlier versions of Java's BitSet.

New in Frink 2021-06-09 (Jun 10, 2021)

  • Released a new version of Frink: The Next Generation (version 2021-06-09). This merges all changes from the main branch.

New in Frink 2021-06-02 (Jun 2, 2021)

  • Added new functions for extruding while scaling and rotating polygons to Frink's VoxelArray class, to create a variety of shapes.

New in Frink 2021-05-30 (May 31, 2021)

  • Fixed writing of some special characters when writing graphics to HTML canvas format. For example, the ampersand character & was encoded incorrectly using HTML encoding rules instead of the necessary JavaScript encoding rules.

New in Frink 2021-05-21 (May 23, 2021)

  • Added several classes and functions for drawing parametric curves to Frink's VoxelArray class, to create a variety of shapes. See Frink's 3-D routines.
  • Added a new program, parametric3D.frink to demonstrate drawing 3-D curves for 3-D printing using parametric equations. This allows drawing of screw threads, for instance.
  • Fixed a problem with the definition of earthvolume in the standard data file.

New in Frink 2021-04-22 (Apr 23, 2021)

  • Fixed the charName and charNames functions to return an empty string (rather than a null or crashing) if a Unicode codepoint is undefined or if the Java Virtual Machine does not know its name (JVMs lag far behind the latest Unicode definitions.)

New in Frink 2021-04-10 (Apr 11, 2021)

  • Added a method, makeSupertoroid to Frink's VoxelArray class, to create a torus or other members of the toroid family. See Frink's 3-D routines.
  • Revised the arguments to VoxelArray.construct to be double instead of float for flexibility. See Frink's 3-D routines.
  • Improved error messages when parsing. If a program contains an unrecognized character, the error message also displays the Unicode name of the codepoint.

New in Frink 2021-03-28 (Mar 29, 2021)

  • Added a method to Frink's VoxelArray class, to extrude an image or text onto a specific plane. See Frink's 3-D routines.
  • Released a new version of Frink: The Next Generation (version 2021-03-28). This merges all changes from the main branch.

New in Frink 2021-03-23 (Mar 24, 2021)

  • Added a method to Frink's VoxelArrayclass, fillCube which draws a 3-D cuboid.
  • Added a fabulously powerful yet simpleprogram, graph3D.frink,which graphs arbitrarily-complicated 3D equations and creates a file for3-D printing.

New in Frink 2021-03-22 (Mar 22, 2021)

  • Added function img.getPixelGrayInt[x,y] to return the color of a pixel as a grayscale from 0 to 255 inclusive. This is meant for quick processing and does not perform any perceptual encoding. See the images documentation for more.
  • Added a method to Frink's VoxelArray class, strokeZTapered which allows drawing in 3-D along a polyline or polygon with a tapered tool. See Frink's 3-D routines.
  • Updated Historical British Price Data for final data from 2020.

New in Frink 2021-03-17 (Mar 18, 2021)

  • Modified the table formatting functions so that centered text is biased toward the right so that numbers and negative signs line up better.
  • The Matrix.frink sample program has added and improved algorithms for matrix inversion, calculating the adjugate of a matrix, and improved determinant calculations. The Matrix class is still woefully incomplete but feel free to contribute unimplemented functions!

New in Frink 2021-03-12 (Mar 13, 2021)

  • Fixed the order of rotations in VoxelArray.rotateXYZ. When composing 3-D matrix transforms, you have to multiply them in reverse order! See Frink's 3-D routines.

New in Frink 2021-03-11 (Mar 11, 2021)

  • Added functions to produce the Unicode names of characters from either strings or arrays of integers. See the Unicode in Strings sections of the documentation for the charName and charNames functions.
  • Additions and changes to Frink's 3-D routines, including extrusion of polygons and rotations.

New in Frink 2021-03-05 (Mar 5, 2021)

  • Lots of additions and changes to Frink's 3-D routines, including extrusion of polygons, scaling routines, and more.

New in Frink 2021-02-03 (Feb 3, 2021)

  • Added the function symmetricDifference[a, b] which calculates the "symmetric difference", also known as the "disjunctive union" of sets a and b. In other words, the new set contains only the elements that are in either set a or b but not in both. For example, the symmetric difference of the sets {1,2,3} and {3,4} is {1,2,4}.

New in Frink 2021-02-02 (Feb 3, 2021)

  • Fixed an issue that manifested as a NoClassDefFoundError for frink.graphics.FrinkImage. The problem was caused by the obfuscator. Thanks to Ty Boyack for the report.
  • Released a new version of Frink: The Next Generation (version 2021-02-02). This merges all changes from the main branch.

New in Frink 2021-01-28 (Jan 29, 2021)

  • Added a formatTableInput function to format a 2-dimensional table into Frink's inputForm so that it can be parsed by Frink, passed to the eval function, pasted into a Frink program, etc. See the Formatting Tables section of the documentation for details.
  • Added some cool examples of recursive table formatting to format equations and Frink source code to the Formatting Tables section of the documentation.

New in Frink 2021-01-10 (Jan 11, 2021)

  • Fixed a bug in calling functions like addLeap that manifested as a NoClassDefFoundError for frink.date.LeapSeconds. The problem was caused by the obfuscator. Thanks to Tobias Jordan for the report.
  • Released a new version of Frink: The Next Generation (version 2021-01-10). This merges all changes from the main branch.

New in Frink 2021-01-01 (Jan 2, 2021)

  • Added new startup options for Frink:
  • When using the frink.gui.FrinkStarter class, the -1 command-line option will start Frink in one-line input mode (default is two-line input mode). This is similar to starting Frink and choosing the menu item Mode | One-Line or hitting Ctrl-1.
  • When using the frink.gui.FrinkStarter class, the -3 command-line option will start Frink in multi-line input mode (default is two-line input mode). This is similar to starting Frink and choosing the menu item Mode | Multi-Line or hitting Ctrl-3.
  • See the Running Frink section of the documentation for more details.
  • Released a new version of Frink: The Next Generation (version 2021-01-01). This merges all changes from the main branch.

New in Frink 2020-12-31 (Jan 1, 2021)

  • Updated copyright dates for 2021. Happy New Year!
  • Updated sanity checks to 2021 for economic routines.
  • Updated calculations and predictions for deltaT for 2021. It is currently hardcoded to 69.359 s (it has been 69.184 s for the past 3 years.) USNO's servers that typically serve this information and predictions have been down for at least 15 months.
  • Released a new version of Frink: The Next Generation (version 2020-12-31). This merges all changes from the main branch.

New in Frink 2020-12-14 (Dec 14, 2020)

  • Fixed a bug in the rest[array] function that produced a program crash.
  • Added the function setBit[n, bit] which sets the specified bit of a number (least significant bit is 0) to 1 and returns a new number. This is equivalent to bitOr[n, shiftLeft[1, bit]]
  • Added the function clearBit[n, bit] which clears the specified bit of a number (least significant bit is 0) to 0 and returns a new number. This is equivalent to bitAnd[n, bitNot[shiftLeft[1, bit]]]
  • Added the function flipBit[n, bit] which flips the specified bit of a number (least significant bit is 0) and returns a new number. This is equivalent to bitXor[n, shiftLeft[1, bit]]

New in Frink 2020-11-27 (Nov 28, 2020)

  • Added a convenience method to turn a graphics object into a bitmapped image:
  • graphics.toImage[width, height]
  • which is identical to the image constructor:
  • new image[graphics, width, height]
  • In both of the above functions to turn a graphics object into an image, now if exactly one of width or height are specified as undef, and the other is an integer, the size of the undefined axis will be calculated from the defined width or height and the aspect ratio of the graphics that is being drawn.
  • Released a new version of Frink: The Next Generation (version 2020-11-27). This merges all changes from the main branch.

New in Frink 2020-11-17 (Nov 18, 2020)

  • Added the ability to rotate a VoxelArray to Frink's 3-D routines. See the VoxelRotateTest.frink sample program. This makes almost feature-completeness to 3D modeling.
  • Released a new version of Frink: The Next Generation (version 2020-11-17). This merges all changes from the main branch.

New in Frink 2020-11-10 (Nov 11, 2020)

  • Added a rounded cube primitive to Frink's 3-D routines. See the roundedCubeTest.frink sample program.

New in Frink 2020-11-09 (Nov 9, 2020)

  • Improved the Frink-Java mapping to allow a FrinkImageExpression to be used where a FrinkImage is required. This enables some features in 3-D printing, notably extruding an image to 3 dimensions.
  • Added provisional Javadocs for Frink's 3-D routines. These will change and are intended for use in 3-D printing, and not realtime 3-D rendering. The class you want to look at is VoxelArray which contains a lot of methods for drawing primitives (like cubes, spheres, cylinders, capped cylinders, tapered cylinders,) performing constructive solid geometry (that is, taking the intersection of two objects, the union of two objects, or the difference of two objects,) extruding images and text, and more.
  • To see samples of Frink's increasing support for 3-D printing, search the sample programs for voxel. For older programs that render Wavefront .obj file formats directly, search for wavefront.
  • Added an extrude method to the VoxelArray class which allows you to extrude the black pixels of an image as a 3-D object. See extrudeTest.frink for a sample of its usage.

New in Frink 2020-10-31 (Nov 1, 2020)

  • Released a new version of Frink: The Next Generation (version 2020-10-31). This merges all changes from the main branch.

New in Frink 2020-10-29 (Oct 30, 2020)

  • Added a formatMatrix function which can format a table with Unicode box-drawing characters making traditional matrix brackets surrounding it

New in Frink 2020-10-20 (Oct 21, 2020)

  • Fixed a build problem that made the 2020-10-17 release not work on some platforms. Sorry about that.

New in Frink 2020-10-17 (Oct 18, 2020)

  • Added a formatTableBoxed function which can format a table with Unicode box-drawing characters separating the cells.
  • Added lots more code for 3-D modeling and 3-D printing (which has not been documented and is currently changing).

New in Frink 2020-10-01 (Oct 2, 2020)

  • Improved the performance of the approxLn function in ArbitraryPrecision.frink (and all the functions that depend on it. This performance will be most evident in Frink: The Next Generation.
  • Added lots of code for 3-D modeling and 3-D printing (which has not been documented and is currently changing).

New in Frink 2020-08-23 (Aug 24, 2020)

  • Added the method image.autocrop[] which automatically crops the sides of an image where the pixels are approximately equal. This returns a new image.

New in Frink 2020-08-17 (Aug 18, 2020)

  • Fixed an error in Frink-Java mapping which produced the error "cannot fit in a float" when in fact the number could fit into a float. This manifested for zero and negative numbers.
  • Released a new version of Frink: The Next Generation (version 2020-08-17). This merges all changes from the main branch.

New in Frink 2020-08-09 (Aug 10, 2020)

  • Modified the planets.frink astronomy libraries to optionally allow filling in the shape of Jupiter when drawing its moons and also optionally filling in the shape of Saturn.
  • Added a new sample program, drawJupiterSaturn.frink which draws Jupiter and Saturn as they would look in the sky relative to each other. This is for the great Jupiter-Saturn convergence of 2020 where Jupiter and Saturn will gradually close from August 29, 2020 to be about 0.11 degrees away (about 1/5 the diameter of the full moon) from each other on December 21, 2020. This requires the updated planets.frink library described above.
  • Some minor HTML fixups.

New in Frink 2020-08-04 (Aug 5, 2020)

  • Fixed a bug in the zero-argument Writer.println[] method which may have caused the error message "AbstractExpressionFormatter.formatUnknown passed null expression!" to be displayed to the user and possibly written into the file.

New in Frink 2020-07-30 (Jul 30, 2020)

  • Fixed a silly error in the planets.frink astronomy libraries where the radius and mass of Planet.Mars were accidentally the radius and mass of planet Earth. Please update.
  • This did not affect anything about the orbit or position of Mars, nor did it affect the constants marsradius nor marsmass in the standard data file; it just exposed itself when accessing the planets.frink library and requesting the fields Planet.Mars.radius or Planet.Mars.mass
  • Added a drawVenus.frink sample program that draws Venus as it appears from Earth.
  • Added a drawPlanets.frink sample program that draws the illuminated parts of planets as they appear from Earth. This currently draws random colors and will be updated.

New in Frink 2020-07-28 (Jul 29, 2020)

  • Released a new version of Frink: The Next Generation (version 2020-07-28). This merges all changes from the main branch.

New in Frink 2020-07-27 (Jul 28, 2020)

  • Added dictionary methods dict.keys[] and dict.values[] to let you enumerate through the keys and values of a dictionary. (There was already a keys[dict] function.)

New in Frink 2020-07-25 (Jul 26, 2020)

  • Released a new version of Frink: The Next Generation (version 2020-07-25). This merges all changes from the main branch.

New in Frink 2020-07-15 (Jul 16, 2020)

  • Added a new function rest[expr, num] returns everything after the first num elements of an array or enumerating expression. If the expression passed in is an array, the result is an array, otherwise it is a (possibly-infinite) enumerating expression. This is the opposite of first[expr, num]
  • See the Slicing Arrays and Enumerating Expression Functions sections of the documentation for more.

New in Frink 2020-07-13 (Jul 14, 2020)

  • In Frink: The Next Generation, full Unicode character classes and full Unicode case folding is enabled by default. This fixes the broken behavior of the Java 1.6 release when running on Java 1.7 and later and makes the /uU regex options essentially unnecessary and obsolete.
  • Documented that Frink: The Next Generation no longer uses the POSIX character class codes that look like [[:Alpha:]] and [[:Digit:]] are no longer available and have been replaced with Unicode regular expression classes as specified in Unicode Technical Standard 18: Unicode Regular Expressions. See the Regular Expression Replacement documentation of Frink:TNG.
  • Released a new version of Frink: The Next Generation (version 2020-07-13). This merges all changes from the main branch.
  • Added a new sample program, TaylorSeries.frink which generates a symbolic Taylor series for a function.

New in Frink 2020-07-07 (Jul 7, 2020)

  • The functions wordList, lineBreakList, and sentenceList now have two-argument versions that allow you to specify a language specifier which uses different human language's rules for detecting words, sentences, and places to break lines. See the Correct String Parsing section for details.
  • Added an Additional Array Functions section to the documentation which makes it clear that other many functions will work on arrays.

New in Frink 2020-07-07 (Jul 7, 2020)

  • The functions wordList, lineBreakList, and sentenceList now have two-argument versions that allow you to specify a language specifier which uses different human language's rules for detecting words, sentences, and places to break lines. See the Correct String Parsing section for details.
  • Added an Additional Array Functions section to the documentation which makes it clear that other many functions will work on arrays.

New in Frink 2020-07-04 (Jul 4, 2020)

  • Added countToArray[expr] and countToDict[expr] functions that count the number of times that each element occurs in an array or other enumerating expression and returns the number of occurrences of each item. The array version returns an array with the most common items first. These can be used to easily build frequency tables. See the Enumerating Expression Functions for more details.

New in Frink 2020-06-26 (Jun 26, 2020)

  • The formatTable function now can take any enumerating expression, instead of just an array as its input. See the Formatting Tables section of the documentation for details.
  • The formatTable function can format a one-dimensional array into column form. See the Formatting Tables section of the documentation for details.
  • The Swing and AWT GUIs now have the option for using a monospaced font. This can be selected from the View | Font menu item. This is helpful when using the above formatTable functions.
  • Added array methods array.isEmpty[] and array.peek[] which are useful when using an array as a stack. See the Pushing and Popping section of the documentation for details.

New in Frink 2020-06-13 (Jun 15, 2020)

  • Added functions for formatting tables. See the Formatting Tables section of the documentation for details.

New in Frink 2020-05-31 (Jun 2, 2020)

  • Added array.dimensions[] method to return the dimensions of a possibly-multiple-dimension array. See the Dimensions array method documentation for details.

New in Frink 2020-05-09 (May 10, 2020)

  • Released a new version of Frink: The Next Generation (version 2020-05-09). This merges all changes from the main branch.

New in Frink 2020-05-05 (May 5, 2020)

  • Added an inputFormUnicode formatter that is like inputForm but assumes you have a working Unicode environment and does not escape non-ASCII characters.

New in Frink 2020-05-02 (May 3, 2020)

  • Added a concat[array1, array2] function that concatenates the elements of two arrays (or other enumerating expressions.)

New in Frink 2020-04-27 (Apr 27, 2020)

  • Made several fixes to make regular expressions in Frink and Frink: The Next Generation work more to the same. These were primarily fixes to the original version of Frink:
  • Unified the behavior of uHHHH which matches a specified Unicode character, where HHHH is a 4-digit hexadecimal code indicating a Unicode codepoint.
  • The left- and right-hand side of a substitution expression can now accept high Unicode characters in both Frink and Java format, that is in the format u{h...h} (Frink notation) and x{h...h} (Java regex notation) where h...h represents from 1 to 6 hexadecimal digits that represent the desired Unicode codepoint.
  • The right-hand side of a substitution expression can now contain character escapes in the format xhh where hh represents exactly 2 hexadecimal digits that represent the Unicode character. These previously worked in the left-hand side but not the right-hand side.
  • The right-hand side of a substitution expression currently expressly can not contain some of the antiquated and problematic character escapes defined in Java's Pattern class. The unsupported patterns are:
  • Octal escapes beginning with (that dangerous notation dies with me!)
  • The alert (bell) character a (use u0007 instead)
  • The escape character e (use u001B instead)
  • The escape sequence for control characters cX (specify it with its Unicode character instead.)
  • Released a new version of Frink: The Next Generation (version 2020-04-26). This merges all changes from the main branch.

New in Frink 2020-04-19 (Apr 19, 2020)

  • The makeArray[dims, value] function can now take a function as the value parameter. The function will be called to provide the value of each cell.

New in Frink 2020-04-08 (Apr 8, 2020)

  • Made some workarounds due to Java 13's disastrous "module" system to"fix" code that has worked for 20 years.
  • Released a new version of Frink: The Next Generation(version 2020-04-08). This merges all changes from the main branch.

New in Frink 2020-04-01 (Apr 2, 2020)

  • Added arbitrary-precision square root functions:
  • sqrt[x, digits]: Arbitrary-precision square root to the specified number of digits. This can take arbitrarily-large and small arguments. This function only works with real-valued inputs.
  • sqrtExact[x, digits]: Arbitrary-precision square root to the specified number of digits. This can take arbitrarily-large and small arguments. If the input is an integer, this attempts to return an exact integer result when possible. This function only works with real-valued inputs.

New in Frink 2020-03-31 (Mar 31, 2020)

  • Fixed a problem in regular expressions and search-and-replace operations where a literal backslash was not consistently representable with two backslashes.

New in Frink 2020-03-18 (Mar 19, 2020)

  • Added an until loop and a do...until loop which work just like the while loop and the do...while loop, except that they iterate until the condition becomes true.

New in Frink 2020-03-06 (Mar 7, 2020)

  • Important: Fixed an incorrect optimization in algebraic simplification of power expressions like (x^y)^z which did not work correctly in some cases if z was a non-integer. It is highly recommended to update as soon as possible.
  • Released a new version of Frink: The Next Generation (version 2020-03-06). This merges all changes from the main branch.
  • Released a new version of the frink-tng.war file from Frink: The Next Generation (version 2020-03-06).

New in Frink 2020-03-02 (Mar 2, 2020)

  • Added joinln[list] function which takes an array and returns its result as a single string joined by newline characters, that is, it puts each element of list on its own line with no trailing newline.
  • Fixed a lot of sample programs to use the joinln function instead of whatever they were using to join lines.

New in Frink 2020-02-29 (Mar 1, 2020)

  • Released a new version of Frink: The Next Generation (version 2020-02-29). This merges all changes from the main branch.
  • Released a new version of the frink-tng.war file from Frink: The Next Generation (version 2020-02-29).

New in Frink 2020-02-26 (Feb 27, 2020)

  • Added the isEnumerating[expr] to test if an expression is an enumerating expression.
  • Added documentation to the ternary conditional operator condition ? trueClause : falseClause in the If / Then / Else section of the documentation.

New in Frink 2020-02-22 (Feb 22, 2020)

  • Further improved the flexibility of the numerator, denominator, and numeratorDenominator functions. These functions now take two optional parameters which allows you to select how rational numbers and units of measure are split between the numerator and denominator. See the description of the numeratorDenominator function in the Other Functions section of the documentation for details.

New in Frink 2020-02-17 (Feb 18, 2020)

  • Greatly improved the power of the numerator[expr] and denominator[expr] functions. They can now return the numerator and denominator of arbitrary symbolic expressions. denominator[expr] works by collecting multiplicative terms that are obviously divisions or have negative exponents, and numerator[expr] works by collecting the other parts.
  • Added a new numeratorDenominator[x] function which returns the numerator and denominator of an expression as a two-item array [numerator, denominator] This works on rational numbers, integers, units, and arbitrary symbolic expressions. It is better to use this function than to call numerator and denominator separately, as it's more efficient.

New in Frink 2020-02-12 (Feb 13, 2020)

  • Added a Constraining Viewport section to the documentation which describes how to set the viewport that is visible in a graphics object.
  • Normally, Frink's graphics are automatically scaled and centered in the display. All of the graphics that you draw will automatically be visible, no matter what coordinate system you use.
  • However, sometimes you may want to have fine-grained control over the region that is displayed, even if you don't fill it entirely, or if you want to draw outside the region, or if you want to "zoom in" on just part of a graphic.

New in Frink 2020-02-10 (Feb 10, 2020)

  • Added more general rules for solving exponential/logarithmic relations that require the Lambert W functionLambert W function to powerTransformations.frink. This primarily affects equations of the form a = n ln[n] but includes the forms:
  • a = n ln[c n]
  • a = n ln[c n^x]
  • a = n^y ln[c n^x]
  • In these, the exponents y and x can be negative, which indicates division by n.

New in Frink 2020-02-02 (Feb 2, 2020)

  • Released a new version of Frink: The Next Generation (version 2020-02-01). This merges all changes from the main branch.
  • Fixed a problem sqrtWayne.frink where a value that only needed to be calculated to a few digits could be calculated to maybe millions of digits. This affected programs like piChudnovskyNew.frink.

New in Frink 2020-02-01 (Feb 2, 2020)

  • Further enhanced the functionUtils.frink to add functions helpful for finding derivatives of an equation
  • Enhanced the functionUtilsTest.frink to include a sample of getting the derivative and integral of either a function defined in Frink or one defined in Java.

New in Frink 2020-01-30 (Jan 31, 2020)

  • Fixed a couple more issues in the log[x, base] function (which takes logarithms of the number x to the specified base base.) These did not return wrong results, but could throw ArithmeticExceptions or cause slowdowns.

New in Frink 2020-01-27 (Jan 28, 2020)

  • Added the splitLines[str] function which splits a string on newline characters and returns an array of strings with the newlines removed. See the split section of the documentation for an example.

New in Frink 2020-01-26 (Jan 27, 2020)

  • The primes[begin, end] function can now take the undef parameter for either argument. If begin is undef, the enumeration begins with 2. If end is undef, the enumeration is potentially infinite.

New in Frink 2020-01-22 (Jan 23, 2020)

  • Added functions to work with (possibly infinite) enumerating expressions:
  • First[expr] returns the first element of an array or enumerating expression as a single expression.
  • First[expr, count] returns the first count elements of an array or enumerating expression. If the expression passed in is an array, the result is an array, otherwise it is a (possibly-infinite) enumerating expression.
  • Rest[expr] returns everything after the first element of an array or enumerating expression. If the expression passed in is an array, the result is an array, otherwise it is a (possibly-infinite) enumerating expression. This is the opposite of first[expr]
  • Last[expr] returns the last element of an array or enumerating expression as a single expression.
  • Last[expr, count] returns the last count elements of an array or enumerating expression. The result is an array.
  • Slice[expr, begin, end] returns a slice of an array or enumerating expression starting with index start and ending before index end. If the indices are beyond the ends of the array, only existing items will be returned. If begin or end is the value undef, the results will include the beginning or end of the expression respectively. If the expression passed in is an array, the result is an array, otherwise it is a (possibly-infinite) enumerating expression.
  • SliceLength[expr, begin, length] returns a slice of an array or enumerating expression starting with index start and having length items. If the expression passed in is an array, the result is an array, otherwise it is an enumerating expression.
  • Nth[expr, index] returns the specified (zero-based) element of an array or enumerating expression. For example, to return the millionth prime (again, indexing is zero-based,) nth[primes[], million-1]

New in Frink 2020-01-18 (Jan 19, 2020)

  • Added the last[expr] function to return just the last element of an array or enumerating expression.
  • Added a primes[begin] function which returns an infinite enumerating expression of the prime numbers greater than or equal to begin and increasing. Note that this will produce infinite output if you even try to print it, so you probably want to call it from a for loop or from something like first[primes[3], 100]
  • Added a primes[begin, end] function which returns a finite enumerating expression of the prime numbers greater than or equal to begin and less than or equal to end.

New in Frink 2020-01-12 (Jan 12, 2020)

  • Added the arg[z] function that returns the argument (that is, the phase) of a complex (or real) number. For a complex number z = x + i y, this is equivalent to arctan[y,x].

New in Frink 2020-01-10 (Jan 11, 2020)

  • Added an experimental frink-tng.war file to allow you to easily run Frink: The Next Generation on your webserver to run Frink Server Pages. It's built with Java 1.6 and the Servlet 2.5 API, which means it should be backward-compatible with many servlet containers.

New in Frink 2020-01-05 (Jan 6, 2020)

  • Added programs to draw U.S. states. These include programs to draw the United States in both rectangular coordinates and more correct sinusoidal coordinates.

New in Frink 2020-01-04 (Jan 5, 2020)

  • The sample startup script for Frink on Linux now can use the rlwrap program to allow you to use the up/down arrows to repeat and edit calculations, and even to autocomplete units and functions. Download the updated file and its associated files from the Running Frink section of the documentation.

New in Frink 2020-01-02 (Jan 4, 2020)

  • Released a new version of Frink: The Next Generation (version 2020-01-02). This merges all changes from the main branch.

New in Frink 2019-12-31 (Jan 1, 2020)

  • Added the rest[expr] function to return everything after the first element in a list.
  • Updated copyright dates for 2020. Happy New Year!
  • Updated sanity checks to 2020 for economic routines.

New in Frink 2019-12-27 (Dec 28, 2019)

  • Updated Frink's water vapor and absolute humidity and relative humidity calculation library waterVapor.frink with some calculations about how much water you have to vaporize to get a house or room to a particular humidity (inspired by my super-dry lungs in a high-altitude dry climate.)

New in Frink 2019-12-21 (Dec 21, 2019)

  • Frink's equation solvers now recognize and solve cubic equations (that is, equations in the form of a x^3 + b x^2 + c x + d === 0)! It even now solves in the cases where b or c are zero and those terms disappear. These updates are located in solvingTransformations.frink.

New in Frink 2019-12-18 (Dec 19, 2019)

  • Fixed the calculation of the correlation coefficient of a quadratic fit in curveFit.frink.

New in Frink 2019-12-15 (Dec 16, 2019)

  • The syntax highlighter now highlights function definitions. See it in use at Frink Sample Programs.
  • Added more comments and analysis to cambridgetempFourier.frink. This is useful to help understand Fourier transforms, especially with units of measure.

New in Frink 2019-11-30 (Dec 1, 2019)

  • Added more simplifying solvers to the trignonometric solvers in solveTrigonometric.frink.

New in Frink 2019-11-27 (Nov 27, 2019)

  • Fixed a couple of issues in the log[x, base] function (which takes logarithms of the number x to the specified base base.) These would manifest as a divide-by-zero error or an "exponent is too large" error when trying to take the logarithm of a rational number that was very close to 1. Incorrect values were never returned. The errors were in the code that tries to return exact rational or integer results when possible.
  • Extended the new relativity.frink library that performs relativity calculations. The additions include black hole calculations, relativistic Doppler shift, relativistic escape velocity, potential energy, and kinetic energy.

New in Frink 2019-11-18 (Nov 18, 2019)

  • Added hyperbolic sin, cos, and tan solvers to the trignonometric solvers in solveTrigonometric.frink.
  • Added the first cut at a new relativity.frink library to perform relativity calculations. These currently include Lorentz transformations, relativistic rocket calculations, and will soon include black hole calculations, relativistic Doppler shift, relativistic velocity and other coordinate transformations, etc.

New in Frink 2019-11-13 (Nov 14, 2019)

  • Added more general rules for solving exponential/logarithmic relations that require the Lambert W function to powerTransformations.frink

New in Frink 2019-10-31 (Nov 1, 2019)

  • Added the first[expr] function to return just the first element of an array or enumerating expression.

New in Frink 2019-10-29 (Oct 29, 2019)

  • Added functions to enumerate through Gray codes. These can have an arbitrary number of states.
  • Updated the MercuryTransit.frink sample program to draw the 2019-11-11 transit of Mercury in front of the Sun.

New in Frink 2019-09-27 (Sep 28, 2019)

  • The Frink Sample Programs Search page, will now search the filenames, and not just the bodies of all the Frink sample programs.

New in Frink 2019-09-20 (Sep 21, 2019)

  • The function bytesToString[bytes, encoding="UTF-8"] can now take an array of Frink integers that will fit into bytes, as well as an array of Java bytes.
  • The sample RSA.frink has been updated to use the fix for bytesToString above.
  • Added a function last[expr, num] to take the last num items from an expression (which can be an array or enumerating expression.) The result is returned as an array.
  • Released a new version of Frink: The Next Generation (version 2019-09-20). This merges all changes from the main branch.

New in Frink 2019-08-22 (Sep 6, 2019)

  • Made some fixes when using Custom Timezone specifications. This improves Frink's ability to parse these custom timezones, but especially to convert to these timezones, which was not reliable.

New in Frink 2019-07-22 (Jul 23, 2019)

  • Fixed currency conversions to work again.

New in Frink 2019-07-15 (Jul 15, 2019)

  • Added a new program, e.frink to calculate the constant e using binary splitting. This is efficient and resumable and maintains a cache; when you need more digits, the previous calculation is resumed, rather than restarted from scratch.
  • Added functions to draw the moon's rotational axis to the sun.frink astronomy library.
  • Extended the Moon position calculator to draw the rotational axis of the moon.

New in Frink 2019-07-11 (Jul 15, 2019)

  • Added calculations for libration of the moon and the moon's axis angle to the sun.frink astronomy library.

New in Frink 2019-07-09 (Jul 15, 2019)

  • Fixed some rules for solving exponential/logarithmic relations to powerTransformations.frink so they don't interfere with more specific rules in solvingTransformations.frink

New in Frink 2019-07-08 (Jul 9, 2019)

  • Added several more rules for solving exponential/logarithmic relations to powerTransformations.frink and solvingTransformations.frink
  • Removed some errors when evaluating functions like isRational or isInteger in symbolic mode when evaluating conditions in a transformation rule.

New in Frink 2019-06-28 (Jun 29, 2019)

  • Happy Tau Day! (6-28 is often called "Tau Day" because it's the same as the first 3 digits of 2 pi, often called "Tau".) There's a new sample program to efficiently calculate the digits of pi (or Tau,) cache them, and return them on demand: pi2.frink
  • This is an improvement on the previous pi.frink sample program in that it can resume the binary splitting and square root, rather than starting over when a larger number of digits is requested.
  • This file is intended to be used with Frink: The Next Generation.

New in Frink 2019-06-27 (Jun 28, 2019)

  • The library that calculates the Lambert W function, LambertW.frink, can now also calculate the secondary branch function, often called W-1(z).

New in Frink 2019-06-26 (Jun 27, 2019)

  • Created the first cut at a rudimentary Frink Sample Programs Search page, where you can search the bodies of all the Frink sample programs.
  • Added a function to calculate the Lambert W function, which is what you get when you try to solve z = w ew for w. It can be found at LambertW.frink

New in Frink 2019-06-14 (Jun 26, 2019)

  • The functions for converting a FFT-transformed image to/from an image file have been altered to take an (optional) boolean flag that allows the DC (zero-frequency) component to be centered in the middle of the image. See the FourierImage.frink and FourierImageTest.frink sample programs for examples of its usage.

New in Frink 2019-06-04 (Jun 7, 2019)

  • Added isReal[expr] function which returns true if the argument is a real number (with or without dimensions, and not an interval,) false otherwise.
  • Added unitsWithValues[] function which returns an enumeration of [unitName, value] pairs.
  • Added unitsWithValues[expr] function which takes returns an enumeration of [unitName, value] pairs that match the specified dimensions.

New in Frink 2019-05-27 (May 28, 2019)

  • Released a new version of Frink: The Next Generation (version 2019-05-27). This merges all changes from the main branch.

New in Frink 2019-05-26 (May 27, 2019)

  • Fixed a bug where the new units for the impedance of vacuum (Z0 or impedanceofvacuum) and admittance of vacuum (Y0 or admittanceofvacuum) were swapped with each other. Again, thanks to Alain Fontaine for bringing these changes to my attention.

New in Frink 2019-05-23 (May 24, 2019)

  • Frink's standard data file has been updated to more exactly match the redefinition of the kelvin (K) based on the 2019 SI redefinition:
  • Under the 2019 redefinition, the Kelvin is now tied to the exactly-defined Boltzmann constant k.
  • The unit zerocelsius is now defined as an exact rational number.
  • As a result of the above, more conversions between temperature scales may now yield exact rational numbers. To format, say, a Fahrenheit temperature as a floating-point number with a fixed number of decimal places, you can use something like:
  • format[F[0 K], 1, 2]
  • -459.67
  • Comments in the data file have been updated. Notably, comments about the triple point of water have changed, as the triple point of water is now an experimentally-measured quantity, and not an exactly-defined value.
  • Again, thanks to Alain Fontaine for bringing these changes to my attention.

New in Frink 2019-05-21 (May 22, 2019)

  • Fixed a possible crash on Android when Frink doesn't have permission to access an external data directory. This may not completely fix all problems when Frink can't write to external storage. I'm currently evaluating fallback behaviors.
  • Frink's standard data file changed again in a couple of ways:
  • Improved the description of several units, and noted the changes between the pre-2019 definitions and the current definitions. Comments were updated and modernized.
  • Fixed the definitions of mu0 and epsilon0, the permeability and permittivity of vacuum (respectively) to match the changes made in the 2019 SI redefinitions. These are no longer "exactly-defined" values, as they were before, but are now "experimentally-measured" quantities. Their values changed very slightly, and they now have uncertainties. Thanks to Alain Fontaine for bringing these changes to my attention.

New in Frink 2019-05-20 (May 21, 2019)

  • Happy World Metrology Day! And welcome to the first day of the new International System of Units!
  • Frink's standard data file has been updated again to incorporate the new 2018 CODATA values that were released by NIST yesterday. These change some physical constants to the newest best-known values, such as the gravitational coefficient and particle masses. In addition, several constants were redefined in terms of the new fundamental constants, including making some exact, like the gas constant R.
  • Released a new version of Frink: The Next Generation (version 2019-05-20). This merges all changes from the main branch.

New in Frink 2019-05-19 (May 20, 2019)

  • Some constants have been redefined due to the above definitions. In the Frink standard data file, many definitions have been changed to turn them into their new exactly-defined values. For example, the electron-volt (which is the energy of an electron accelerated through a potential of one volt) is now an exactly-defined value.
  • Some units in the data file have been revised if they could be defined in terms of exactly-defined units. In the future, this should make it easier to keep the units exactly defined, and not require updating with new CODATA values every 4 years.
  • Standards bureaus like NIST and BIPM have been slow in adjusting their official values for constants. I'm not sure if they're going to switch everything over on May 20, or what. Right now they have the 2014 CODATA values (which are updated every 4 years) of the constants, with no notices about how this will change with the new SI.
  • Update: Since I posted this last night, the NIST site now states that it has the 2018 CODATA values of the constants! Frink's standard data file will change again with the new values.
  • The units that will change further include things like the gravitational constant G, masses of fundamental particles, etc., all of which are updated both because of new SI definitions and new experimental results. Watch for more Frink updates soon!
  • The Grid.frink sample program which allows you to automatically (or manually) add grid coordinates to a graphics object has been improved to fix a bug in horizontal labels with a customized formatting function.
  • The daylight.frink sample program which calculates sunrise and sunset and hours of daylight for any location has been improved to graph the times of sunrise and sunset, to not jump forward and backward a day on some dates, and to better handle timezones. It now requires the Grid.frink sample program to label its axes.
  • World Metrology Day is May 20! This is one of the most important Metrology Days ever because it marks the release of the new International System of Units (SI). The new version of the SI fixes some (but not nearly all) of the fundamental problems of the old SI by re-defining some units in the SI as exact constants, and letting other units be defined in terms of these exact values.
  • (Since Frink version 2018-12-11, you can specify floating-point numbers to be exact using the "exact exponent" indicator which will turn them into exact rational numbers or integers. For example, the new exact SI value for Avogadro's number 6.02214076ee23 will become an exact integer. The exponents can also be negative, which will usually lead to an exact rational number, such as 6ee-1 which produces the exact rational number 3/5 (exactly 0.6). Previously, only integer mantissas could be specified with the exact exponent indicator.)
  • The new exact values are:
  • The Planck constant h: Now exactly 6.62607015 * 10-34 joule-second (J s). This is now represented in Frink as an exact fraction, 6.62607015ee-34 J s
  • The elementary charge of an electron or proton, used in Frink as the unit elementarycharge, or similarly electroncharge (negative) or protoncharge (positive), is now defined as exactly 1.602176634 * 10-19 coulombs, or, in Frink notation, 1.602176634ee-19 s A (a coulomb is an ampere times a second.)
  • Boltzmann's constant k is now defined as exactly 1.380649 * 10−23 J/K, or, in Frink notation, 1.380649ee-23 J/K
  • Avogadro's constant, the number of items in a mol, is now defined as exactly 6.02214076 * 1023 / mol, which is an exact integer, or, in Frink notation, 6.02214076ee23 mol^-1

New in Frink 2019-05-02 (May 3, 2019)

  • The Fourier.frink sample program now contains routines for plotting Fourier transforms (or ordinary arrays) as a magnitude and phase diagram, and for determining the frequency of a particular element of a Fourier transform. The location of these routines may change.

New in Frink 2019-05-01 (May 2, 2019)

  • Improved the parser to allow "exact exponent" for integer mantissas to allow a + sign in the exponent, e.g. 1ee+1000. The + sign was previously allowed if the mantissa included a decimal point, but if it didn't, this wasn't parsed correctly (and could even produce parser crashes.)
  • Added a three-argument version of mapList[function, list, data] which allows arbitrary data to be passed to a function used in the mapList function. In this case, the function passed to mapList must take two arguments instead of one. See the map section of the documentation for more details.

New in Frink 2019-04-21 (May 2, 2019)

  • Released a new version of Frink: The Next Generation (version 2019-04-21). This merges all changes from the main branch.

New in Frink 2019-04-18 (Apr 19, 2019)

  • Improved logarithm functions:
  • The function log[x] (which takes logarithms to base 10) now returns exact integers or rational numbers in cases when arguments are integers and results are integers or 1 divided by an integer.
  • Added the log[x, base] function (which takes logarithms of the number x to the specified base base.) This returns exact integers or rational numbers in most cases when arguments are integers or 1 divided by an integer.
  • Note that the ordering of the arguments may be different from other programming languages! This order was chosen because log[x, base] can be rewritten as log[x] / log[base] for any logarithmic function that takes a logarithm to any base.
  • This follows the precedent set by functions like arctan[y, x] which is equivalent to arctan[y/x] except the former corrects for ambiguities in the quadrants. Similarly, it's simple to change log[x] / log[base] to log[x, base] without errors.
  • Some programming languages have taken the opposite approach, where the first argument is the base and the second argument is the number. This seems like a bad design choice, so be careful when transliterating mathematical expressions from other programming languages.
  • Fixed a bug in Java Introspection when working with a Java object that implements java.lang.Iterable. Previously, this eagerly fetched the Iterator from the object and returned the iterator, rather than the whole object itself. This was fine if you just wanted to iterate over the contents of the object, but bad if you wanted to call any of its other methods. You can once again call its methods or use it in a for loop.
  • Did more work to partially work around the 21-year-old (I'm not kidding) Java Bug 4071957 and Java Bug 4071593 and Java Bug 4283544 (and the dozens of related bugs) which causes method invocation to fail on classes that are declared private, even if the methods are public and access would be allowed from normal Java code.
  • This fix takes a stronger approach to work around these bugs and to mitigate the damage done by Java 9 and later's not-really-useful "module" system (that can never work right in the face of this bug and similar others). The code tries very hard to search for accessible method calls in the class, in its superclasses, and in its implemented interfaces to find and call a method, (that you would be able to call from compiled Java,) but if that fails, it will take the stronger step to call Java's AccessibleObject.setAccessible(true) on the method, and then try calling it again. This fixes a lot of poor design in Java's libraries, especially com.sun.internal classes, and works around the aforementioned bugs that Java has been promising to sorta think about 2 decades ago.
  • In Java 9 and later, you might get warnings about "illegal reflective access" if you call a method that has to be called using the stronger methods listed above (to work around the aforementioned Java bugs.) For now, the java command allows you to pass the --illegal-access flag:
  • illegal-access=value : permit or deny access to members of types in named modules by code in unnamed modules. value is one of deny, permit, warn, or debug. "This option will be removed in a future release."
  • You might be able to see what extended options your Java Virtual Machine has by executing java -X. You may have to add one of the options, especially --illegal-access=permit to your Frink startup script if you invoke methods that touch these Java bugs in Java 9 or later and you need these warnings silenced.

New in Frink 2019-04-10 (Apr 11, 2019)

  • Added the conjugate[x] function to return the complex conjugate of a complex number or array of numbers.

New in Frink 2019-04-04 (Apr 5, 2019)

  • Added a copyStream[inputStream, outputStream] function to copy the contents of one java.io.InputStream to a java.io.OutputStream. See the I/O Functions section of the documentation for more details.
  • Improved the ZipFile.frink sample program to unzip the contents of a zip file.

New in Frink 2019-03-25 (Mar 26, 2019)

  • Updated the floatingPointBase.frink sample program which does base conversions on floating-point numbers. The new version has more correct internal precision calculations to produce more correct digits, and has new options for both parsing and formatting. The updated parseFloat function can produce exact rational numbers or a number with approximately the same number of significant digits as the string being parsed.

New in Frink 2019-03-13 (Mar 14, 2019)

  • Released a new version of Frink: The Next Generation (version 2019-03-13). This merges all changes from the main branch.

New in Frink 2019-03-11 (Mar 12, 2019)

  • Added method image.show[title] to show an image with the specified title.
  • Rewrote the code that writes Fourier-transformed images into a logarithmic magnitude-phase plot and reconstructs them from the aforementioned plot. This removes some numerical instability with larger images that caused large images to fail. See the FourierImage.frink sample program for sample usage.
  • The function to resize images, image.resize[width, height] method has been rewritten to use a much better area-averaging filter. This makes scaling of images much cleaner and less random, especially for strong downscaling.
  • Added ComplexArray2D.subtract[ComplexArray2D] method to create, say, difference between two images (after calling their .toComplexArray[] methods.) This can be turned back into an image by calling the toImage[] method on the result.

New in Frink 2019-03-10 (Mar 11, 2019)

  • Added some solving rules (and removed and generalized some rules) in the experimental powerTransformations.frink to handle equations that included ex and ln[x], and log[x]. These now solve many more equations. It is frankly amazing how adding a single transformation rule makes the solver able to solve huge classes of new equations.
  • Added more simplifications for expressions involving ex and ln[x], and log[x] to solvingTransformations.frink. These rules may move. See below.
  • Solving transformations may be reorganized and moved around. It is recommended that you include allTransforms.frink and its dependent libraries when writing symbolic solvers.
  • The systemSolver2.frink library (that powers amazing stuff like the Frink System Solver) was changed to use allTransforms.frink as mentioned above, instead of including a lot of separate libraries.
  • The Grid.frink sample program which allows you to automatically (or manually) add grid coordinates to a graphics object has been improved to provide better labels on the y axis when an "up is positive" orientation is chosen.
  • The solve.frink sample program now provides evaluated results for more expressions.

New in Frink 2019-03-08 (Mar 9, 2019)

  • Added some solving rules in the experimental powerTransformations.frink to handle equations that included ex and ln[x].
  • Updated the Frink Solver page to improve the display when "show work" is enabled. Previously, it could repeat equations that were visually identical but internally different in Frink.

New in Frink 2019-03-07 (Mar 8, 2019)

  • Implemented Fast Fourier Transforms (FFT) natively in Frink. (Thesewere previously only available inthe Fourier.frink externalfile) These are drastically faster than the existing DFTfunctions. The speedup for processing a 2048 by 2048 image is about 334times. The functions behave similarly, but the FFT functionspad their input to the next largest power of 2, which can give differentresults.
  • See the Fourier Transforms section ofthe documentation for details.
  • Added a sampleprogram, FourierImage.frink,which demonstrates using Fourier transforms to process an image, obtain itsFourier transform, display the Fourier transform in a logarithmic scale,and then invert the transform to produce the original image.

New in Frink 2019-03-05 (Mar 6, 2019)

  • Added toUnicodeSubscript[int] to turn an integer into a Unicode subscript string.

New in Frink 2019-03-04 (Mar 5, 2019)

  • Added the dictionary.increment[key, increment] method to allow you to easily use a dictionary to count items. See the Dictionary Methods section of the documentation for more.

New in Frink 2019-03-02 (Mar 5, 2019)

  • Fixed the graphics.invertGrays[] method that makes your graphics objects invert their grayscales. Previously, if a graphics object contained other graphics objects, the sub-objects would not have their colors transformed.

New in Frink 2019-03-01 (Mar 2, 2019)

  • Updates to several sample libraries:
  • The Grid.frink sample program allows you to automatically (or manually) add grid coordinates to a graphics object. This has been improved in many ways, including adding coordinates based on the new Calendar Functions.
  • See sample usage in manhattanhengemoon.frink and simplegraph5.frink.
  • Updated manhattanhengemoon.frink sample program to create an exactly-correct grid using Grid.frink.
  • Updated the amazing simplegraph5.frink program that graphs any function, implicit graph, or inequality. It now automatically adds better coordinates using the Grid.frink library.

New in Frink 2019-02-27 (Feb 28, 2019)

  • Released a new version of Frink: The Next Generation (version 2019-02-27). This merges all changes from the main branch.
  • Updated Historical British Price Data documentation to indicate that it no longer needs access to the internet. (This has been true for quite a while, but the documentation didn't reflect it.)
  • Updated Historical British Price Data with data for 2018.

New in Frink 2019-02-25 (Feb 26, 2019)

  • Added 35 new functions for handling calendar dates. These functions let you handle our world's strange and random calendar dates, including functions to:
  • Given a date, find the beginning of a calendar year, month, day, hour, minute, second, or millisecond. These can use all current and historical timezone rules for the planet to find the rules for that timezone, and that specific date.
  • Given a date, find the beginning of a calendar timestep like a year, month, day, hour, etc., and incrementing or decrementing that timestep by an integer value. For example, find the beginning of the next year, the beginning of the previous year, or the beginning of the year 10 years from now. These are often quite complex and handle timezone offset rules for any timezone and historical period.
  • Added functions to calculate the length of a specific calendar year, month, or day. You would think this is easy but all of these functions produce surprising results. Under some timezone rules, some days (and months) may be an hour longer or shorter than you expect due to Daylight Saving / Summer Time rules! For example, in most US timezones, March is one hour shorter than 31 days because the clocks are set forward one hour (at 2:00 AM on the second Sunday of March)! Similarly, November, 2019 is 31 days, 1 hour long! In other timezones, (like UTC) this shift may not occur. Handling the varying lengths is necessary for consistency in date/time math.
  • Added functions to calculate the length of a specific calendar year, month, or day with leap seconds taken into account! Leap seconds are not taken into account in some calculations for performance (and the element of surprise) but these calculations give the length of a year, month, day with leap seconds considered.
  • Described some algorithms to iterate, through, say, the beginning of each calendar month or day.
  • Updated some sample programs to use these iterators. An example is the mithengesun.frink sample program which now iterates through this year and the next year.
  • All of these functions are described in detail in the Calendar Functions section of the documentation.
  • Added a new mapList function which performs like the map function but is better for working with lists. It does not have map's behavior of breaking its input into named arguments. Discussion of how to choose the appropriate function is contained in the map section of the documentation.

New in Frink 2019-02-23 (Feb 23, 2019)

  • Added 35 new functions for handling calendar dates. These functions let you handle our world's strange and random calendar dates, including functions for:
  • Given a date, finding the beginning of a year, month, day, hour, minute, second, or millisecond. These can use all current and historical timezone rules for the planet to find the rules for that timezone, and that specific date.
  • Given a date, finding the beginning of a timestep like a year, month, day, hour, etc., and incrementing or decrementing that timestep by an integer value. For example, finding the beginning of the next year, the beginning of the previous year, or the beginning of the year 10 years from now. These are often quite complex and handle timezone offset rules for any timezone and historical period.
  • Added functions to calculate the length of a specific year, month, or day. You would think this is easy but all of these functions produce surprising results. Under some timezone rules, some days (and months) may be an hour longer or shorter than you expect due to Daylight Saving / Summer Time rules! For example, in most US timezones, March is one hour shorter than 31 days because the clocks are set forward one hour (at 2:00 AM on the second Sunday of March)! Similarly, November, 2019 is 31 days, 1 hour long! In other timezones, (like UTC) this shift may not occur. Handling the varying lengths is necessary for consistency in date/time math.
  • Added functions to calculate the length of a specific year, month, or day with leap seconds taken into account! Leap seconds are not taken into account in some calculations for performance (and the element of surprise) but these calculations give the length of a year, month, day with leap seconds considered.
  • Described some algorithms to iterate, through, say, the beginning of each calendar month or day.
  • All of these functions are described in detail in the Calendar Functions section of the documentation.

New in Frink 2019-02-14 (Feb 15, 2019)

  • Released a new version of Frink: The Next Generation (version 2019-02-14). This merges all changes from the main branch.

New in Frink 2019-02-13 (Feb 14, 2019)

  • The base can now also be an array of integer bases, in which case all of the bases are tested, bailing out when the number is known to be composite. This may be slightly faster (and easier to code) in some cases. You may be able to use this along with minimal sets of bases (link opens in new window) to make an even faster primality test for smaller numbers.
  • The function now is more careful to work with sets of bases like these minimal sets of bases (link opens in new window). Previously, the test could skip over bases which were larger than the number to be tested.

New in Frink 2019-01-28 (Feb 6, 2019)

  • Released a new version of Frink: The Next Generation (version 2019-01-28). This merges all changes from the main branch and fixes one Next-Generation-specific bug:
  • When substitution regular expressions contained the /e modifier (to treat the substitution as a Frink expression,) exceptions could be thrown if the substitution contained a backslash or a dollar sign. The error message was possibly "character to be escaped is missing." This has been fixed.

New in Frink 2019-01-11 (Jan 12, 2019)

  • Added an isFunction[expr] function to test if an expression represents a (named or anonymous) function.

New in Frink 2019-01-02 (Jan 2, 2019)

  • Fixed a problem in formatting some unit expressions with dimensions, such as (240 m^2 s^-3 kg A^-2)^(1/2) (previously, the left-hand side of the exponentiation operator would not have been parenthesized correctly.)

New in Frink 2018-12-15 (Dec 16, 2018)

  • Added a sample program, RiemannPrime.frink, to estimate the number of prime numbers less than n. This gives asymptotically better estimates than LogIntegral.frink, which also gives really good estimates.

New in Frink 2018-12-11 (Dec 12, 2018)

  • Added a primes[] function which returns an infinite enumerating expression of the prime numbers starting with 2 and increasing. Note that this will produce infinite output if you even try to print it, so you probably want to call it from a for loop or from something like first[primes[], 100]
  • Allowed floating-point numbers to be specified using the ee "exact exponent" indicator, which will turn them into exact rational numbers or integers. For example, the new exact SI value for Avogadro's number 6.02214076ee23 will become an exact integer. The exponents can also be negative, which will usually lead to an exact rational number, such as 6ee-1 which produces the exact rational number 3/5 (exactly 0.6). Previously, only integer mantissas could be specified with the exact exponent indicator.

New in Frink 2018-12-03 (Dec 4, 2018)

  • Added a function first[expr, num] to take the first num items from an expression (which can be an array or potentially infinite enumerating expression.) The result is returned as an enumerating expression.

New in Frink 2018-11-17 (Nov 19, 2018)

  • For Android:
  • Fixed a problem that the program would be restarted when the screen was rotated or resized. The implication of this is that Frink must now target API level 13 (Android 3.2). The Frink app in the Google play store reflects this fix.
  • Technical Reasons:
  • This is due to the fact that the Google Play store now requires that all applications target API level 26, but API level 13 introduced some not-backwards-compatible changes to the AndroidManifest.xml files. After API level 13, Android fires a screenSize change that needs to be handled when the screen is rotated. However, this property does not exist before API level 13, and updating the target API level breaks application handling of screen rotates. Previously, Frink targeted API level 3 (Android 1.5) and before.
  • For old Android devices which are still running from API level 3 (Android 1.5) to API level 12 (Android 3.1,) a frinkold.apk file is downloadable directly from this website.
  • Added a clamp[num, min, max] function to limit a number to lie between a minimum and maximum value. This function also works correctly when num is an interval.

New in Frink 2018-11-09 (Nov 9, 2018)

  • Rewrote Chinese Numbers class to use more class-level methods. This means you don't have to construct an instance of the class, but rather call class-level methods like ChineseNumbers.formatCasual[123]
  • To match the above changes, fixed Chinese number drill Frink Server Page which tests your recognition of Chinese numbers.
  • To match the above changes, fixed Chinese number worksheet Frink Server Page to make printable worksheets to test your recognition of Chinese numbers.

New in Frink 2018-11-06 (Nov 6, 2018)

  • Added a new library file, curveFit.frink, which performs linear and quadratic curve fitting on an array of points, It also works with units of measure, creates curve-fit functions, and even produces purely symbolic results.

New in Frink 2018-11-05 (Nov 5, 2018)

  • Various additions for sun.frink astronomical library, primarily for star positions:
  • apparentPosition: Now can optionally correct for radial velocity and distance in proper motion calculations. This changes the order of arguments to this function.
  • raDeclToEcliptical: This performs conversions from right ascension and declination to ecliptical coordinates. This is symmetric to the eclipticalToRADecl function.
  • Updated the mithengeSirius.frink program to calculate with radial velocity. This really doesn't have any appreciable effect.

New in Frink 2018-10-23 (Oct 23, 2018)

  • Fixed currency conversions to work again.

New in Frink 2018-09-30 (Oct 1, 2018)

  • Algorithm dispatcher now detects the upcoming Java 11 and 12.
  • Released a new version of Frink: The Next Generation (version 2018-09-30) which merges all changes since 2018-09-04.

New in Frink 2018-09-25 (Sep 26, 2018)

  • Frink is now available as "Frink Programming Language" for Kindle Fire in the Amazon App Store.
  • Added links to download Frink via the Amazon App Store on the Frink for Android page.
  • Added tips about programmers' keyboards and file managers to the Programming Tips section of the Frink for Android documentation.
  • Many significant improvements to the Frink Solver page:
  • Shows an error if the "solve for" variable does not exist in the equation being solved for.
  • Flattens out multiple solutions when there are more than 2 solutions.
  • Fixes over-encoded HTML in errors.
  • Separates multiple solutions with blank lines for readability.
  • Fixes HTML errors in unclosed anchors.

New in Frink 2018-09-24 (Sep 24, 2018)

  • Removed an incorrect newline that was added to the code formatters when when printing the else part of an if block when the then part of the block has multiple lines. This caused invalid if statements to be generated by the code formatters.

New in Frink 2018-09-12 (Sep 13, 2018)

  • Frink is now available (for free!) in the Amazon app store as Frink Programming Language. You can turn your Kindle Fire into a cool programming environment or the most useful calculator ever!

New in Frink 2018-09-10 (Sep 11, 2018)

  • Updated the Frink Solver page to better pretty-print some solutions, and made the option to output in raw Frink format work consistently in all output fields.

New in Frink 2018-09-09 (Sep 10, 2018)

  • Enabled the HTTP/2 protocol in the Frink servers. This should improve performance for modern web browsers and under heavy load conditions.

New in Frink 2018-09-05 (Sep 6, 2018)

  • Released a new version of Frink: The Next Generation (version 2018-09-05) which merges several things:
  • Multiplication fixes that were in the main branch. This also helps solving of systems of equations.
  • GUI fixes that try to work around issues in Java 9 and 10. These handle more code on a separate thread.

New in Frink 2018-09-04 (Sep 5, 2018)

  • Added a fixup rule to improve solving some addition expressions. This fixes some issues in solving systems of equations, like one triggered by McKellarPuzzle.frink.
  • Improved formatting of code blocks.

New in Frink 2018-09-03 (Sep 3, 2018)

  • Made some changes to how bases are chosen in the isPrime[n] primality-testing function's Rabin-Miller implementation for very large numbers. It now again performs some trial division and always tests against bases 2 and 3 first.

New in Frink 2018-09-02 (Sep 3, 2018)

  • Released a new version of Frink: The Next Generation which merges all of the current functionality from the main branch.
  • Created a new release (2018-09-01) for Android.

New in Frink 2018-09-01 (Sep 2, 2018)

  • Updated the isPrime[n] primality-testing function's Rabin-Miller prime test to use 78 random bases instead of 78 deterministic bases. This helps mitigate the impact of adversarially-chosen numbers which are not actually prime.
  • See Prime and Prejudice: Primality Testing Under Adversarial Conditions for more about primality-testing weaknesses in software.
  • Added a test program, PrimeAndPrejudice.frink, which tests against the specific numbers found in the above paper. Frink's implementation could mistakenly declare prime the specially-constructed composite numbers in appendices F, G, and H.

New in Frink 2018-08-29 (Aug 29, 2018)

  • Added an expression constructor to create a pattern that matches anything.

New in Frink 2018-08-28 (Aug 29, 2018)

  • Fixed a solving rule in the experimental powerTransformations.frink transformation library to not (sometimes!) conflict with better rules for rational numbers defined in solvingTransformations.frink.
  • Revised the experimental powerTransformations.frink transformation library to use the natural log instead of log10 in its solutions, allowing simplification of expressions that use the natural log. For example: this thermodynamics problem.
  • Updated the Frink Solver page to display multiple solutions better. Its solutions are once again more correct by the fixing of the above-mentioned rules.
  • Added a library, deBruijn.frink, to calculate de Bruijn sequences. When you need them, you'll know.
  • Canonicalized a bunch of URLs in sample programs to point to https://frinklang.org/.

New in Frink 2018-08-07 (Aug 7, 2018)

  • Made the parser more efficient in some cases.
  • Forward-compatibility fixes of the lexer for newer versions of JFlex.
  • Released a new version of Frink: The Next Generation with fixes for parsing Unicode identifiers. Previously, you might see error messages for Unicode identifiers, especially when they are represented by two Unicode surrogate characters at the beginning of a line after a line break or semicolon.

New in Frink 2018-07-14 (Jul 15, 2018)

  • Released a new version of Frink: The Next Generation with an updated version of the JavaCUP parser generator (version 11b-20160615). This should not contain any user-noticeable changes, but paves the way for such features as syntax completion, improved error messages, fixes potential parser size problems, and more.

New in Frink 2018-05-30 (May 31, 2018)

  • Improved performance of the floor, ceil, round, and truncate functions. These were significant in some programs.
  • Improved performance of writing graphics to HTML, SVG, and SVGZ formats. Some programs are now up to 13 times faster when writing these files.

New in Frink 2018-05-29 (May 30, 2018)

  • Added a sample program, Pochhammer.frink, to calculate the Pochhammer function. This function is closely related to the gamma function, which is closely related to the factorial. The implementation also extends the Pochhammer function to negative values of k and even works with symbolic arguments.

New in Frink 2018-05-26 (May 28, 2018)

  • Updated the Frink Solver page to allow the user to specify the units of measure used to display the result. This page is getting pretty cool.
  • Try this ballistics example of a particle being shot upward which lets you calculate for initial height (h0), initial velocity (v0), time (t), gravitational acceleration (gravity) and solve for any one of these variables, both symbolically and numerically. It is neat. It even integrates for you!

New in Frink 2018-05-10 (May 26, 2018)

  • Fixed a bug in poissonProbability[k,expected] function when k was exactly 1. The function was also simplified.
  • Renamed some variables and comments to be more internally consistent.
  • Added comments describing how the binomial distribution approximates the Poisson distribution in certain cases.

New in Frink 2018-05-02 (May 2, 2018)

  • Fixed currency conversions to work again.

New in Frink 2018-04-26 (Apr 26, 2018)

  • Added functions to allow you to compress or decompress files using the GZIP format on the fly. See the Compressing/Decompressing Files section of the documentation for more.
  • Added constructors for the Writer class that take java.io.OutputStream or java.io.Writer, so you can easily write to an already-existing stream. This enabled the GZIP compression above.

New in Frink 2018-04-15 (Apr 15, 2018)

  • Added isString[expr] function

New in Frink 2018-02-20 (Feb 20, 2018)

  • No major new features, but fixed a build issue that might have affected people running on Java 1.6 or 1.7.
  • Fixed a problem when printing a regular expression.

New in Frink 2018-02-13 (Feb 14, 2018)

  • Fixed a bug in the command-line options that didn't set the window width or height correctly. See the GUI Options section of the documentation for more.
  • Made the --width and --height command-line options also work with SwingInteractivePanel.
  • Added a command-line option --fontsize int to set the font size of frink.gui.InteractivePanel or frink.gui.SwingInteractivePanel or frink.gui.FullScreenAWTStarter or
  • Made changes to the mod operator to improve containment, specifically when using imprecise floating-point arguments in the cases where numeric precision is being lost (such as when one argument is much bigger than the other.) When no meaningful result can be given, this can now return 0.

New in Frink 2018-01-14 (Jan 15, 2018)

  • Added some performance optimizations:
  • Improved calling functions that are called by a variable name.
  • Optimized calling of blocks with empty bodies.
  • These reduced the runtime of some programs by 40%.

New in Frink 2018-01-09 (Jan 9, 2018)

  • Important: Fixed a bug in the range operator (that is, any loop that contains the to keyword) that might have caused infinite loops when the ends of the loop were near or exactly 231-1 or, when counting downwards, around -231.

New in Frink 2018-01-02 (Jan 4, 2018)

  • Added isDate[expr] which returns true if the expression is a date/time, false otherwise.
  • Updated prediction of deltaT to be constantly 69.184 s through the end of 2018 (previously, this was only the prediction through July 1, 2018. It has not yet been announced if a leap second will be added on that date, but an announcement is expected within the next 6 days.)
  • Fixed a crash when calculating deltaT around the year 1988.
  • Future predictions of deltaT will probably use a variety of data sources, including:
  • Curve fits by Espenak and Meeus (link opens in new window) which were last updated about 2005 and may diverge from current best predictions.
  • U.S. Naval Observatory historical tabulations of deltaT from 1973-(approximate) present (link opens in new window) which are supposed to be updated "quarterly" but are now more than 6 months out of date.
  • USNO predictions for the next 8 years (link opens in new window) Note that these have rather large error margins (about 5 seconds in the next 8 years.)
  • It should be noted, however, that these data sources do not and will not always agree with each other. It's apparently difficult to predict the future.

New in Frink 2017-11-16 (Nov 16, 2017)

  • Rewrote the internals of the mod and div operators for better performance, especially for integer values.

New in Frink 2017-11-15 (Nov 15, 2017)

  • Fixed a build issue where the TAI timezone class might not have been included in the build.
  • Improved parsing and formatting of Julian Day (JD), Modified Julian Day (MJD), and Julian Day Ephemeris (JDE), especially when intervals of dates are passed in.
  • Improved construction of date intervals. Construction of date intervals now follows the collapseIntervals function's directives for degenerate intervals. Sanity checks were also improved.
  • Improved automatic mapping of Frink types to/from Java's BigInteger and BigDecimal.

New in Frink 2017-11-14 (Nov 14, 2017)

  • Important: Fixed a bug in constructing rational numbers when the numerator or denominator is exactly -231. Please update as soon as possible.
  • This bug could also affect the div operator when one of its arguments was exactly -231. Removed some unused code.

New in Frink 2017-11-01 (Nov 2, 2017)

  • Rewrote the incomplete time zone definition TAI (also called International Atomic Time) which was hiding in the code and hard-coded to an old offset. The new definition takes into account not only historical and announced future leap seconds, but also interpolates for the period from 1961 January 1 to 1972 January 1 where the difference between TAI and UTC was constantly and linearly interpolated. For more information see the Leap Seconds section of the documentation.

New in Frink 2017-10-23 (Oct 23, 2017)

  • Behavior change: Modified the GeneralPath.addPoint[x, y] method to more closely match polygon or polyline. If the point added is the first point, this does a moveTo the specified point. If there are previous points, this does a lineTo the specified point. This may simplify code by eliminating the initial moveTo call and allows easy migration from polygon or polyline to GeneralPath.
  • Behavior change: The GeneralPath.close[] method now explicitly forces you to add a moveTo or addPoint before starting a new curve. This how the documentation always insisted that you do things, but the code might have implicitly allowed the previous point to be used.
  • Improved error messages when something goes wrong in JSON parsing.
  • Fixed a potential performance problem in the floor, ceil, trunc, and int functions.
  • Many Frink Server Pages examples are now more mobile-friendly.

New in Frink 2017-09-30 (Oct 10, 2017)

  • Extended the select[list, substr] function to allow a substring as the second argument. This will return items which contain the specified substring (with an exact match.) If you need a case-insensitive match, the second argument should be a regular expression.
  • A new function, timezones[pattern] was added, allowing you to list timezones that match any pattern that match the specified pattern. The pattern can be anything matched by the select function: that is, a function (that returns true for matches,) a regular expression, or an exact substring.

New in Frink 2017-09-13 (Sep 14, 2017)

  • Further improvements to the JSON parsing function, including improvments when empty arrays are encountered.
  • Graphics can now be rendered to the SVGZ format, (which is the existing Scalable Vector Graphics (SVG) format that Frink could render to before,) but compressed using the GZIP compression algorithm. Since SVG files usually contain a lot of repetition, using this format will significantly reduce file size and should be parseable by most programs that can handle SVG files.
  • Unfortunately, when testing this, I found out that the common image viewer "Eye of Gnome" (eog) or "Eye of Mate" (eom) chokes on large SVGZ files with a "huge input lookup" error. (It opens the same uncompressed file just fine.)

New in Frink 2017-09-12 (Sep 7, 2017)

  • Fixed problems with the JSON parsing function JSONParse[str]:
  • Floating-point numbers can now be negative. This threw a parsing error before.
  • Arrays can now be empty.
  • Improved error messages when parsing errors occurred.

New in Frink 2017-08-19 (Aug 29, 2017)

  • Fixed the eclipse.frink sample program that calculates solar and lunar eclipses
  • These ways are:
  • Fixed drawing of the moon and sun, especially near the zenith. Previous drawings got worse the higher in the sky the eclipse occurred.
  • Now calculates the percentage of solar eclipse.
  • The program now renders an animation of the path of the moon and sun.

New in Frink 2017-08-17 (Aug 17, 2017)

  • Implemented some missing hyperbolic trigonometric functions:
  • csch[x]: Hyperbolic cosecant of x, equivalent to 1/sinh[x], or 2/(ex - e-x). For some reason, arccsch[x] was already implemented.
  • sech[x]: Hyperbolic secant of x, equivalent to 1/cosh[x], (which was already implemented,) or 2/(ex - e-x)
  • arcsech[x]: Inverse hyperbolic secant of x, or ln[sqrt[1/x - 1]*sqrt[1 + 1/x] + 1/x]
  • coth[x]: Hyperbolic cotangent of x, (e2x + 1) / (e2x - 1)
  • arccoth[x]: Inverse hyperbolic cotangent of x, or 1/2 ( ln[1 + 1/x] - ln[1 - 1/x] )

New in Frink 2017-08-15 (Aug 16, 2017)

  • Behavior change: Made the Writer class try harder to use platform-specific newline characters in its println method.
  • Added zero-argument writeln[] and println[] methods to simply append a newline to the file.
  • There are also subtle internal changes to buffering:
  • A buffer is now always used by default, even when a buffer size is not specified, so you may need to call flush more often if you need data to be written immediately.
  • If you do not specify a buffer size, the file is still flushed on each println. If you do specify a buffer size, you will need to flush manually (this is to let you squeeze out a bit more performance.)
  • 2017-07-08

New in Frink 2017-07-08 (Jul 10, 2017)

  • Behavior change: Fixed some handling of command-line arguments in the GUI, especially in programming mode. Note that this may change behavior of some programs, depending on how you launch Frink:
  • Specifying your own units file using the -u filename command-line option now also applies to programming mode in the GUI, and not just to interactive mode. Be warned if you're loading a custom units file.
  • This change applies to all command-line options. Options which were previously only applied to interactive mode are now applied to programming mode also.
  • Eliminated some possible error messages when launching Frink using the -open filename option. (This is how double-clicking a .frink file works in Windows or some Linux environments with the proper file association set.)
  • Fixed the definition of paper areal densities like poundbookpaper which had incorrect dimensions.
  • If you wanted to estimate the mass of a U.S. letter page of "20 pound bond" paper, you could calculate it as:
  • 20 poundbondpaper * 11 in * 8.5 in -> "grams"
  • 4.5359237 grams
  • Added the dimension combination area_density to describe the mass density per area of a sheet of something, such as kg/m^2.
  • Thanks to Nathan Schiffer for an excellent bug report on most of the previous issues (and some that I have yet to research.)
  • Improved the error message when a user-defined sorting function does not return integer values.
  • Fixed a problem when using a custom data file that defines the radian as a fundamental dimension. (You really don't ever want to do this, unless you're having a really hard time debugging an example that uses angles.) The inverse trigonometric functions like arcsin and arccos were not returning the results with dimensions of radians, and possibly producing conformance errors.

New in Frink 2017-05-20 (May 22, 2017)

  • Added a copy constructor for Polygons and Polylines. This makes it easier to do things like creating stroked and filled polygons.

New in Frink 2017-05-17 (May 22, 2017)

  • Updated the stellarMagnitude.frink sample program to allow easier calculations of stellar magnitudes, power fluxes, and apparent brightnesses. It additionally adds functions to calculate photon energies, frequencies, or wavelengths given one of the other variables.

New in Frink 2017-05-09 (May 22, 2017)

  • Added a ConvexHull.frink sample program to calculate (and optionally graph) the convex hull of a bunch of points using the Graham scan algorithm (which is O(n log n) ).

New in Frink 2017-05-06 (May 7, 2017)

  • Reinstated translations to and from Polish and Greek.
  • The graphics.write... methods now allow you to specify exactly one of the width or height as undef, the undefined axis will be calculated from the defined width or height and the aspect ration of the graphics that is being drawn.
  • Added --prog command-Line option to start Frink in programming mode.
  • Fixed a potential problem with the -open filename command-Line option if passed a relative filename without a parent.

New in Frink 2017-04-26 (Apr 26, 2017)

  • Added a cool new graphics.invertGrays[] function that makes your graphics objects invert their grayscales so you can easily make a single graphics object that looks like Wargames (black background, white lines) for on-screen display but doesn't waste your printer ink (white background, black lines) when printed. Shall we play a game?

New in Frink 2017-04-24 (Apr 24, 2017)

  • Enhanced functionality for Polygons and Polylines:
  • The constructor for polygon, filledPolygon, and polyline can now take a list of points.
  • Added the following methods to polygon, filledPolygon, and polyline.
  • .getPoints[] returns a list of the points in a polygon.
  • .getArea[] calculates the area of the polygon.
  • .getCentroid[] returns the centroid of the polygon as an [x,y] array.
  • Added a .show[] method to easily display a polygon without adding it to a graphics object

New in Frink 2017-04-13 (Apr 19, 2017)

  • Added a previousPrime[n] to efficiently return the previous prime number less than n. This complements the existing nextPrime[n] function.

New in Frink 2017-04-12 (Apr 12, 2017)

  • Drastically improved performance of parsing strings to integers. This introduces a divide-and-conquer algorithm of my own devising that improves Java's native parsing of strings to integers by several orders of magnitude for very large numbers. For example, parsing the largest-known Mersenne prime 274207281 went from 13124 seconds (that's about 218 minutes) down to 68.392 s (just over a minute), a factor of 192 times faster!
  • This improvement makes parsing of giant numbers from Java's worse-than O(n2) to about O(n1.513) at 10 million digits (with a good constant.)
  • This improvement works whenever Frink parses a large integer.
  • I may try to contribute these algorithms to Java. It took me 11 years for Java people to check in my vastly improved algorithms for multiplication and string conversion for large integers, though. These are finally part of Java 8.
  • Improved speed and memory usage of parsing integers from strings, with knowledge of each radix. When numbers between 6 and 9 digits are parsed (in base 10), parsing is now significantly faster and uses less memory. The same improvements occur for all bases from 2 to 36.

New in Frink 2017-04-04 (Apr 4, 2017)

  • Various performance improvements for factorials and binomial coefficients:
  • Factorials (using either the ! operator or the factorial[n] function) now use a binary splitting algorithm which makes them significantly faster on Java 1.8 and later. (Did you know that Java 1.8's BigInteger calculations got drastically faster because Frink's internal algorithms were contributed to it?)
  • The function factorialRatio[a, b] was added, which allows efficient calculation of the ratio of two factorials a! / b!, using a binary splitting algorithm.
  • As of the 2017-04-04 release, functions that calculate binomial coefficients like binomial[m,n] that calculate binomial coefficients are more efficient because of the use of binary splitting algorithms.
  • Note: binomial[m,n] is of the number of ways m things can be chosen n at a time, with order being unimportant. This is sometimes called "m choose n" or "m C n". This is equivalent to m!/(n!*(m-n)!) although calculating that way often leads to way-too-big numbers. For example, binomial[10000, 9998] is equal to 49995000, but if you calculated it naively, you'd have to calculate 10000! which is a 35660-digit number, and divide it by another huge number, which could be inefficient and slow.
  • For very large factorials or binomial coefficients, performance has been increased by orders of magnitude.
  • Added a section on the implementation of Factorials to the main documentation.

New in Frink 2017-02-17 (Feb 18, 2017)

  • Improvements to the function suggester.
  • Some units of volume are now made exact, including the jeroboam, rehoboam, nebuchadnezzar, etc.
  • Improvements to the continuedFraction.frink sample library, including better detection of when working precision is exceeded. This will eventually become part of the standard distribution.
  • Added a similarUnits.frink library which suggests units that are similar to a specified value. This may someday become part of the standard distribution.
  • Algorithm dispatcher now detects the upcoming Java 10.

New in Frink 2017-02-08 (Feb 9, 2017)

  • Fixed a bug when rendering HTML graphics. If the computer was set to certain locales, alpha channel opacity levels would be rendered with a comma decimal separator instead of a period. Thanks to Alexander Kosenkov for the report.
  • Opacity levels in SVG files are now rounded to 3 decimal places.
  • Improved performance of primality testing for mid-sized numbers. Thanks to the work of Sorenson and Webster, isPrime[n] is now guaranteed to prove primality for numbers up to 3,317,044,064,679,887,385,961,981, and uses a smaller number of pseudoprime tests up to this value, improving performance of both primality testing and factorization.

New in Frink 2017-02-07 (Feb 8, 2017)

  • Fixed a bug that affected some functions that take other functions as arguments, such as sort[array, function]. If the passed-in function had multiple return statements instead of a single simpler expression, it might not behave correctly. (For example, in the case of sort the array might not be fully sorted.) This may have affected:
  • sort functions with user-defined comparison functions.
  • map
  • select
  • Constraint functions
  • The internals of function calling have been revised and improved to prevent this type of error in the future

New in Frink 2017-02-03 (Feb 5, 2017)

  • Fixed a bug in the Web Interface that broke the ability to set variables persistently.

New in Frink 2017-01-14 (Jan 16, 2017)

  • Added a rangeOf[array] which returns an enumeration of all the indices in an array

New in Frink 2017-01-07 (Jan 16, 2017)

  • If you try to call a function that doesn't exist, Frink will now try to suggest functions (and methods, if called from within a class) with similar spellings and argument lists:

New in Frink 2017-01-01 (Jan 4, 2017)

  • Behavior change: Improved the behavior of the eval[expr] and unsafeEval[expr] functions to behave better when evaluating an expression containing an already-compiled list of statements (that is, a multi-line program compiled with parseToExpression[str].) It now behaves much more similarly to running that program directly. It now returns the same return value as running the program would, rather than the odd previous behavior of returning an array of results from each statement.

New in Frink 2016-12-30 (Jan 4, 2017)

  • Behavior change: Improved the behavior of the eval[expr] and unsafeEval[expr] functions to behave better when evaluating an expression containing an already-compiled list of statements (that is, a multi-line program compiled with parseToExpression[str].) It now behaves much more similarly to running that program directly. It now returns the same return value as running the program would, rather than the odd previous behavior of returning an array of results from each statement.

New in Frink 2016-12-29 (Dec 21, 2016)

  • Improved some error messages, especially in the cases of class members with constraints.

New in Frink 2016-11-29 (Dec 5, 2016)

  • Improved some error messages, especially in the cases of class members with constraints.

New in Frink 2016-11-28 (Dec 5, 2016)

  • Fixed a bug in getBit[n, bit] that affected n that would fit into a 32-bit integer and where the requested bit was outside of the integer. Thanks to Jeremy Roach for the research and bug report.
  • Improved the error message for a function definition that incorrectly uses = instead of :=

New in Frink 2016-11-15 (Nov 16, 2016)

  • Fixed currency conversions to work again.

New in Frink 2016-11-14 (Nov 15, 2016)

  • Fixed a bug in the two-argument read[URL, encoding] function to read from a file or a URL where you specify the encoding of the file or URL. The encoding might have been ignored.

New in Frink 2016-11-06 (Nov 15, 2016)

  • Enhanced the DiscreteDistribution.frink sample library (which allows you to choose between items with a specified probability distribution) to also allow efficient selection of a deterministic item from the distribution.
  • Fixed the Bitcoin example in the documentation to match Coindesk's dropping of HTTPS access.
  • Fixed the bitcoin.frink sample program to match Coindesk's dropping of HTTPS access.

New in Frink 2016-11-02 (Nov 2, 2016)

  • Added the graphemeLength[str] function which returns the length of a string in graphemes, counting multiple Unicode codepoints that should be combined together as a single display glyph as a single character. See the Correct String Parsing section of the documentation for more details.
  • Fixed obscure classloading problems that only seemed to manifest themselves when run on an odd configuration (e.g. Tomcat 4 with a custom classloader running on Java 1.4). These might show up as a failure to initialize something like class frink.text.c. This may also fix running on a Java 1.6 or 1.7 JVM.

New in Frink 2016-10-28 (Nov 2, 2016)

  • Fixed the build for the experimental compiled Windows Frink binary. This is not the best way to run Frink at all, but there it is.
  • Fixed the build of FrinkSamples.zip of all sample Frink programs available on the sample programs page.

New in Frink 2016-10-27 (Oct 27, 2016)

  • To complete the lexicalSort functions, there are now similar methods that compare two strings using human language rules and Unicode normalization:
  • lexicalCompare[string1, string2] - Compares 2 strings using a comparison method that understands human languages. This version uses the default locale and language settings defined on your Java Virtual Machine to perform the comparison.
  • lexicalCompare[string1, string2, languageCode] - Like the previous function, this compares 2 strings using a comparison method that understands human languages. This version uses a specified language.
  • The argument languageCode can be one of three types:
  • A string containing a 2-letter ISO 639-1 code for the language, such as "en" for English.
  • A java.text.Collator
  • A java.util.Locale

New in Frink 2016-10-26 (Oct 26, 2016)

  • Backward compatibility fix for Java before 1.4. (The constructor Locale(String language) did not exist, so if you're on a very old JVM, you'll have to construct Locales manually with a language and a country.)
  • Improved error messages when strange characters are encountered in input.
  • Removed information about obsolete technologies from the documentation (e.g. Mac dashboard widgets, google gadgets, Sherlock search plugins, Palm compatibility, browser keywords, Palm devices, etc.) Frink has outlived you all.

New in Frink 2016-10-25 (Oct 25, 2016)

  • lexicalSort[array] sorts an array of strings using the default language and locale settings defined in your Java Virtual Machine.
  • ◦lexicalSort[array, languageCode] sorts according to the rules of the specified human language. languageCode is the ISO 639-1 two-letter code for the language.
  • If you need extreme control over the sorting order, languageCode can also be either a java.text.Collator or a java.util.Locale object which allows you very detailed control over creating custom sorting rules or locales. Please see the documentation for those classes for details on controlling sorting.
  • These allow Frink programs to sort many, many human languages correctly and easily, and allow correct internationalization and handling of strings, and make you look really smart.
  • See the Lexical Sorting section of the documentation for more details on these functions.
  • Some functions that sort their output (e.g. the "help" operator) that sort their output now sort them using correct lexical sorting order.
  • Made several usability and functionality improvements to the Swing and AWT user interfaces: ◦There are now quick keys (control-minus and control-equals) for increasing and decreasing the size of the fonts used.
  • Several improvements to focusing and scrolling.
  • The AWT output dialog from programming mode is now non-modal.

New in Frink 2016-10-20 (Oct 20, 2016)

  • Frink's comparison operators, such as < , == , >= , including the three-way comparison operator can now compare Java objects that implement the java.lang.Comparable interface. This includes numeric types, strings, and many other types.

New in Frink 2016-10-19 (Oct 19, 2016)

  • Frink can now sort Java arrays directly and in-place if they implement the Comparable interface.
  • MANY IMPROVEMENTS TO SAMPLE LIBRARIES THAT PROVIDE ARBITRARY-PRECISION CALCULATIONS:
  • ArbitraryPrecision.frink:
  • Added arbitrary-precision power function, improved natural log, cosine, sine, tangent, and exponentiation functions.
  • Gamma.frink: Contains a working arbitrary-precision calculator for the gamma function (a generalization of the factorial function) which works for large and small arguments.
  • pi.frink: Fixed cases where the number of digits requested is small.

New in Frink 2016-10-18 (Oct 18, 2016)

  • Added normalizeUnicode[string, method="NFC"] function. This function normalizes the characters in a Unicode string using one of the methods described in the Unicode standard, specifically Unicode Standard Annex #15, Unicode Normalization Forms.
  • A Unicode string can use various methods to encode what is essentially the same character/glyph. For example, the character ô can be represented as either "u00F4" or "u006Fu0302". The former is a "composed" character, "LATIN SMALL LETTER O WITH CIRCUMFLEX", and the latter is two Unicode codepoints, an o followed by "COMBINING CIRCUMFLEX ACCENT". (This is usually referred to as a "decomposed" representation.) This function can convert these "equivalent" encodings into a canonical representation, whether it be composed or decomposed.
  • Unicode Standard Annex #15 currently defines four different methods of converting between these representations. (You might get the best idea of the differences between these by looking at figure 6 in the document.)
  • See the Other String Functions section of the documentation for more details on this function.

New in Frink 2016-10-14 (Oct 17, 2016)

  • Minor usability fixes to the AWT and Swing user interfaces:
  • When loading a program in programming mode, the file is scrolled to the top instead of the bottom.
  • Tried harder to keep output window scrolled to the bottom in AWT and Swing.

New in Frink 2016-09-29 (Sep 29, 2016)

  • Behavior change:
  • When converting from Java byte to Frink types, bytes are now always returned as positive, unsigned values. That is, you no longer see Java's weird negative bytes that nobody in the world has ever wanted. (You could always convert numbers up to 255 into bytes, so this behavior change is only on output. You can still put negative numbers from -128 to -1 into bytes, but they'll be made into positive values when converted back to Frink types. This does not change their representation in Java objects.)
  • Possible behavior change:
  • The messageDigest functions now force their input to be converted to bytes using the UTF-8 encoding before hashing. Previously, they used your platform's default encoding (which was likely UTF-8 already) but which may not have been portable from one system to another. See the Cryptographic Functions section of the documentation for more details on how to modify this behavior.
  • The messageDigest functions have been improved in several ways:
  • All messageDigest functions can now take an array of Java bytes as input.
  • Added a messageDigestBytes[input, algorithm] function to return the message digest as an array of Java bytes. Note: Most of the underlying cryptography routines in Java work with arrays of bytes, as these are safer than Strings which are immutable after construction and are eventually garbage-collected. Using arrays of bytes means that you can zero-out input buffers as soon as you're done with them.
  • Internal changes to ensure more reliable operations on platforms with sketchy implementations or strange encodings that can't encode all characters.
  • See the Cryptographic Functions section of the documentation for more details.
  • Added functions to convert strings to an array of bytes (with specified encoding) and vice versa:
  • stringToBytes[str,encoding="UTF-8"] turns a string into an array of Java bytes using the specified encoding. The encoding defaults to UTF-8, but can be a string indicating any encoding supported on your system.

New in Frink 2016-09-21 (Sep 21, 2016)

  • Possible functionality change: Improved the behavior of parsing user-defined date/time formats.
  • The new behavior is that user-defined date formats, are given precedence when parsing. Frink will first attempt to match any user-defined date format, and, failing this, will attempt to match one of the formats in the default date formats file. This prevents ambiguity when two different patterns can match the same date. This usually happens only when a user-defined format uses a two-digit year (please don't do this, as even humans can't distinguish what format is intended in many cases. Learn from the lessons of Y2K, and prefer date formats like ISO-8601 where significant digits are first, like yyyy-MM-dd.)
  • This should not change the behavior of any program that worked correctly before, but might change the behavior of a program which was spuriously matching patterns incorrectly. Thanks to Jerrett Townsend for the bug report.
  • Frink can now parse Unicode superscript numbers as indicating exponentiation, such as 10⁻²³, which is equivalent to writing 10^-23, or x³, which is equivalent to x^3. See the Unicode Operators section of the documentation for more discussion and caveats.
  • Added and documented several Unicode operators as synonyms for multiplication and division. This makes it easier to cut and paste mathematical expressions from other sources and do the right thing with them. See the Unicode Operators section of the documentation for more details.

New in Frink 2016-09-15 (Sep 21, 2016)

  • Added function toUnicodeSuperscript[int] to turn an integer into a string containing the equivalent Unicode superscript digits in base 10.
  • Added internal functions to more efficiently perform base conversions with custom alphabets, especially with smaller numbers.
  • RingBuffer is now deep copyable with the deepCopy[expr] function.

New in Frink 2016-08-31 (Aug 31, 2016)

  • Added RingBuffer.isFull[] method.

New in Frink 2016-08-30 (Aug 30, 2016)

  • Added a RingBuffer class that is useful for making efficient limited-sized queues and caches.

New in Frink 2016-08-21 (Aug 30, 2016)

  • Added a DiscreteDistribution.frink sample library which allows you to choose between items with a specified probability distribution.

New in Frink 2016-07-24 (Aug 30, 2016)

  • For Android: Fixed a potential crash when trying to load from a partition that isn't actually there.

New in Frink 2016-07-18 (Aug 30, 2016)

  • For Android: Frink now tries harder to request that your Android device does not auto-correct text in Frink's entry fields. Because that will make you insane when programming. Be warned that some third-party keyboards like SwiftKey will still autocorrect even though applications state that fields should not be autocorrected.

New in Frink 2016-07-11 (Aug 30, 2016)

  • Added a demonstration of sending e-mails, SMS, or other messages from Android. See the Sending Intents section of the android documentation.

New in Frink 2016-07-08 (Jul 9, 2016)

  • The padLeft[str, width, padChar] and padRight[str, width, padChar] functions can now take an arbitrary expression (instead of just a string) as the first argument. This makes it easier to pad numbers (but to be safe, you probably want to make sure that they're stringified correctly first.)
  • The output of the timezones[] function is now sorted.

New in Frink 2016-07-07 (Jul 8, 2016)

  • Fixed a case in the "help" operator when only functions were matched. This could cause NullPointerExceptions. Thanks to Louis Blaine for the bug report.

New in Frink 2016-07-06 (Jul 7, 2016)

  • Behavior change: Output from the double-question-mark "help" operator is now correctly displayed.
  • It was possible that one of the lines was incorrectly appended to the other. In addition, instead of returning a list of strings, the double-question-mark help operator now returns a single string.
  • The single-question-mark's behavior remains unchanged, other than still being sorted.
  • It was announced today that a leap second will be added at the end of December 2016.
  • Validated that Frink's internal data file (loaded from the US Naval Observatory's tabulation of leap seconds) has the new leap second. For more information see the Leap Seconds section of the documentation.
  • Updated deltaT calculations with the new leap second.

New in Frink 2016-06-25 (Jun 25, 2016)

  • Output from the "help" operator is now sorted, first by unit names and then by function names.
  • Function descriptors can now be sorted and compared.

New in Frink 2016-06-07 (Jun 7, 2016)

  • Added the array.transpose[] method to transpose the elements of a 2-dimensional array, like in matrix calculations. This means that rows and columns are swapped. In other words, the element at array@i@j becomes the element at array@j@i.
  • Updated the Matrix.frink sample library to use the above-mentioned transpose function.

New in Frink 2016-05-29 (May 29, 2016)

  • Added the function lineBreakList[string] which returns an enumeration of the places that a line can be broken. It correctly handles punctuation, numbers, and hyphenated words. See the Correct String Parsing section of the documentation for more details.

New in Frink 2016-05-28 (May 29, 2016)

  • Functionality Change: Improved the reverse[str] which reverses a string. This is now a smarter reversal that follows Unicode rules to keep combining characters together and properly ordered.
  • For example, the string "g\u0308o" represents a g with combining diaeresis followed by the letter o. Or, in other words, "g̈o". Reversing this naïvely would cause the diaeresis to incorrectly show over the o instead of the g.
  • As another example, the Devanagari string "\u0915\u094D\u0937\u093F" (shown as क्षि ) is recognized as a single grapheme and the 4 Unicode codepoints that make it up are kept intact and not reversed.
  • If you, for some reason, need the old behavior, you can do something like:
  • reverse[charList[string]] but keep in mind that this will still do the right thing like keeping surrogate pairs ordered correctly. Don't do this. It's never right for Unicode strings. Frink tries to always work on Unicode strings, and not individual characters, as working on individual characters or codepoints is almost always the wrong thing to do when processing Unicode.
  • Added methods to break up strings and iterate among their parts. Each of these returns an enumerating expression that allows you to loop through the parts of a string. See the Correct String Parsing section of the documentation for more details on the following: ◦graphemeList[string]: Enumerates through the graphemes of a string.
  • wordList[string]: Enumerates through the words of a string.
  • sentenceList[string]: Enumerates through the sentences of a string.

New in Frink 2016-05-04 (May 4, 2016)

  • Added the ability to perform base conversions with custom alphabets. This allows you to both parse and format numbers in another base using a custom character set (as opposed to, say, the typical "0123456789abcdef" alphabet of base 16.) It also allows you to do custom base conversions well above base 36.

New in Frink 2016-04-02 (Apr 4, 2016)

  • Added image.resize[width, height]] method to resize an image to the new specified width and height and returns a new image. It does not modify the original image. If either width or height are the special value undef or 0, then one dimension is constrained and the other dimension is calculated to preserve the aspect ratio of the original image.

New in Frink 2016-03-31 (Mar 31, 2016)

  • Added multiplication by scalar to the Matrix.frink sample program.
  • Added functions to calculate inverse transformation matrices in the geometry.frink sample program.
  • Internal code additions to coordinate transforms and graphics views. These are intended to help pave the way for clickable, interactive graphics.

New in Frink 2016-03-30 (Mar 30, 2016)

  • Added removeSlice[array, start, end] and removeSliceLength[array, start, length] functions to remove a "slice" from an array. These are the inverses of the previously-existing slice[array, start, end] and sliceLength[array, start, length] functions. See the Slicing Arrays section of the documentation for more.
  • Reorganized the documentation for array methods to make it more readable.

New in Frink 2016-03-29 (Mar 30, 2016)

  • Rewrote exponentiation of complex numbers where the power is an exact (positive or negative) integer. For example, (3 + 2i)^3 or (3 + 1/2 i)^4. Results are improved in several ways:
  • Results are now complex numbers made up of exact integers or rational numbers when possible. (Previously, they were just exact up to powers of 2.)
  • Much larger or smaller results can now be obtained (previously, results were limited to IEEE-754 exponent ranges.) This is true even if the base is not composed of exact integers or rational numbers.
  • Floating-point errors are decreased or eliminated.
  • Increased precision is available even when the base contains floating-point numbers.
  • Thanks to Udi Finkelstein for the suggestions/bug report.

New in Frink 2016-01-14 (Jan 14, 2016)

  • Completely rewrote the routines that provide Historical British Price Data. These should now work again, be more up-to-date, and initialize faster and more lazily.

New in Frink 2016-01-05 (Jan 6, 2016)

  • Wrote a cool demonstration program greatCircleMap.frink which draws world maps centered on your location. This is based on the previous drawCountries.frink program which draws maps with different projections
  • Updated the Country.frink library containing country shapes to have the country's polygons sorted from largest to smallest. This simplified mapping above and is more logical

New in Frink 2016-01-03 (Jan 6, 2016)

  • Improved the eval[expr] and unsafeEval[expr] functions so they wouldn't totally die when evaluating an array in which an element throws an exception. Now, elements of the aray that throw exceptions are returned as the special value undef
  • Added positive[array] function to systemSolver2.frink which returns only positive results from a list
  • Made tvaspect.frink work consistently and only return positive results! Woo

New in Frink 2016-01-02 (Jan 6, 2016)

  • Fixed the deltaT function which did not take into account the leap second introduced at the beginning of 2015-07-01. It was handled correctly in the Leap Seconds calculations, though. The calculations for delta-T need to be unified with the (automatically updated, smarter) leap seconds functions to avoid this issue in the future
  • As a corollary of the above, my MIThenge predictions may be up to a second off for 2016 and may need recalculation. However, this error is much smaller than the current best uncertainty in the azimuth of the Infinite Corridor
  • Updated future deltaT predictions for the year 2016. The earth's rotation hasn't been slowing down as much as predicted in the past, and future predictions may need to be researched and updated if new predictions are available
  • Updated copyright dates for 2016. Happy New Year
  • Updated sanity checks to 2016 for economic routines

New in Frink 2015-11-05 (Dec 15, 2015)

  • Important: Fixed a bug in algebraic simplification of power expressions like (1/2)^(-1/2) (which works correctly and transforms to 2^(1/2)) but did not work correctly in some cases if the base had units of measure and had a rational number for its scale and the exponent was a negative rational number.
  • Due to the way this code is invoked, it only appears to happen when using Frink's (somewhat undocumented) symbolic transformation capabilities which triggered this case. That is, it only appears to occur when building a symbolic expression and then transforming it by substituting parts of the expression. However, in any case, it is strongly recommended that you update whether you are using symbolic transformations or not.
  • Added a sample program to demonstrate Frink's symbolic solving capabilities which answers the question: If you dismantled the Great Pyramid of Giza, could you build a wall around France with the stone? And how big and thick could the wall be? GreatPyramid.frink

New in Frink 2015-10-22 (Oct 23, 2015)

  • Added new expression constructors for several expression types. This allows them to be used in symbolic transformations.
  • Added a sample of definite integration to integrals.frink. This still needs some support from new language features to work seamlessly and efficiently.

New in Frink 2015-10-08 (Oct 8, 2015)

  • Improved many error messages, especially those for conformance exceptions such as adding two values with different dimensions.
  • Updated all internal links to point to the new canonical Frink home, https://frinklang.org/

New in Frink 2015-10-04 (Oct 5, 2015)

  • Added factorFlat[x] function to factor integers and return the results as a one-dimensional list instead of the two-dimensional list returned by factor[x]. This really isn't necessary, but makes some functional programs slightly easier to write.

New in Frink 2015-10-01 (Oct 1, 2015)

  • Increased some internal cache sizes which should improve memory performance for certain types of programs.
  • Improved error messages for some operations.

New in Frink 2015-09-23 (Sep 23, 2015)

  • Added a VenusApparent.frink sample program to graph the apparent position of Venus as seen from Earth. This uses the amazing planets.frink sample program which calculates the locations of the planets to high accuracy.
  • Added a function approximationsWithErrors to the continuedFraction.frink program to easily calculate the errors in continued fractions. This is demonstrated in the above program.

New in Frink 2015-09-10 (Sep 12, 2015)

  • Changed the manifest in the frink.jar file to make the applet-based interface and the Java Web Start file work better from multiple hosts with modern Java security checks.

New in Frink 2015-08-23 (Sep 12, 2015)

  • Fixes problem in the use statement on some platforms where the underlying system may throw a null pointer exception. This primarily affected Android 5.0.1 and higher. Thanks to Karel Šnajdr for the problem report and debugging.

New in Frink 2015-07-04 (Jul 13, 2015)

  • Once again updated the code for U.S. historical currency conversions because my new data source evidently just switched to an HTTPS-only link.

New in Frink 2015-06-30 (Jul 1, 2015)

  • The new 2014 CODATA values for the fundamental physical constants of the universe have just been published and Frink has been immediately updated! Be the first kid on your block to use the most accurate, authoritative, latest and greatest international research that has been compiled over the last 4 years!
  • This includes changes in fundamental constants like Planck's constant (h), the gravitational constant (G), Avogadro's constant (avogadro), Boltzmann's constant (k), the gas constant (R), fundamental particle masses and charges, and hundreds more constants that rely on these values.
  • The standard data file has all of the changes and links to the new CODATA values.
  • There will be a leap second added to the clock at the end of this date. Frink has known about this leap second since it was announced on 2015-01-05. To find out when the leap second will occur in your local time (in case you want to watch your atomic clock to see what it does,) in your local copy of Frink, execute:

New in Frink 2015-06-29 (Jun 30, 2015)

  • Rewrote the source for U.S. historical currency conversions because I noticed that the previous Consumer Price Index source is no longer being updated regularly. (It's pretty sad when the Bureau of Labor Statistics, the original source of CPI data, can't even keep primary sources up-to-date. Also their "contact us" forms are broken. Yay government.) The new source comes from the St. Louis Federal Reserve, specifically by parsing this file. The new data is also cached in each Frink jar file in case you don't have network connectivity.

New in Frink 2015-06-10 (Jun 10, 2015)

  • Updated sanity checks and performance optimizations to detect Java 9 and other VMs.
  • Removed debugging information that might have leaked to standard error.

New in Frink 2015-05-08 (May 9, 2015)

  • Added graphics.backgroundColor[colorObject] method that sets the background color from a previously-obtained color object.

New in Frink 2015-05-07 (May 8, 2015)

  • Fixed formatting of for and multifor loops that have labels.

New in Frink 2015-05-06 (May 7, 2015)

  • Added getExponent[unit, dimension] to get the exponent for the specified base dimension. See the Other Functions section of the documentation for details.
  • Updated sanity checks and performance optimizations to detect Java 9.

New in Frink 2015-03-03 (Mar 4, 2015)

  • Rewrote code for sizing and placing windows:
  • Frink now requests that the operating system uses its algorithm for placing new windows (instead of letting Java do it badly.) This usually means that multiple graphics windows will be placed next to each other, rather than on top of each other, if your windowing system has a reasonable layout algorithm. This requires Java 1.5 or later to work, but previous versions of Java are still supported.
  • Rewrote the code for creating exactly-sized graphics windows. This means that the content of your windows will be exactly the size requested when using graphics.show[width, height]
  • image.show[] should now consistently display images at their exact native size by default. Previously, it may have been a couple of pixels off.
  • Initial user interface windows will more likely be placed sensibly, if your windowing system supports it.

New in Frink 2015-03-012 (Mar 3, 2015)

  • Modified the int[x] and trunc[x] functions (which are the same thing) to work for interval arguments.

New in Frink 2015-03-01 (Mar 2, 2015)

  • Addded functions to enumerate the partitions of an integer:
  • partitions[n] Returns an enumeration of the partitions of the integer n. For example:
  • for a = partitions[4]
  • println[a]
  • [4]
  • [3, 1]
  • [2, 2]
  • [2, 1, 1]
  • [1, 1, 1, 1]
  • partitionsCompact[n, countPermutations=false]: Like the partitions function above, but returns a more compact enumeration of the partitions of the integer n. Each list contains [num, count] pairs indicating the number and its count in a partition. For example, compare the following representation with the one from the partitions function above.
  • for a = partitionsCompact[4]
  • println[a]
  • [[4, 1]]
  • [[3, 1], [1, 1]]
  • [[2, 2]]
  • [[2, 1], [1, 2]]
  • [[1, 4]]
  • If the optional argument countPermutation is true, then each element also contains the number of possible permutations of the list.

New in Frink 2015-02-22 (Feb 23, 2015)

  • Added a few new functions for manipulating filenames and URLs: filenameToURL[string] turns a string containing a filename into a URL string.
  • fileURLs[string] takes a string representing a file or directory and returns an enumeration of files in that directory. Each string is the URL of a file in that directory.
  • fileURLsRecursive[string] takes a string representing a file or directory and returns an enumeration of files in that directory and all its subdirectories. Each string is the URL of a file in that directory.

New in Frink 2015-02-16 (Feb 17, 2015)

  • Fixed problems in converting rational numbers with very large or very small parts to a double value. (i.e. if the numerator or denominator or result of the rational number couldn't fit into a double). When converting rationals to double, validity of results is now checked much more strongly, and alternate methods are used to perform the division if the numerator, denominator, or result isn't representable as an IEEE double.
  • While most Frink functions don't use IEEE-754 double values directly, they are used in some APIs (like graphics libraries and hardware-accelerated trigonometric functions). The problems are usually directly apparent and cause programs to stop at higher levels, but Java's graphics APIs silently swallow NaN and infinite values, which made these cases possibly slip through the graphics system undetected.
  • Added a toRational[num] function to convert Frink's internal representation of a floating-point number to an exact rational number representation of the number represented.

New in Frink 2015-02-04 (Feb 10, 2015)

  • Improved containment for intervals in the exponentiation operator and sin[] function.

New in Frink 2015-01-21 (Jan 21, 2015)

  • Fixed some units in the standard data file that were directly or indirectly defined in terms of electroncharge, which changed sign recently.
  • Made several fixes to Formatting Functions: Documented the functions formatSci[value, divideBy, decPlaces]

New in Frink 2015-01-16 (Jan 16, 2015)

  • Fixed the sign of electroncharge to be negative. Also added units elementarycharge, protoncharge, neutroncharge, upquarkcharge and downquarkcharge, and modified several definitions to use elementarycharge instead of electroncharge.
  • Changed = to := in defintions of Mars's moons Phobos and Deimos in the standard data file.

New in Frink 2015-01-05 (Jan 6, 2015)

  • It was announced today that a leap second will be added at the end of June 2015. Validated that Frink's internal data file (loaded from the US Naval Observatory's tabulation of leap seconds) has the new leap second. For more information see the Leap Seconds section of the documentation.

New in Frink 2015-01-02 (Jan 3, 2015)

  • When adding text to a graphics object, the text can now contain embedded newlines, which are broken into separate lines and handled appropriately. This makes it much easier to lay out multi-line blocks of text. It is now essential to explicitly set a font size on a graphics object before adding multi-line text. Example:
  • g = new graphics
  • g.font["SansSerif", 12]
  • g.text["One\nTwo\Three"] // Note newlines
  • g.show[]
  • Fixed miscalculation of some bounding boxes for rotated text, and for text vertically aligned to the baseline.
  • (To be more precise, the text was always rendered where it should have been, but due to miscalculation of the bounding box, it may not have been visible in the rendering area if it was on the edge of the graphic, or the only thing in the graphic. This did not affect the default case where the text was centered at the specified coordinates, but may have affected cases where horizontal and vertical alignment was not "center".)
  • Updated copyright dates for 2015.

New in Frink 2014-12-29 (Dec 30, 2014)

  • Added a version of array.lexicographicPermute[function] which takes an ordering function to perform the permutation. See the Array Methods section of the documentation.
  • When rendering graphics to HTML files, each bitmapped image is only included once in the output, even if it is rendered multiple times. This may greatly decrease the size of HTML files.
  • You can now add bitmapped images when rendering graphics to Scalable Vector Graphics (SVG) files.
  • Tried to make each bitmapped image only render to the SVG one time, even if it was rendered multiple times, like the fix for HTML files above, but after much effort, I found that according to the SVG spec, the image tag cannot reference elements within an SVG file, so you can't reference a single image multiple times.
  • Changed some internal sanity checks to the year 2015.

New in Frink 2014-12-19 (Dec 19, 2014)

  • Internal changes to Frink's security manager:
  • Security errors when constructing an object with the new keyword or constructExpression function are now printed more specifically.
  • Security manager now has more granular control over expressions constructed with constructExpression function.

New in Frink 2014-12-10 (Dec 10, 2014)

  • Added graphics.fillCenter[img, cx, cy, width, height] and graphics.fillCenter[img, cx, cy, width, height, leftSrc, topSrc, rightSrc, bottomSrc] methods which draw an image onto the graphics object with the specified center coordinates (cx,cy), making it completely fill the specified width and height without modifying the aspect ratio. Note that this may cut off part of the image.

New in Frink 2014-12-03 (Dec 3, 2014)

  • Graphics can now also be clipped to a GeneralPath, which means that graphics can now be clipped to all of the two-dimensional shapes that Frink supports. See the Clipping Graphics section of the documentation for more.
  • See the GeneralPathClipTest.frink sample program for an example of clipping to a GeneralPath.

New in Frink 2014-11-23 (Nov 24, 2014)

  • Frink's graphics now allow you to set an arbitrary clipping rectangle which constrains the drawing area. This improves graphing equations, drawing maps, and makes it safer to draw graphics into a specified area.
  • A cool thing about the clipping implementation is that, like all of Frink's graphics, you can render to any coordinate system that makes sense to you, even if it's rotated, scaled, skewed, and clipped, and Frink will automatically center and scale that into your graphics window by default, greatly simplifying many graphics programming tasks. In other words, this can be used to "zoom in" on a section of a larger graphic--just set a clipping region before drawing the graphic and only the section within the clipping region will be displayed.
  • See the Clipping Graphics section of the documentation for more.
  • Now that many browsers implement the even-odd winding rule in the HTML 5 canvas (previously, the specification only supported the rather useless nonzero winding rule,) Frink now requires that functionality, and will now draw many more concentric or self-intersecting objects correctly in HTML5.
  • This feature is being gradually implemented in current browsers, (but not yet in the official HTML5 Canvas spec!) Your browser needs to support the HTML Canvas's context.fill("evenodd") method for Frink's graphics to work properly now. This appears to be supported in current versions of Firefox (21+), Firefox on Android, Chrome (27+), Opera (15+), Safari 8.0, and IE11 (according to this).

New in Frink 2014-10-20 (Oct 20, 2014)

  • The random[min, max] and random[int] functions can now handle arbitrarily-large integer arguments (previously, they could only handle arguments with magnitudes up to 231.)
  • This change was inspired by my Twitter contest: "What is the smallest positive integer that does not return a Google result?" The earlier results were on the order of 1015 which could not be randomly-generated directly. Try your hand at this contest, preferably without peeking at the results from the link above!
  • Added an internal optimization that may make integer-heavy operations work faster.

New in Frink 2014-09-24 (Sep 24, 2014)

  • Added Indian terms lakh (100 thousand) and crore (10 million). Thanks to Emily Lakdawalla for pointing these out in her coverage of India's Mars Orbiter's successful orbital insertion burn around Mars.
  • Internally rewrote some parsing routines for Devanagari numbers.

New in Frink 2014-08-21 (Sep 9, 2014)

  • Added array methods:
  • array.indexOf[value]
  • array.indexOf[value, startIndex]
  • array.lastIndexOf[value]
  • array.lastIndexOf[value, startIndex]
  • array.contains[value]
  • See the Array Methods section of the documentation.
  • The left[string, len] and right[string, len] methods can now take negative arguments for len. If len is negative, it returns a string with -len characters removed, that is, if the original string is 5 characters long, and len is -1, 4 characters are returned. In any case, if the original string is shorter than the number of characters requested, the string returned will contain only the number of characters available, and will not return an error.

New in Frink 2014-08-20 (Sep 9, 2014)

  • Fixed the exp[n] to not overflow or underflow. The functions in ArbitraryPrecision.frink are still preferred if you need exact, very large exponents.
  • Improved error messages for the parseInt[str, base] function.

New in Frink 2014-07-31 (Jul 31, 2014)

  • Functionality Change: Suppressed a trailing newline that was printed from most programs loaded from a file. This behavior is due to the fact that Frink would print the value of the last evaluated expression when exiting. Most meaningful programs end with statements that have void values, so the only effect was a blank line. The blank line is now suppressed, but if the last statement in a program actually returns a value, it will still be printed. It was probably not noticeable unless you piped Frink's output into some other sensitive program. Thanks to Ty! Boyack for noticing the problem.
  • It's likely that the current behavior will change further. If you expect a program loaded from a file to output the last expression evaluated, you will soon likely have to wrap it in a println[] statement, as Frink will likely someday never output the value of the last expression evaluated.
  • Added (not-yet-officially-documented, pending final testing, but already much superior and recommended) functions for formatting units of measure which improve on and supersede the format[num, divideBy, decPlaces] function.
  • The new functions are:
  • formatSig[num, divideBy, decPlaces] : Divides num by divideBy and returns a string with decPlaces significant figures. The value will be in normal notation when possible and scientific notation when required to display the requested number of significant figures.
  • formatSci[num, divideBy, decPlaces] : Divides num by divideBy and returns a string in scientific notation with decPlaces significant figures.
  • formatEng[num, divideBy, decPlaces] : Divides num by divideBy and returns a string in engineering notation (that is, the exponent is a multiple of 3) with decPlaces significant figures.
  • formatFix[num, divideBy, decPlaces] : Divides num by divideBy and returns a string in with a fixed number decPlaces of digits after the decimal point.
  • formatFix matches the historical and current behavior of the format[num, divideBy, decPlaces] function.
  • Warning: format and formatFix are almost necessarily broken, lose information, and do not necessarily calculate all decimal places correctly, especially when displaying the values of exact fractions like 2/3 to a large number of decimal places. The behavior of the format function will eventually change to follow the behavior of formatSig as listed above. You may want to prepare modifying your programs now. Changing all instances of format[ to formatFix[ should preserve the current behavior forever, but it is strongly recommended to move to smarter functions like formatSig.
  • In all of the above, divideBy should be 1 if the number is dimensionless. If divideBy is a string, this evaluates the string, expecting a unit to be returned, and both divides by this unit and concatenates the string after the result.
  • Made lots of internal mathematical improvements to support more accurate rounding when formatting numbers. These improvements can be seen in the formating functions above, most notably when displaying exact rational numbers to a large number of decimal places, complex numbers, and intervals. Containment for intervals when calling the new formatting functions is vastly improved.

New in Frink 2014-07-07 (Jul 8, 2014)

  • Modified the Web-based Interface to be a bit more usable, including controlling scrolling to the results, placing results right after the calculation field, and trying to work around auto-capitalization and autocorrect problems in mobile browsers.

New in Frink 2014-07-02 (Jul 3, 2014)

  • Modified Functionality: Frink now handles high Unicode characters (those above \uFFFF) much more easily and correctly. These changes will not affect you if you don't process high Unicode characters, but if you do, there will be some changes:
  • High Unicode characters will be represented as a single character (rather than by two "surrogate pair" characters as in Java.) The following functions have been modified to behave properly and easily with high Unicode characters, treating them as a single character.
  • If you want the old, cumbersome Java-style string functions that treat high Unicode characters as a pair of surrogate characters, the following functions have been added.
  • The new Unicode escape sequence \u{XXXXXX} places a Unicode character into the string, where XXXXXX is a 1- to 6-digit hex value for the Unicode codepoint. For example, to create a string with a cat face, you would use "\u{1f638}" (this is the Unicode character "GRINNING CAT FACE WITH SMILING EYES".) For more information, see the Unicode in Strings section of the documentation.
  • Variables and identifiers in Frink programs can now be high Unicode characters

New in Frink 2014-06-09 (Jun 10, 2014)

  • The Swing GUI now tries harder to work around bugs in Swing. Namely, the Swing interactive GUI would refuse to scroll correctly if the font size was changed. This improves that situation on the JVMs it has been tested on.

New in Frink 2014-06-03 (Jun 4, 2014)

  • Added array.remove[start, end] and array.removeLen[start, length] methods to remove a range of items from an array. See the Array Methods section of the documentation.

New in Frink 2014-06-02 (Jun 3, 2014)

  • Many changes to date/time parsing: ◦Changes to allow ISO-8601-format dates like:
  • 2014-06-02T02:24:10Z
  • This required making changes so that quoted text literals in a format could actually work correctly. (e.g. the literal character T in the example above that separates the date from the time.) The above format is actually specified as:
  • # yyyy-MM-dd'T'HH:mm:ss #
  • where the single quotes do not actually appear in the date; they are ways of escaping the literal text T.
  • Timezone specifiers are now more flexible with respect to whitespace; the timezone name can be separated from the date/time with zero or more spaces. (Previously exactly one space was allowed.) This allows the ISO-8601 format above, where the "Z" timezone is flush up against the timezone name, and more latitude in parsing.
  • Allowed Custom Timezone specification in the formats allowed by RFC 822, RFC 1123, ISO-8601, and Java's default parsing. These look something like:
  • +0700
  • -0700
  • +07:00
  • -07:00
  • GMT+0700
  • GMT-0700
  • GMT+07:00
  • GMT-07:00
  • This allows ISO-8601 formats with the custom numeric-only timezone jammed directly onto the end of the date, such as:
  • 2014-06-02T02:24:10-06:00
  • Added Z (Zulu; a synonym for Universal Coordinated Time) timezone alias. This is required by ISO-8601 format dates.
  • Added an new Timezone Warning section to the documentation, warning about the problems with using the timezone aliases that look like Etc/GMT+7 or GMT+7 as defined by the Olson timezone database, the POSIX standard, and Java. These aliases should be considered error-prone and dangerous. Please read that section carefully.
  • Added parsers for RFC-8601, RFC 822, RFC 1123 to the standard date formats file. (RFC 822 and its successor, RFC 1123, specify date formats required in HTTP headers.)

New in Frink 2014-05-31 (Jun 2, 2014)

  • Added graphics.show[insets] method to allow you to specify the insets for a graphic without specifying height and width. See the Showing Graphics section of the documentation for details.

New in Frink 2014-05-26 (May 27, 2014)

  • Added functions integerDigits[num] and integerDigits[num, base] to return an array of the digits of a non-negative integer in the specified base.

New in Frink 2014-05-21 (May 22, 2014)

  • Fixed the deepCopy[expr] function which was broken recently.

New in Frink 2014-05-20 (May 21, 2014)

  • Fixed the bug introduced in Java 7 that long words or numbers in the Swing GUI do not wrap like they always have. They now wrap as they did since the first Swing releases. (See Java Bug 7125737 which was stupidly closed as "not an issue". This major compatibility bug is not easy for end developers to fix (but would be trivial for Java's developers to fix) and affects almost all Java programs that use Swing. Sigh.) This only affects the Swing GUI so an Android release was not made.

New in Frink 2014-05-09 (May 10, 2014)

  • The select and remove functions now allow selector functions with more than one argument. Previously, all arguments were passed as an array to a single-formal-argument function, which will continue to work the same if you pass in a one-argument selector function. See the documentation select and remove for examples.
  • Behavior change: The select and remove functions now try harder to keep their return values as arrays if passed an array, and an enumerating expression if passed an enumerating expression. In addition, they now keep dictionaries as dictionaries, OrderedLists as OrderedLists, and sets as sets. To obtain other types, toArray[expr], toDict[expr], and toSet[expr] functions. If in doubt, use these functions directly to change the return types.)
  • Internal change: All array types are now also enumerating expressions (i.e. all ListExpressions are now also EnumeratingExpressions.) Almost all of them were already, but now all are. (The only changes were to ComplexArray and ComplexArray2D, used mostly in Fourier transforms.) This allows for simplification of some code (e.g. the select function has turned into a single, simpler implementation.)

New in Frink 2014-05-05 (May 5, 2014)

  • Behavior change: Revised the select and remove functions to make them return an enumerating expression if passed an enumerating expression. (Previously, they returned an array. They still return an array if passed an array.) This makes them now work properly with infinite series, and work much better with long-running operations.
  • If for some reason you need them as arrays, you may want to wrap the call to select in a call to the toArray function to restore the original behavior.
  • Internally revised code to turn a java.io.File into a URL. This is safer and uses better libraries on Java Virtual Machines that have them (at the expense of doing a bunch of call-by-introspection.)
  • For Android: Added more hints on what to try if Java throws a low-level exception in random code. (This is usually due to the Android device not allocating enough stack space for highly recursive calculations.) Thanks to Andrew Webb for the report.

New in Frink 2014-04-30 (May 1, 2014)

  • Added a remove function which is the inverse of the select function. It removes items that match a condition from an array or enumeration.
  • Documented a few regular expression patterns like (?!pattern) and (?=pattern) that have always been available but were not documented. See the Basic Patterns and Metacharacters section of the documentation for more.

New in Frink 2014-04-23 (Apr 25, 2014)

  • Fixed a bug in the cache for the Historical British Price Data. This could return incorrect values when first requesting one unit for a given year (e.g. pound_1914) and then requesting another unit for the same year. (e.g. pence_1914).

New in Frink 2014-04-21 (Apr 22, 2014)

  • Updated the jar file's manifest file to hopefully eliminate many of the new security warnings and dialogs presented by Java 7 when running Java Web Start. Note that in some cases, this will change the name of the icon on your desktop or start menu, or will create multiple icons. Sorry--this appears to be out of my control.
  • Whenever Java Web Start gets confused (which seems to be always,) I always recommend deleting the application from your Java console and reinstalling it from the links in the Java Web Start section of the documentation (after reading the new warnings in that section.) Please let me know if older (or newer) versions of Java Web Start cannot start with these new changes. Again, make sure you read the new warnings in the Java Web Start section first.
  • Behavior change: The staticJava functions now try harder to turn their return values into Frink types. For example, types that were previously returned as JavaObject:java.lang.Integer are now returned as a normal Frink integer. This should not affect most programs, but If you need the original behavior, you can call the three-argument version, with the third argument false indicating that the value should not be converted to a Frink type. See the Accessing Static Java Fields section of the documentation for more details.
  • Added more security checks around method calls by name.

New in Frink 2014-04-20 (Apr 22, 2014)

  • Modified newJava functions to explicitly throw exceptions when the user attempts to call a Java constructor with invalid arguments. Previously, the call could fail silently in some cases. Thanks to Frank van Noorden for the report.

New in Frink 2014-04-17 (Apr 17, 2014)

  • Major New Functionality: Frink's formatters were totally rewritten to allow output in multiple formats. This includes a new "input form" which lets you easily save and load most Frink data structures (and programs,) send them over a network, etc., in a simple, safe and reversible way. See the Formatters section of the documentation for more.
  • This involved a large cleanup of lots of formatting code and redesign of many classes which should make it easier to make Frink render code in other languages and supports planned future features like genetic programming.
  • This involved changes/additions to about 5000 lines of code, and took longer than I thought it would. (This started out as an attempt to make nested data structures indent themselves properly, and became a huge re-design!)
  • Several new functions have been added to support formatting in different formats:
  • format[expression, format] formats the expression to a string using the specified formatter. Current formatters include the strings "Input" and "Output". "Input" is a formatter that provides Frink's input form that can be easily parsed by a call to eval[str]. "Output" is the human-friendly formatter, which has been greatly improved in this release.
  • formatters[] lists the currently-available expression formatters.
  • inputForm[expression] and outputForm[expression] are aliases for format[expression,"Input"] and format[expression,"Output"] respectively.
  • Formatting options such as showApproximations[], rationalAsFloat[], setEngineering[], and showDimensionName[] and the :-> operator are now local to the interpreter, (and only effect the "Output" formatter,) not global to the entire Java Virtual Machine. This makes it safer to embed multiple Frink parsers in a single virtual machine, each with their own preferences, and makes Java Server Pages more robust against poorly-behaved scripts. (Programs still need to pass a security check to set these flags on an interpreter basis.)
  • •Many, many more Frink data structures and programming constructs can now output themselves correctly, in a form that looks like their form in the Frink programs that you write. (Which lets Frink parse them correctly with the eval[str] functions !)
  • The Julian day parser can now parse rational numbers or date intervals
  • When outputting dates in "input form", the date will be formatted as an exact Julian day (possibly an interval or an exact rational number as above) if necessary, or in a human-readable format in UTC, if sub-millisecond precision is not required, which allows exact round-trips of dates.
  • Currently, objects created from a class specification will be output as a dict with name-value pairs for all instance variables. This may change. This is currently done because there's no way to guarantee that the Frink interpreter on the other end has loaded the same class or a compatible version. There are potential security and correctness issues if the classes are incompatible. A malicious user could also modify the data to get around security or logic checks and create invalid or dangerous objects. It's currently left up to the programmer to take these objects and turn them back into the objects they want on the other end. This may change.
  • Added toASCII[str] function to turn a string into a network and file-encoding safe ASCII-encoded equivalent. This is useful if you don't want the full quoting of inputForm.
  • Note: Many expression types have changed their child count and/or ordering with this release, so if you use the (undocumented and changing) functions getChildCount[function] and getChild[function, index], expect some changes. Hopefully universally for the better.
  • The do...while loop can now have a newline before the while clause when brackets are used
  • Made many changes to the way that functions allow you to discover their arguments and body using getChildCount[function] and getChild[function, index]:
  • The arguments to a function are now first-class expressions, with information about their types, constraints, and default values.
  • The body of a function can be returned.
  • Named functions, such as those returned from the getFunction[name, argCount] actually remember their names and allow you to display their names and arguments correctly, and call them through an indirect variable.
  • In inputForm, the body of an function is dumped in a usable way (for anonymous functions defined in Frink code. The body of Frink functions implemented in Java are not dumped.)
  • Added expressionConstructors[] function which returns the names of all the expressions that can be constructed by name and argument list.
  • The three-way comparison operator is now a proper first-class operator with a proper precedence, and can dump itself properly.
  • The match operator =~ is now a proper first-class operator with a proper precedence, and can dump itself properly.
  • Regular expressions and search-and-replace expressions can now dump themselves in a human-readable format.
  • The child types of many expressions have changed from returning strings to returning SymbolExpressions for easier formatting and correctness.
  • Boolean algebra operators now dump themselves with a text string instead of symbols (e.g. and instead of &&.)
  • The existing functions toArray[expr] or array[expr] can turn an object created from a class specification into an array of [key, value] pairs.
  • The existing function toDict[expr] can turn an object created from a class specification into a dictionary of key, value pairs.
  • Added functions for dumping the children of an expression:
  • children[expr]: Returns an array containing all the children of the expression.
  • childrenWithTypes[expr]: Returns an array containing all the children of the expression and their types.
  • childTypes[expr]: Returns an array containing the types of all the children of an expression.

New in Frink 2014-04-15 (Apr 16, 2014)

  • Fixed a problem with the WAR file for running Frink Server Pages. The class frink.servlet.ServletUtils was missing from some builds.

New in Frink 2014-03-18 (Mar 19, 2014)

  • Modified the JSON parser to allow an escaped forward slash, to match the spec, and tightened the list of characters that are allowed in a string (that is, disallowed unescaped control characters.)
  • Now that the U.S. Bureau of Labor Statistics has now apparently made the Consumer Price Index file available from a non-broken HTTP site (as opposed to their old broken FTP site, see the notes for the 2013-07-09 release,) Frink now fetches the CPI file from their site instead of mine.

New in Frink 2014-03-01 (Mar 3, 2014)

  • Added two-argument versions of functions to sum and multiply lists. sum[list, emptyValue] and product[list, emptyValue] sum and multiply lists respectively, and if the list is empty, these return emptyValue.

New in Frink 2014-02-20 (Feb 21, 2014)

  • Added a few new classes that are loaded by name to the list of classes that aren't obfuscated/compressed, so they can be loaded by name. This includes the JSON parser and the wrapper for Java's Map class.

New in Frink 2014-02-17 (Feb 18, 2014)

  • Even though JSON is a terrible format based on a terrible language, you can now parse it easily in Frink with the parseJSON[string] function. See the Parsing JSON section of the documentation.
  • As a side-effect, you can now obtain Bitcoin rates easily. See the Parsing JSON section of the documentation for an example.
  • Added the bitcoin.frink sample program.

New in Frink 2014-02-14 (Feb 15, 2014)

  • Java collections that extend java.util.Map (this includes classes like HashMap, Hashtable, Properties, etc), can now be treated like a Frink dictionary, including the ability to enumerate over [key, value] pairs. See the Iterating over Java Collections section of the documentation for more.
  • Performed a large rewrite of the internals of enumerating over Java objects, including improved compile-time typesafety and better error reporting.
  • All Java objects are now HashingExpressions so they can be used as keys to dictionaries, placed into sets, and more.

New in Frink 2014-02-03 (Feb 4, 2014)

  • Performed an internal restructuring of Frink's parser and lexer, allowing multiple parsers to be included more easily. This shouldn't affect you unless you accessed the old classes directly (which you shouldn't.)

New in Frink 2014-01-29 (Jan 29, 2014)

  • Updated the Geocaching Tools page in several ways:
  • Fixed to use Google Maps API v3.
  • Now calculates UTM to Lat/Long.
  • Updated the supporting CoordinateConversions.frink and GoogleEarth.frink files.

New in Frink 2014-01-21 (Jan 22, 2014)

  • The parseInt[str] function can now take an array of strings as input.

New in Frink 2014-01-13 (Jan 14, 2014)

  • Added copy constructor for the image class, so an image can be copy and the copy can be modified without modifying the original:
  • orig = new image[url]
  • copy = new image[orig]

New in Frink 2014-01-11 (Jan 13, 2014)

  • Greatly improved the rendering of polylines, polygons, and filled polygons, especially when printing. This eliminates jagged edges of polylines and gives smoother curves. Internally, the rendering of polylines was changed from using Java's drawPolygon methods (which could only use integer coordinates) to using a GeneralPath which can use sub-pixel coordinates. It also forces "pure" rendering of strokes in Java's graphics subsystem. This may be slower to render, but the results will look much better and be more accurate.

New in Frink 2014-01-02 (Jan 3, 2014)

  • Added functions isArray[expr], isDict[expr], isSet[expr] to allow you to test if an expression is of the specified types.

New in Frink 2014-01-01 (Jan 3, 2014)

  • Updated sanity checks and copyright dates for the year 2014. No leap seconds were added at the end of the year.

New in Frink 2013-12-07 (Dec 9, 2013)

  • Several methods were added to allow graphics objects to be added rotated into other graphics objects. This makes it even easier to compose complicated graphics and place them in other graphics, no matter their original coordinates or orientation.

New in Frink 2013-12-06 (Dec 9, 2013)

  • Late update: Fixed an additional bug in graphics.add that might have caused a Null Pointer Exception. Thanks to Nicholas Spies for the bug report.
  • Fixed a bug in composing graphics (graphics transforms were not always reset when adding multiple graphics.) Please update.

New in Frink 2013-12-05 (Dec 5, 2013)

  • This release improves the ability to easily compose a graphics object from several other graphics objects. You can now add a graphics object to another graphics object while automatically scaling it to fit into a specified area, no matter what coordinates it was originally drawn to! This makes it easy to take graphics objects from a variety of sources, drawn into their "natural" coordinates, and easily compose them into other graphics objects.

New in Frink 2013-12-04 (Dec 5, 2013)

  • Added editDistanceDamerau[str1, str2] which calculates the Levenshtein-Damerau edit distance between two strings. This is similar to the editDistance function which calculates the Levenshtein edit distance, but also allows swaps between two adjoining characters. See the Other String Functions section of the documentation for more.

New in Frink 2013-11-20 (Dec 5, 2013)

  • For Android: Made sure that the input field requests focus on startup. This was affected by the 2013-11-11 changes

New in Frink 2013-11-12 (Dec 5, 2013)

  • Frink can now render animated GIFs! These are quite simple to generate from a series graphics objects with very little additional code. See the Animated Images section of the documentation for details.

New in Frink 2013-11-11 (Nov 13, 2013)

  • For Android: Made the text in the output windows selectable, so results can be copied and pasted into other programs. This requires a platform running Android 3.0 (API level 11) or later.

New in Frink 2013-11-10 (Nov 13, 2013)

  • Changed calculation and display of approximations to rational numbers to use "engineering notation" whenever requested. This especially manifests itself when rationalAsFloat[true] is called. Note that the approximations are calculated slightly differently before (before, they could use IEEE-754 math and now they use Frink's division with proper rounding.) Many more numbers are correctly displayed as "exact" now. Note that this may change the display of some numbers (numbers close to zero with 5 or fewer leading zeros after the decimal point are currently not displayed in scientific notation.)
  • Updated references in the standard data file about the amount of energy in a quantity of TNT. This is another case where NIST Special Publication 811 is broken or vague.

New in Frink 2013-10-29 (Oct 29, 2013)

  • You can now render arbitrary-resolution graphics objects into bitmapped images in memory using the constructor:
  • new image[graphics, width, height]

New in Frink 2013-10-21 (Oct 22, 2013)

  • The uppercase and lowercase functions can now be applied to a list of arguments.
  • Added a function readLines[URL] to read the contents of an entire URL into an array with one line per entry. Thanks to Millicent (whose name, when converted to lowercase, is a parseable Frink unit) for the inspiration.

New in Frink 2013-09-28 (Oct 22, 2013)

  • Added base64[integer] to encode an integer to/from a string in standard base64 encoding format. If passed an integer, returns a string representing the integer as a base 64-encoded value. This uses standard base-64 indices in the order A-Za-z0-9+/. If passed a base-64 encoded string, this returns an integer with the corresponding value.
  • The base[integer, base] base conversion function can now have 64 as a base.
  • The parseInt[integer, base] base conversion function can now have 64 as a base.

New in Frink 2013-09-22 (Oct 22, 2013)

  • Added graphics.alpha[opacity] command to set the transparency (often called "alpha channel") of all subsequent drawing operations. The opacity is a dimensionless number from 0 (fully transparent) to 1 (fully opaque.) This primarily allows you to draw transparent images, as transparency could already be specified when setting colors. If a color already has a transparency, that transparency value will be multiplied by this global transparency.
  • For Android: With respect to the changes above, modified the behavior of drawing bitmaps when the current drawing color has a transparent alpha channel. Previously, if the current drawing color had a transparent alpha value, the bitmap was rendered with the same transparency. This was probably unexpected and does not match the behavior of Frink on other platforms. Now, to render bitmaps with some transparency, you need to call graphics.alpha[opacity] before rendering the bitmap.
  • This global alpha channel also affects any other subsequent drawings that are being done, multiplying the alpha channel in drawn colors by the global alpha channel.

New in Frink 2013-09-19 (Oct 22, 2013)

  • Again updated the statistics.frink to eliminate source of underflow/loss of precision when calling erfc and inverseErfc for large arguments.

New in Frink 2013-09-16 (Oct 22, 2013)

  • Updated the statistics.frink to eliminate source of underflow when calling erfc for large arguments. Thanks to Dave Schulman for the bug report.

New in Frink 2013-09-08 (Oct 22, 2013)

  • Started a new Frink Science mailing list. (Hosted by Yahoo! Groups. Link opens in new window.) This list is intended to discuss problems in math, science, and physics and explore solutions using the Frink language.
  • The first sample was posted today, exploring and quantifying the effects of the Coriolis effect on a kicked football (or other projectile.)

New in Frink 2013-07-28 (Jul 29, 2013)

  • Added a labeled next LABEL level statement to jump to the next specified level of a multifor construct. See the documentation for multifor and the sample program multinexttest.frink for more.
  • Allowed OrderedList to take a second parameter which is an arbitrary data object that will be passed to the comparison function.

New in Frink 2013-07-27 (Jul 29, 2013)

  • Added new class, OrderedList, which extends array but automatically keeps items in order.
  • Added image.toComplexArray[] method which turns the pixels of an image into a 2-dimensional array of complex numbers (ComplexArray2D) which can be manipulated, Fourier transformed, etc. The behavior of this method will change.
  • More documentation on Fourier Transforms. Fourier transforms can now operate on a ComplexArray and ComplexArray2D, primarily for transforming the pixels of an image.
  • Added lots of internal methods to the graphics library to support Fourier analysis of images.
  • Greatly extended the ComplexArray and ComplexArray2D classes to support Fourier analysis of images, normalizing, etc. These methods may change so they're not documented yet.

New in Frink 2013-07-14 (Jul 15, 2013)

  • Fixed a problem when matching a regular expression that ends with the global /g modifier and assigning the results to a variable directly (as opposed to using it in a for loop.) Spurious null values could have been appended to the list, and the return values could be duplicated.
  • Improved error messages when we can't connect to the source of the Consumer Price Index data.
  • Added set.putAll[expr] method to put all of the elements of expr into the set as individual items. See the Sets section of the documentation for examples.
  • Added dict.remove[key] method. This returns the value corresponding to the key that was removed, undef if the key was not in the dictionary.

New in Frink 2013-07-09 (Jul 10, 2013)

  • The U.S. historical currency converter in Frink and the associated webpage may not have been working for you if you are using a new version of Java, because it can't connect to the U.S. Bureau of Labor Statistics FTP server. Technical reasons at bottom, if you care.
  • As a result, Frink will now temporarily fetch the file from my site, http://futureboy.us/frinkdata/cpiai.txt instead of the URL ftp://ftp.bls.gov/pub/special.requests/cpi/cpiai.txt . I mirror the file on a daily basis for now. The current release of Frink will fix the problem temporarily.
  • This problem didn't affect Android. I guess their programmers use more sane FTP code.
  • Frink has always tried (and usually succeeded after about a 90 second timeout) to fall back to an internal copy of the Consumer Price Index file, but in the case of the web page, the timeout for the FTP connection was longer than the webpage's timeout, so it never had a chance to complete.
  • Technical reasons: The problem is that modern versions of Java don't seem to retrieve FTP data from the BLS site correctly, specifically this URL.
  • I can fetch that file just fine with my web browser or programs like wget but Java 1.7 and 1.8 just time out while trying to download it.
  • I dug deep into this problem, (packet-sniffing the network traffic and even hacking debug code into the Java Virtual Machine itself) and can put the blame in 1 of 2 places:
  • Java uses a newish FTP feature (EPSV, extended passive mode) without checking to see if the server supports it using the FEAT (features) command.
  • The BLS's FTP server or firewall is misconfigured. While it responds to the new FTP feature as if it supports it, it doesn't. It's either failing to open a port in the firewall for the data transfer, or it's not actually implemented correctly in their server.

New in Frink 2013-07-03 (Jul 3, 2013)

  • Added array.clear[] method to remove all elements of an array.

New in Frink 2013-06-19 (Jun 19, 2013)

  • Fixed a problem in formatting Dynamical Time values in later JVMs. This could possibly cause NullPointerExceptions. The design and implementation of Java's Calendar, Date, and TimeZone classes are quite insane.

New in Frink 2013-06-15 (Jun 15, 2013)

  • Fixed a problem in the sun.frink astronomical library. The approxTransit function could potentially jump a day backward or forward, which could affect the date returned by the approxRiseSet, sunrise and sunset functions.

New in Frink 2013-06-05 (Jun 5, 2013)

  • The special value undef is now a hashing expression, so it can be placed into a set, used as a key in a dictionary, and so on.
  • My super-fast divide-and-conquer Schönhage base conversion routines have been extended to work with all bases from 2 to 36. My improvements for faster multiplication and radix conversion will hopefully make it into Java 8 after 11 years of battling to get them approved. Much of my programming efforts over the last month has been in polishing and testing those routines and preparing staged patches for review.

New in Frink 2013-03-28 (Mar 29, 2013)

  • Turned div, mod, and conforms operators into true operators in Frink so they know their precedence and can display themselves more effectively.
  • Modified all the links to colorize.fsp and highlight.fsp to have shorter links. Old links will still work too.

New in Frink 2013-03-15 (Mar 15, 2013)

  • Allowed labeled next statements to break out to the next iteration of a specified loop (this includes for, multifor, do, and while loops. See the for loop section of the documentation for an example.
  • Fixed parser problem with labels preceding while loops.
  • Added getLowestSetBit[num] function which returns the index of the rightmost (lowest-order) one bit in an integer (the number of zero bits to the right of the rightmost one bit). Returns -1 if the integer contains no one bits.
  • Added shiftLeft[num, bits] function which shifts the bits of an integer left by the specified number of bits. New bits will contain zero. This is equivalent to multiplying by 2bits but is usually more efficient for large numbers.
  • Added shiftRight[num, bits] function which shifts the bits of an integer right by the specified number of bits, losing the bits pushed off the right side. This is equivalent to performing a div by 2bits but is usually more efficient for large numbers.

New in Frink 2013-03-05 (Mar 6, 2013)

  • Fixed currency conversions to work again.

New in Frink 2013-02-19 (Feb 19, 2013)

  • The DFT and InverseDFT functions can now take 2-dimensional arrays as well as 1-dimensional arrays. See the Other Functions section of the documentation for details.
  • Refactored the Fourier transform code to handle multi-dimensional arrays.
  • Added sample program to demonstrate 2-dimensional Fourier transforms. Note that this file is not actually necessary, as 2-dimensional Fourier transforms are now built into Frink, but this demonstrates the algorithm simply.

New in Frink 2013-02-18 (Feb 18, 2013)

  • Changed Java Introspection to partially work around the ten-year-old Sun Bug 4071957 which causes method invocation to fail on classes that are declared private, even if the methods are public and access would be allowed from normal Java code. This works around a major design flaw in Java's introspection. The fix this time now also looks in implemented interfaces to eliminate the problem.
  • Added randomBytes[numBytes] function to generate an array of random bytes (as a Java byte array.)
  • Added a sample of AES-256 encryption and decryption with proper padding and salting (I hope.)

New in Frink 2013-02-14 (Feb 15, 2013)

  • The contents of an array can be randomly shuffled with the array.shuffle[] method.

New in Frink 2013-02-05 (Feb 6, 2013)

  • Improved Frink-to-Java type conversions. The code now checks more strongly to see if numbers are dimensionless, are integer-valued, and will fit into the specified numeric type (e.g. int, byte, double, etc.)
  • This helps to disambiguate between previously-ambiguous calls such as doSomething[int] and doSomething[float]. If the value is a floating-point value, the above will always select the float method, rather than indicate that the call is ambiguous. If the value happens to be an integer, this is still ambiguous, because the integer could be coerced to a float parameter (but not the other way around.)
  • The code still does not try to disambiguate by the size of the value, such as between (int and short) or (double and float) if the value will fit into both, but if an integer value is too big to fit into a short, this will be unambiguous.

New in Frink 2013-01-31 (Feb 1, 2013)

  • For Android: Added several improvements to reading from GPS and other sensors. These allows programs to wait for new inputs, instead of sleeping and polling:
  • Added getSensorService[sensorNum, updateFrequency] which allows the user to specify the update frequency for sensors. See the documentation for SensorService for more information.
  • Added SensorService.getAccuracy[] method to return the accuracy of the readings from the sensor.
  • Added SensorService.waitForValues[] method. This returns the latest raw values from the sensor as an array of floating-point values without dimensions. If new, unread values are available, this returns them immediately, otherwise it blocks until new values become available. This is much preferable to polling.
  • Added a waitForGPSLocationJava[] method which returns the current-known GPS position as a Java object of type Location. If a new, unread GPS location is available, this returns it immediately, otherwise it blocks until the next GPS location is available. It should not return data until GPS locations are being returned. This is much preferable to polling.

New in Frink 2013-01-24 (Jan 24, 2013)

  • Optimized several control flow commands such as return, next, and break to be faster. When calling a tight loop with short functions that return data, performance was improved by a factor of 2.7 to 3.4 on some architectures and JVMs! Unfortunately, it's only 1.15 times faster on Android/Dalvik.
  • Improved formatting of a list of statements. That is, doing things like dumping the body of a function.
  • Several smaller optimizations to variable lookup.

New in Frink 2013-01-12 (Jan 18, 2013)

  • For Android: Fixed listen[prompt, numOptions] to actually present no more than the specified number of options to the user. Thanks to Andrew Webb for the bug report.

New in Frink 2013-01-07 (Jan 7, 2013)

  • Important: The security manager now checks to see if you have permission to call methods or write fields on Java objects when security is enabled (e.g. when you're in an eval statement or when restrictive security has been turned on.) This prevents untrusted users from calling potentially-unsafe methods on arbitrary Java objects that might be accessible from their scope.
  • The last argument to callJava["classname", "method", argList] can now be eliminated if there are no arguments to the method.
  • The last argument to callByName[obect, "methodName", argList] can now be eliminated if there are no arguments to the method.
  • Internal changes to newJava function to simplify and reduce code.
  • Refactored and modified internals of functions to allow getChildCount[function] and getChild[function, index] to do useful things. Child 0 of a function is now a string representation of its argument list, (which may change to a more useful object type in the future), and child 1, if it exists, is the body of the function. This may allow you to do interesting things like take the derivative of a user-defined function.

New in Frink 2013-01-05 (Jan 5, 2013)

  • The argument to the lines[] function can now be a java.io.InputStream, allowing you to use Frink's simple iterators with streams provided by other libraries.
  • Fixed rendering of graphics that have both transformations and units of length.

New in Frink 2012-12-13 (Dec 13, 2012)

  • Added additional graphics transformation convenience methods graphics.rotate[angle, cx, cy] and graphics.scale[sx, sy, cx, cy] to rotate and scale around the specified point respectively. See the Transforming Graphics section of the documentation for more information.
  • Added arbitrary affine transform method graphics.transform[a,b,c,d,e,f] which allows you to specify all the coordinates of the affine transformation matrix, enabling skews and other effects. See the Transforming Graphics section of the documentation for more information.
  • Added possibly-educational technical notes to the Transforming Graphics section of the documentation, showing how matrix math can be used to achieve various transformations.

New in Frink 2012-12-12 (Dec 12, 2012)

  • Java objects that implement the java.util.Iterator or java.util.Iterable interface are now turned into Frink enumerating expressions, which means that they can now be used in for loops transparently, among other uses. This is done in a call-by-name fashion so the code will still work on Java 1.1 and later.

New in Frink 2012-12-11 (Dec 11, 2012)

  • Major New Functionality: Frink's graphics libraries now allow you to translate, scale, and rotate graphics on all platforms! This allows you to write simple code using the coordinate system that is most logical, and translate or scale it wherever you want. Like all of Frink's other graphics, Frink ensures that whatever you draw is automatically scaled and centered into the display no matter how confusing your transformations get, and can be exported to various file formats.
  • This makes many graphics coding tasks much simpler. It also makes certain things possible that were impossible before, such as rotating bitmaps or distorting text. These few little functions add a huge amount of power, while even allowing you to simplify your code!
  • See the Transforming Graphics section of the documentation for more information.
  • For Android: Attempted to force a fix for a problem where programming mode might only have a single-line input. This only seemed to show up in the emulator, though.
  • For Android: The file chooser for loading files in programming mode now allows you to choose the parent directory, allowing the reading of files from anywhere you have permission to read. (You're still not allowed to save to arbitrary directories yet.)
  • For Android: Fixed a potential race condition when shutting down sensor services before they've had a chance to properly start. Thanks to the person who reported the problem via their Android device.

New in Frink 2012-12-07 (Dec 7, 2012)

  • getBoundingBox[graphicsExpression] now returns undef if graphicsExpression contains an empty bounding box. (That is, there are no drawable elements in it.)
  • Various internal improvements and fixes to expression transformation: Improved formatting of method calls.
  • Improved formatting of object dereference expressions (i.e. obj.member)
  • Loosened construction of method calls so more symbolic transformations would work on them.
  • Added expression constructor for object dereferences. This means that you can now use expressions like obj.member in transformation rules.

New in Frink 2012-11-24 (Nov 26, 2012)

  • For Android: The GPS receiver is now enabled with much more sensible update frequencies (1 second updates, no distance threshold.) Previously, this was set much higher (updates possibly as far as 60 seconds apart and a 1 meter distance threshold.) While older devices may have ignored the too-high settings, newer devices may have updated too infrequently, even when moving.
  • For Android: Added a new two-argument function startGPS[minTime, minDist] which allows you to configure the GPS unit for less power consumption if you want less-frequent updates. See the GPS/Location section of the documentation for more information about this function. You probably don't want to use this version of the function without a lot of testing on multiple devices and Android versions. (The Android documentation says that Android versions before 4.1 (Jellybean) could have ignored these settings.)

New in Frink 2012-11-11 (Nov 12, 2012)

  • The following (undocumented and generally unused) functions have changed their behavior. They now do evaluate their arguments before being executed, which they did not before. This means that you may have to wrap the arguments to these functions in a noEval[expr] block if you don't want them to evaluate their arguments first: ◦childCount[expr] (Returns number of children of the expression.
  • type[expr] (Returns the type of the expression as a string. This behavior may change to return a more useful object in the future.)
  • isConstant[expr] (Returns a boolean value indicating if the specified expression is constant.)
  • Also note that the behavior of these "undocumented" functions may change in the future, or the functions may be removed entirely.

New in Frink 2012-11-09 (Nov 9, 2012)

  • HTML5 graphics can render drawings with dimensions of length. Unfortunately, there is apparently no way to query a browser for its screen resolution, so these graphics won't be sized appropriately.
  • Updated HTML5 canvas rendering to be more correct: in some places where the provisional HTML5 standard specified that integers are required, Frink would previously use floating-point numbers. While all browsers seemed to handle either case, it's good to be safe. Integers are now output in these situations.

New in Frink 2012-11-07 (Nov 7, 2012)

  • Fixed problem in rendering ellipses in HTML5. They were being rendered incorrectly in some cases. (The provisional HTML5 standard specifies an ellipse function but most browsers don't implement that yet, so we have to draw circular arcs and transform them to kludge around it.)
  • HTML5 graphics now resize to fit the width of the browser window and repaint themselves on resize to give optimal resolution. Printing is still jaggy and substandard because of deficiencies in the HTML5 specification. If printing, use SVG when possible.

New in Frink 2012-11-06 (Nov 6, 2012)

  • Frink can now render its graphics to an HTML5 document, using HTML5's canvas feature. While HTML5 will not be a finalized specification until at least 2014, major modern browsers for desktop and mobile devices (Firefox, Chrome, Opera, Safari, IE) support the HTML5 features that Frink requires.
  • This includes the following features: Transmission of vector graphics in vector formats, allowing efficient, antialiased rendering of vector graphics.
  • ◦Bitmapped images are transmitted within the HTML document as embedded data URIs encoded in base-64, allowing you to send the entire graphic as a single HTML file. Bitmapped images are transmitted at the end of the file, and displayed as they are loaded, allowing progressive display of documents containing multiple bitmaps.
  • All of Frink's graphics primitives are supported, including bitmaps, GeneralPath, partially-transparent graphics, and rotated text.
  • HTML5 is rendered to relatively simple, user-modifiable code.
  • Sample graphic: graphicsTest.html which was generated from graphicsTest.frink. Do a "view source" on the HTML file to see the generated code. Note that this includes vector graphics, multiple bitmaps, and rotated, partially-transparent text.

New in Frink 2012-10-21 (Oct 22, 2012)

  • Added zip[a, b] and zip[a, b, defaultA, defaultB] functions to "zip" together corresponding elements of lists a and b and returns each pair as a two-element array. See the zip section of the documentation for more.
  • The base64Encode[expr, encoding] function can now take a Java array of bytes for the input expression.
  • Added a base64DecodeToBytes[string] function to decode a base-64 encoded string to a Java array of bytes.

New in Frink 2012-09-29 (Oct 2, 2012)

  • Added array.pushAll[array] method to push all elements of an array onto the end of another array.
  • Added array.removeAll[value] to remove all elements in the array which have the specified value.

New in Frink 2012-09-13 (Sep 13, 2012)

  • Made assignment-to-list more flexible:
  • [a, b] = 1 now assigns a=1 and b=undef (previously nothing was assigned if the right-hand-side was not a list.)
  • The values in the array on the left-hand-side can now be any assignable expression, not just simple variable names.
  • Modified the map function:
  • If the number of arguments passed to the function are greater than the number of formal arguments declared by the function, the extra arguments will be passed as an array to the last variable in the function.
  • Fixed the case where the first argument to map is a string indicating the name of a function. This allows you to call simple functions like:
  • a = [[1,2],[2,3],[3,4]]
  • map["lcm", a]

New in Frink 2012-09-10 (Sep 10, 2012)

  • Modified the date formats file to allow parsing of dates with single-digit days, like #2000 Jan 1#.

New in Frink 2012-09-05 (Sep 5, 2012)

  • Fixed bug in split function when passed an empty delimiter string.

New in Frink 2012-09-04 (Sep 4, 2012)

  • Rewrote the the multifor loop implementation to allow it to handle "triangular" loops where the bounds of one of the loops depends on the bounds of other loops.
  • For example:
  • multifor [f,g] = [new range[1,3], new range[f+1,3]]
  • println["$f $g"]

New in Frink 2012-08-30 (Aug 30, 2012)

  • For Android: Voice recognition (for as many languages as your device supports) is now available! The functions listen[prompt] and listen[prompt, numOptions] will now listen for voice input and return the text as a string. This is extremely powerful, and it allows you to write voice-controlled programs, automatic translators, voice calculators, and more! For more information, see the Speech Recognition section of the Android documentation.

New in Frink 2012-08-22 (Aug 23, 2012)

  • Fixed null pointer exception when calling units[1] .
  • For Android: Forced the spellchecker off in the input fields for interactive mode.

New in Frink 2012-08-20 (Aug 21, 2012)

  • Further improved disambiguation of calling Java methods. Formerly, if a class implemented multiple interfaces, and we got unlucky in the order in which we iterated through method names, we could have failed to resolve ambiguities. This affected cases like a class which contained the following methods: ?void doSomething(Serializable)
  • void doSomething(CharSequence)
  • void doSomething(String)
  • Formerly, if we iterated in that order, the code would detect that neither of the interfaces Serializable nor CharSequence were more specific than each other (sharing no common parent class,) and disambiguation would fail. However, the new code now detects that String implements both interfaces and dispatches to the String version.
  • A sane class hierarchy wouldn't have cases like this, but Android does not have a sane class hierarchy. This will help to work around some issues with Android calls, and enables us to do things like send messages prepopulated with text!
  • Frink now throws a AmbiguousMethodException if method calls can not be disambiguated. (Previously, it would just print an error and continue.)

New in Frink 2012-08-16 (Aug 17, 2012)

  • For Android: Made the right and left arrow buttons ensure that the cursor position was visible in the view when moving off the screen.
  • For Android: Various changes to the text-to-speech functions, specifically those dealing with SAMPA. Huge thanks to Manny Neira for testing and extremely detailed reporting. ?speakSAMPA now sends out a briefer SSML (link opens in new window) string that appears to work better on many devices. The language used is no longer hardcoded to en-US but should better follow your platform's voice.
  • Added encodeSAMPA function to allow you to encode part of a string to be pronounced correctly.
  • Added a lot of warnings and caveats to the documentation of the above functions, indicating that they may work differently depending on which text-to-speech engine you have installed.

New in Frink 2012-08-14 (Aug 16, 2012)

  • For Android: Added a "menu" button to the button bar to work around Android's new stupid missing menu button and the millions of cases where it works inconsistently and randomly. It would be nice if the Android developers hired at least one person who understood designing for backward and forward compatibility.

New in Frink 2012-08-10 (Aug 11, 2012)

  • For Android: Forced off spell checker in programming mode. This was causing significant performance issues on Android 4 devices.

New in Frink 2012-08-09 (Aug 11, 2012)

  • For Android: Added right and left arrow key buttons to aid platforms where these keys are unavailable (like the Nook.)
  • Added Unicode codepoint output when unrecognized characters are encountered in the input.

New in Frink 2012-07-07 (Jul 9, 2012)

  • Added = to Android user interface.

New in Frink 2012-07-01 (Jul 2, 2012)

  • Fixed Sloppy Time Specifications so that they would work properly if the time conversion might cause an increment or decrement of the day.
  • Added formats like 9 AM and 10 PM to the date formats file.

New in Frink 2012-06-23 (Jul 2, 2012)

  • Updated Sun position calculator pages to take arbitrary date/time values to calculate the position of the sun anywhere and anytime.

New in Frink 2012-06-12 (Jun 14, 2012)

  • Fixed foreign language translations to work again. The new code uses a regex-based solution, which is more powerful, robust, and will be easier to modify.
  • Added set methods set.subsets[] and set.subsets[allowEmptySet, allowOriginalSet] to return subsets of the elements in an set. For more information, see the Sets section of the documentation.

New in Frink 2012-06-11 (Jun 14, 2012)

  • The setDifference[arg1, arg2] function now tries to coerce its arguments into sets. This allows you to perform set-like differences on arrays and other types. Note that ordering and duplicates will be lost from arrays in this case.
  • Added array methods array.subsets[] and array.subsets[allowEmptySet, allowOriginalSet] to return subsets of the elements in an array. For more information, see the Sets section of the documentation.

New in Frink 2012-06-09 (Jun 14, 2012)

  • For Android: Pushed out a fix for the package installation errors that were occurring with the "2012-06-09" release from this morning. It appears that this was caused by a known bug in Google's tools, bug 19567, for which a fix has not been released yet.
  • I've kludged in a workaround to my build processes to get a release out, and I've pushed it to the market. You should see the new version as "2012-06-09b". Sometimes it takes Google a long time from when I upload the new software until it is available in the Market or visible from devices, so please wait a bit if it's not visible.
  • Added union[a, b] function to return the union of two intervals, or an interval and a real number. (Or two real numbers, in which case an interval containing both real numbers is returned.) The return type will be an interval or an ordinary real number if the two numbers are the same real number. It also works with dates and date intervals.
  • Made the functions min, max, union, and intersection work with date intervals.

New in Frink 2012-05-13 (May 23, 2012)

  • Made several changes to the input functions which make it easier and more consistent to build simple interactive applications that work consistently across operating systems, windowing libraries, and in text-based input mode:
  • Changed the single-item and multi-item input functions to behave similarly on user cancels. This means that if the user cancels/closes an input dialog, or end-of-file is encountered, all input functions return the special value undef.
  • In AWT mode: allowed the window "close" button to work on input dialogs. This will cancel input and return undef.
  • In Swing mode: made single-line input window return undef on window close. (Previously, you couldn't close it.) Made multi-line input windows return undef if closed/cancelled by user.
  • In text mode: single-line input functions will return undef when end-of-file (EOF) is encountered. If EOF is encountered on the first line of a multi-input field, the return value is the single value undef. If EOF is encountered after the first line of a multi-input field, the partially-completed values will be returned, and the rest of the fields will be undef.
  • For Android: For input function, hitting the "back" button now returns undef when cancelling single and multi-line inputs.
  • Added a new example of creating cross-platform user interfaces to take and process user input and handle cancellation gracefully. See the Making Interactive Interfaces section of the documentation for more.

New in Frink 2012-04-26 (Apr 28, 2012)

  • When constructing a power expression, many roots are simplified at construction time to a more canonical form. For example, 4^(1/2) is immediately simplified to 2, and 8^(1/2) is immediately simplified to 2 * 2^(1/2). Other fractional powers are similarly simplified. The compile-time simplifications improve symbolic math. More compile-time simplifications and canonicalizations will follow.
  • Expanded intersection[arg1,arg2] function to return the intersection of intervals or ordinary units. The return type in this case will be an interval or an ordinary real number. If there is no intersection between the arguments, the function will currently return undef although this behavior may change to return an empty interval in the future.
  • Made the min and max functions do something sensible when passed overlapping intervals. (Previously, they just threw an OverlapException, which could be improved.)

New in Frink 2012-04-25 (Apr 28, 2012)

  • Updated sun.frink to rename the function sunMoonAngularSeparation[date] to geocentricSunMoonAngularSeparation[date] to make it more clear that the calculation was from the center of the earth.
  • In the same file, added a new function sunMoonAngularSeparation[date, lat, long] to calculate the angular separation of the sun and the moon from a particular point on earth. This is usually the function you want.

New in Frink 2012-04-10 (Apr 11, 2012)

  • Multi-dimensional arrays of Java objects can now be constructed by passing an array of integers to the second argument of the newJavaArray function. For example, the following creates a two-dimensional array of double with dimensions 3 by 4:
  • d = newJavaArray["double", [3,4]]
  • d@0@0 = 3.14
  • See the Creating Java Objects section of the documentation for more.
  • When passing an array of Java objects to a Java method, the disambiguation rules were improved to eliminate some incorrect "can match" errors.

New in Frink 2012-04-01 (Apr 2, 2012)

  • Added dictionary.invert[] method to return a new dictionary with key-value pairs inverted. See the Dictionary Methods section of the documentation for more.
  • Internally rewrote enumerating expressions for better compile-time typesafety.
  • Added functions ceil[x,y] and floor[x,y] to round x up or down to the nearest multiple of y, analogous to the two-argument version of round. See the Rounding Functions section of the documentation for more.
  • The read and lines functions now allow the first argument to be an instance of java.io.InputStream, which simplifies reading from other input streams (for example, reading from a URLConnection or an external process, or a pipe.)

New in Frink 2012-03-01 (Mar 2, 2012)

  • For Android: Added experimental unit name completion in interactive mode. You can now start typing the first 2 or more letters of a unit name, and Frink will present an autocompletion list. This seems to be slow in some Android devices, so if it becomes too ponderous, it's gone. If it's useful, it may be expanded. Note that this list does not include all possible completions; you can still enter suffixes or units that may not be listed (like dollar_1910).
  • For Android: Added a class file that may have been missing from the past release.

New in Frink 2012-02-16 (Feb 17, 2012)

  • Added a map[function, list] applies the specified function to all the members of a list, and returns a new list containing the results. See the map section of the documentation for more.
  • Added getFunction[name, numArgs] which returns a reference to the function with the specified name (specified as a string) and number of arguments. This can then be assigned to variables, or called as noted in the Anonymous Functions and map sections of the documentation.
  • Rearranged split and join sections of the documentation.

New in Frink 2012-02-08 (Feb 9, 2012)

  • Added functions for converting text to/from base-64 encoding. See the Other String Functions section of the documentation for more information.
  • Added a "fallback" constraint source that will match arbitrary object names.

New in Frink 2012-02-06 (Feb 7, 2012)

  • Added a built-in Writer class to enable easy writing to files without including external libraries. See the Writing Files section of the documentation for more information.
  • Changed these documentation pages to reflect the fact that I'm now putting new announcements on Twitter at @frinklang, and not using Freshmeat any more.

New in Frink 2012-02-03 (Feb 4, 2012)

  • Improved error messages when array bounds errors occur.

New in Frink 2012-01-26 (Jan 27, 2012)

  • Added urlFile[string] to return a string indicating the filename of a specifed URL string, that is the last path part of a URL (e.g. "http://futureboy.us/frinkdocs/whatsnew.html" will return "whatsnew.html")
  • Added urlPath[string] to return a string indicating the entire path of a specifed URL string, (e.g. "http://futureboy.us/frinkdocs/whatsnew.html" will return "/frinkdocs/whatsnew.html")
  • Added browse[URL] function to launch the specified URL in your computer's browser (or however your computer likes to launch things.) This also works on Android, but Android doesn't like to launch many protocol types other than http.
  • Wrote a colorillusion.frink program to draw color illusions like the one here. (You'll want to supply your own image file.) I don't think my algorithm is quite right yet, as colors easily become saturated or blocky and don't produce quite the right colors in the inverse. Note that this program requires today's release of Frink!

New in Frink 2012-01-21 (Jan 23, 2012)

  • Updated data file to account for the leap second that will be introduced at the end of June, 2012.

New in Frink 2012-01-18 (Jan 21, 2012)

  • Worked around some weird issues in calling methods on Java objects. I ran into weird cases where multiple methods have the same signature (function name and arguments) but different return types. The code now tries to disambiguate and uses the method with the most specific return type. I don't know if that's what you actually want to do, so let me know if there are issues with this.
  • Added a cool demo program to use Java's MIDI music synthesis to play music from Frink. See midisynth.frink . Note that your Java Virtual Machine must have implemented this feature. (e.g. Sun/Oracle's JVM works, while OpenJDK does not.)

New in Frink 2012-01-06 (Jan 9, 2012)

  • Updated planets.frink with the radii and masses of planets, and allowed calculation and drawing of bright limb angle.
  • Updated sun.frink to allow drawing of the illuminated fraction of planets.

New in Frink 2012-01-03 (Jan 3, 2012)

  • As of 2011-12-01, Google has eliminated free access to their translation APIs, so they are no longer available through Frink. If you wish to pay for an API license, you may still be able to modify GoogleTranslate.frink (although the version 2 API has changed significantly.)
  • Added isComplex[expr] function.
  • Updated sanity checks for the year 2012.
  • Updated copyright dates.
  • Forced creation of frink directory on Android.
  • No leap seconds were added at the end of 2011, so no changes were made.

New in Frink 2011-11-15 (Nov 16, 2011)

  • Changed eulerTotient[1] to return 1.
  • For Android: Made input fields expand themselves to multi-line, rather than always horizontally scrolling.

New in Frink 2011-11-10 (Nov 16, 2011)

  • Updated many units in the standard data file (particle masses, charges, gravitational constant, Planck's constant, etc.) to match 2010 CODATA values, which were first released by CODATA in June, 2011. A reference for the 2010 CODATA values can be found at NIST.

New in Frink 2011-10-31 (Nov 16, 2011)

  • Refactored arrays to ensure that all implementations are hashable and have the same hash code.
  • Added hashCode[expr] to return the hashcode for a particular expression.

New in Frink 2011-10-25 (Nov 16, 2011)

  • Fixed a bug in the allFactors function which effectively made the parameter onlyToSqrt always equal false. Thanks to Tom Louie for the bug report.
  • Added a three-argument sort function to allow the user to pass in arbitrary "helper" data to be used in a sorting operation. See the Sorting section of the documentation for more information. Thanks to Jim Fishman for the report.

New in Frink 2011-09-16 (Sep 20, 2011)

  • Modified the read[location] to read from standard input (stdin) if passed the argument "-".

New in Frink 2011-09-15 (Sep 20, 2011)

  • Added the ability to call functions and methods by name using the callByName[object, methodName, argList] function. See the Calling Functions and Methods by Name section of the documentation for more.
  • Added slice[array, start, end] and sliceLength[array, start, length] functions to take a "slice" out of an array.
  • Modified the lines[location] to read from standard input (stdin) if passed the argument "-".
  • Added messageDigestInt[str, algorithm] to calculate a message digest and return its value as an integer.

New in Frink 2011-09-05 (Sep 7, 2011)

  • Added array.combinations[take] method to generate the combinations of the elements in an array. See the Array Methods section of the documentation.
  • The sample program pokerhands.frink demonstrates using the combinations method to enumerate all possible 5-card poker hands.

New in Frink 2011-08-17 (Sep 7, 2011)

  • Various improvements and changes in Frink-Java mapping:
  • When calling methods on Java objects, when there is ambiguity, Frink now attempts to find the method with the most specific arguments. For example, if a class has methods doSomething(String) and doSomething(Object), and the method is passed a string, Frink will call doSomething(String). This will not yet disambiguate between primitive types.
  • Java function calls that return void now return Frink's void type instead of undef. I don't really like having a void type, so this may change back.

New in Frink 2011-08-16 (Sep 7, 2011)

  • Fixed currency conversions to work again.

New in Frink 2011-08-11 (Sep 7, 2011)

  • The newJava function now displays the original cause of the exception in the case of an InvocationTargetException.

New in Frink 2011-08-10 (Sep 7, 2011)

  • Made improvements to make it easier to read data from standard input (stdin) using the input functions.
  • input functions now return undef at EOF, or when the user enters an end-of-file (EOF) character (usualy Ctrl-D on Unix variants, Ctrl-Z on Windows).
  • Removed the single-space of padding if the empty string is specified as the prompt of the input function. A trailing space is still added if the prompt string is non-empty. This is to make input legible and give some uniformity to both GUI-based and command-line based calls to the function.
  • The multi-line input form of the input function now returns undef for arguments on which the user enters the EOF character and for following arguments.
  • Piping input from another file or process and reading it with the input functions now works in a less error-prone fashion. Previously, it could throw NullPointerException if you were testing its return value in certain ways. Now, with it always returning undef on EOF, its behavior is more predictable.
  • If, for some reason, you're in a GUI mode and you still want to read from standard input, you can call readStdin[] to read one line from standard input. This is just like calling input[""] from command-line mode, which is what you really want to be calling if you're trying to make programs that work both interactively and non-interactively, and in GUI mode and non-GUI mode.
  • Improved synchronization and removed multiple constructions of buffers that caused problems with reading single lines from stdin.
  • Modified some logic when reading from stdin to ensure that we always catch EOF.
  • Some more exponential expressions are simplified at compile-time, such as 12^-1 is immediately reduced to the exact rational number 1/12.

New in Frink 2011-08-01 (Sep 7, 2011)

  • Added additional security restrictions in sandbox mode.

New in Frink 2011-07-28 (Sep 7, 2011)

  • Added security restrictions to parseToExpression[str].
  • Improved Java mappings from expressions to expressions.

New in Frink 2011-07-14 (Sep 7, 2011)

  • For Android: Many user interface enhancements for programming mode, including:
  • Created a new preferences screen.
  • Font size selection moved to preferences screen.
  • Allowed the user to hide the "run" buttons on screen. These can still be accessed with Menu+R or through the new "Run" menu item.
  • Stack size is now user-configurable.
  • Mode switch menu item now just takes one click to switch to "convert" mode.

New in Frink 2011-07-11 (Sep 7, 2011)

  • Improved construction-time optimizations for NOT operator.

New in Frink 2011-07-10 (Sep 7, 2011)

  • Optimized setIntersection[set1, set2] function.
  • Added setsIntersect[set1, set2] function.
  • Improved documentation of the date formats file.
  • Added allFactors function to find all factors of a number, not just the prime factors. See the Number Theory section of the documentation for more information.
  • Allowed bounds in a for loop or range object to be boolean values, for example: for a=false to true.
  • Improved the documentation for the for loop.
  • Added construction-time optimizations for the not operator. If possible, this simplifies boolean expressions on construction.
  • The graphics.print[] and graphics.printTiled[pagesWide, pagesHigh] functions now print with no insets--that is, they print as wide as possible on the page. (Previously, they filled up 95% of the page.) If you want the old behavior, see the new functions that take insets arguments in the Showing Graphics section of the documentation.
  • The image.print[] and image.printTiled[pagesWide, pagesHigh] functions now print with no insets--that is, they print as wide as possible on the page. (Previously, they filled up 95% of the page.) If you want the old behavior, see the new functions in the Images section of the documentation.

New in Frink 2009-04-26 (Apr 29, 2009)

  • Warning: This release changes the behavior of the abs[x] function when called with an interval argument. It does not alter its behavior for any other numerical types (e.g. real or complex numbers.)
  • The behavior of the abs[x] function has changed for interval arguments. Previously, it returned a single scalar value instead of an interval. To be precise, it used to return the absolute value of the endpoint furthest from zero (which is a definition that goes back to Ramon Moore's early texts on interval analysis.) However, this was considered to be a surprising definition by many (including myself.) It didn't follow the spirit of absolute value for real numbers, it chose one endpoint arbitrarily as being more important than the other, discarded the other endpoint and the "main/middle" value, and caused loss of information and unexpected results when passing interval arguments to a program initially written with real numbers in mind.
  • Thus, after surveying a large number of implementations of interval arithmetic and discussing this with the leading practitioners in the field, it was decided to change the implementation of this function to more closely follow the spirit of the definition of abs[x] for real numbers, and to follow a more modern convention that is widely used in interval arithmetic implementations. The abs[x] function now returns an interval (possibly with a main/middle value) which contains the interval that would be obtained by calling abs[x] on both endpoint (and the middle value) of the interval, with one exception. If the interval contains zero, then the lower bound of the new interval will be zero.
  • The previous behavior is now moved to a new function called magnitude[x] which returns a scalar which corresponds to the absolute value of the endpoint farthest from zero. For symmetry, another function mignitude[x] has been added, which returns the absolute value of the endpoint closest to zero.
  • This change should make the results of passing an interval to an equation designed for real numbers much less surprising.
  • Thanks to Alan Stebbens for the initial inquiry into this behavior, and to the respondents on the "Reliable Computing" mailing list and on the IEEE-1788 expert group mailing list, which is working toward defining an IEEE standard for interval arithmetic. Special thanks to R. Baker Kearfott, Arnold Neumaier, George Corliss, Ramon Moore, Dan Zuras and Richard Smith for directly answering questions related to these definitions.