A Variation on "Take" Frederich Macashill LPA Sol%ware, Inc. 290 Woodcliff Drive Fairport, NY 14450 Tel: 716-248-9600 (Fax: 716-248-9100) T h e dyadic mixed primitive function T a k e can be used to selectively take data out of an array or to increase the size of the dimensions of an array. W i t h the exception of a scalar, T a k e cannot be used to increase the rank of the array. When "over taking" with T a k e the array is filled out with zeroes if it is a numeric array and blanks if it is a character array. The left; argument is the size of each dimension to take, the, right argument is the variable which is to be taken. W h e n over taking a mixed array w e rur~ into difficulty. Should the system be filling out with zeroes or blanks? If so w h y ? Is there any logical reason w h y w e should be filling out with zeroes and blanks? T h e assumption is that zero and blank-axe the typical representatives of the classes of data called numeric and character. But this m a y not be the case. V i e w data as being alphabet soup. T h e letters are floating in a background "substance." W h e n w e take our data from the mixture w e will take with the data the background in which the data lies. A P L assumes this to be blanks. This is not necessarily so. Similarly, numeric data m a y be taken from an environment where the background could he anything but zero. T o solve this problem it is proposed that a system variable, O F I L L , be introduced. This would be a two-element vector where the first element is the numeric fill item and the second clement the character fill item. B y default these would be zero and blank. F r o m the above: OFILL -32768 A 1 2 3 5 A -32758 -32758 B 'A B C ' 5 B '*' G D D M Emulator for Dyalog APL for Windows Andrei Kondrashev Lingo Allegro U_S.A., Inc. 203 N. LaSalle St reet , #2100 Chicago, IL 60601 USA E-maih 7 1 3 0 3 . 3 2 2 4 @ C o m p u S e r v e .corn This article p r e s e n t s t he e x p e r i e n c e o f developing a graphics auxiliary p r o c e s s o r for Dyalog APL/W in the MS Windows e n v i r o n m e n t using Dynamic Data E x c h a n g e (DDE) t e c h n o l o g y . The auxiliary processor implements a subset o f the IBM Graphical Data Display M a n a g e r (GDDM) t h a t supports t he o p e r a t i o n of IBM APL2 G R A P H P A K under Dyalog APL/W. Dyalog APL for Microsoft Windows by Dyadic Systems Ltd. [1] is a well-implemented t r u e Windows application. APL/W gives an A P L programmer a British dialect o f APL2 combined w ith a powerful and c o n v e n i e n t e n v i r o n m e n t . H o w e v e r, many i m p o r t a n t Windows funct i ons have n o t been implemented in t he first release, in use at Lingo Allegro. For example, graphics is not supported. It will have to be included in f u t u r e versions. As we had graphical packages w h i c h we would like to r u n under Dyalog APL/W, we had to find some way to write our own graphics e x t e n s i o n for APL/W. Dyalog APL/W offers two ways to w rite extensions. The first way is a u x i l i a r y p r o c e s s o r s w h ic h are built into t he APL syst em and a p p e a r in the workspace as e x t e r n a l defined functions. The second is auxi l i ary processors w h i c h arc c o n n e c t e d to the A PL syst em via s h a r e d variables. The shared variables t e c h n i q u e is i m p l e m e n t e d in Dyalog APL/W w i t h the help of t he DDE protocol, which is a s t a n d a r d m e c h a n i s m for i n t e r p r o c e s s c o m m u n i c a t i o n in Microsoft Windows. We have chosen t he second method, because this is a universal approach t h a t p e r m i t s us to r u n o u r extensions with APL/W and o t h e r Windows p r o g r a m s t h a t support DDE sessions. Additionally, the DDE approach doesn't r e q u i r e special libraries and a compiler; we could use the s t a n d a r d M ic ro so ft Software Development K i t (SDK)_ As we found o u t l at er on, this approach also r e q u i r e s less memory. T he DDE protocol is based on t h e client-server model and is a set of messages and ru le s t h a t specify the method of t r a n s f e r r i n g data fro m one application to a n o t h e r t h r o u g h com m on global m e m o r y blocks_ T h e r e are t h r e e possible kinds o f link bet w een a client and a server: cold, warm, and hot. These types differ by t he actions o f a s e r v e r w h e n its data are changed. When we made a decision r e g a r d i n g th e kind o f graphics we would like to have, we chose th e ABC** Similarly, Ex pa nd also pads out data %with a fill character: 1 A*B*C* \ B This e n h a n c e m e n t to the language would make E x p a n d and T a k e more general in n a t u r e . ⢠AP-L Quote Quad
/lp/association-for-computing-machinery/a-variation-on-take-ZY0f4CeNbE