Browse Prior Art Database

Take and Drop Symbol Processing Functions

IP.com Disclosure Number: IPCOM000079503D
Original Publication Date: 1973-Jul-01
Included in the Prior Art Database: 2005-Feb-26
Document File: 2 page(s) / 13K

Publishing Venue

IBM

Related People

Reynolds, SW: AUTHOR

Abstract

The two principal functions, WTAKE (Word Take) and WDROP (Word Drop), operate on PROPER files in a manner analogous to the take (f) and drop (I) primitives of APL as they operate on either a numeric or character vector.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 53% of the total text.

Page 1 of 2

Take and Drop Symbol Processing Functions

The two principal functions, WTAKE (Word Take) and WDROP (Word Drop), operate on PROPER files in a manner analogous to the take (f) and drop (I) primitives of APL as they operate on either a numeric or character vector.

A proper file is, in APL terms, a character or numeric vector. It consists of symbols, or words, each of which is delimited fore and aft by some delimiter (not necessarily the same), for example, a blank, a carriage return, a magnitude sign, etc. A null vector is not a proper file.

Description of WTAKE: This dyadic function will yield appropriate error messages for incorrect arguments. In addition to domain, rank, and length error messages pertaining to the left argument, two new tests are provided. The right argument must be a proper file or a proper file error occurs. Also, should either the right argument or the word delimiters (WD) contain a number (999999) for a numeric file or an underscore character (-) for a character file, a padding symbol error message results. This is due to the fact that these special words are used as padding symbols by the WTAKE function. The user would then have the option of changing these special words in either the WTAKE function or in his file.

Once it is determined that I is an integer, P is a proper file, and C (either 999999 or(-)) belongs neither to P nor to WD, then A, the number of symbols in the file P, is determined. Next, B, a vector each integer of which is the length of a symbol, is computed by a function called dimension. The sum of the first I integers of B is added to One plus the smaller of A and the absolute value of I.

This total is then multiplied by the signum function of I. The result is the number of...