Talk:APL (programming language): Difference between revisions

Content deleted Content added
Sort Example
No edit summary
Line 69:
I cannot see whether it is correct or not (since indeed APL is a write-only language) -- but at least: where is the SORT operator??
--[[User:217.245.7.251|217.245.7.251]] 12:39, 5 Feb 2005 (UTC)
 
The expression 52 ? 52 will give you a pesudo-random permutaion of the numbers from 1 to 52 (or 0 to 51, depending on the current index origin). This can reasonably be called "shuffling cards" although to display this list of values as symbold for cards would take a little more code. This is 5 cahracters, but only 3 symbols, as i would call a sungle number a single symbol, no matter how many digits it needs to represent it. In fact, this function is called "deal" which makes the sufgested use tolerably obvious.
 
The primiive functions grade up, and grade down ((“) and (”) view with an APL font) -- they are not operators in APL terminology -- sort arrays of numeric values. If the array is multi-dimensional, a multi-way sort will be performed. The result is the set of indicies needed to reshape the array into a sorted form. Sorting of character data is also provided by these functions, but a left arguemt giving the collating sequence to be used must be supplied. A complex sequence (for example, upper and loewr case letters rating as identical unless needed to break ties) can be provided by using a multi-dimensional left argument. [[User:DESiegel|DES]] 17:50, 21 Feb 2005 (UTC)