Sunday, February 4, 2007
List Comprehensions - II
I checked around for a Lisp version of list comprehensions, and sure enough, back in 1999 I had developed one. Here is the Lisp source for one implementation of list comprehensions. This version does not make use of pattern matching, and so does not have the concept of refutable patterns either.
Sunday, February 4, 2007
List Comprehensions
As we mentioned before, NML picked up a lot of neat ideas from other languages. One of the really neat ideas picked up from Haskell, and several others, is the notion of “List Comprehensions”.
A List Comprehension is a specification for the production of a list based on set-theoretic notation of
Sunday, February 4, 2007
Time Reversal
When performing Hartley Transforms, we have to make time-reversed copies of data arrays. It would be tempting to do this with a simple slicing expression that simply reverses the array.
But that is incorrect. The time reversal of an array is not the reverse of the array. Element zero -- the first
Sunday, February 4, 2007
Array Slicing and Dicing
NML borrows a lot of good ideas from a wide variety of other languages. One of the best ideas from RSI/IDL and PVWave is their syntax for representing array slicing. NML takes those ideas several steps further.
An array slice represents some subregion of an array. For example, if a is an array
Saturday, February 3, 2007
NML Arrays
Arrays in NML are stored in memory as contiguous vectors of double-precision floating point values. They are all unboxed values. In the parlance of ordering, they are stored in row-major order, meaning that the rightmost index of a multidimensional array changes most rapidly as we access