Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Challenge: create .atf containing variables dyalogav and apl2av

30 views
Skip to first unread message

Gary Logan

unread,
Feb 1, 2012, 2:55:29 PM2/1/12
to

The .atf should contain variables named dyalogav and apl2av.

To be specific assume the name \temp\av.atf

From dyalog apl after ]in '\temp\av.atf'
⎕av≡dyalogav
1

From apl2 apl after )in '\temp\av.atf'
⎕av≡apl2av
1





David Liebtag

unread,
Feb 13, 2012, 7:57:47 PM2/13/12
to
Gary,

Do the objects have to be variables? If not, you could use nilladic
functions. For example, this definition of apl2av works:

∇av←apl2av
[1] av←0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
[2] av←av,16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
[3] av←av,32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
[4] av←av,48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
[5] av←av,64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
[6] av←av,80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
[7] av←av,96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
[8] av←av,112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
[9] av←av,199 252 233 226 228 224 229 231 234 235 232 239 238 236 196 197
[10] av←av,9109 9054 9017 244 246 242 251 249 8868 214 220 248 163 8869
8359 9014
[11] av←av,225 237 243 250 241 209 170 186 191 8968 172 189 8746 161 9045
9038
[12] av←av,9617 9618 9619 9474 9508 9055 8710 8711 8594 9571 9553 9559 9565
8592 8970 9488
[13] av←av,9492 9524 9516 9500 9472 9532 8593 8595 9562 9556 9577 9574 9568
9552 9580 8801
[14] av←av,9080 9079 8757 9015 9026 9019 8866 8867 8900 9496 9484 9608 9604
166 204 9600
[15] av←av,9082 223 8834 8835 9053 9074 9076 9073 9021 8854 9675 8744 9075
9033 8714 8745
[16] av←av,9023 9024 8805 8804 8800 215 247 9049 8728 9077 9067 9035 9042
175 168 160
[17] av←⎕UCS av∇

Unfortunately, this only works for Workstation APL2. You would need another
object for mainframe APL2.

David Liebtag

Gary Logan

unread,
Feb 15, 2012, 1:56:06 PM2/15/12
to
On Feb 13, 5:57 pm, "David Liebtag" <davidlieb...@vermontel.net>
wrote:
David,
Thanks for the response. Using functions is not a problem.

I defined your function on apl2 and used the same approach
to define a function on dyalog. I can transfer these without
problems. Thanks.

I am still trying to find a way to transfer variables in general.
One problem is that ]out will represent some characters as
quadav[indices] and others are enclosed in quotes.
Maybe sending the quaducs of such variables would work.


David Liebtag

unread,
Feb 17, 2012, 8:45:10 AM2/17/12
to
Gary,

You might want to take a look at my new Source Code Tools package at
davidliebtag.com. They support writing functions and variables to human
readable files. I wrote them to support storing APL2 code in revision
control systems, but they could be used for migration too. The tools
currently only work on APL2, but the basic format is pretty easy and it
would not be hard to write a similar tool for Dyalog. Let me know if you'd
like a Dyalog version,,,

David Liebtag

ap...@vnet.ibm.com

unread,
Mar 5, 2012, 1:39:38 PM3/5/12
to
Hi Gary,

Have you looked at the SCAR format? This is a format that was defined exactly for the purpose you are asking about, to transfer data between APL2 systems. APL2 and Dyaloc and APL2000 all suppor it.

APL2's support is via 2 external functions ATS and STA. ATS takes an APL2 array and produces a character vector containing the SCAR format object, which you can then write to a file, read into Dyalog and use their SCAR functions to turn back into an array.

Look in the APL2 User's Guide for information on ATS and STA under "Supplied External Functions".

Nancy Wheeler
APL Products and Services
IBM

Gary Logan

unread,
Mar 6, 2012, 7:53:40 PM3/6/12
to
On Feb 17, 6:45 am, "David Liebtag" <davidlieb...@vermontel.net>
wrote:
David,
Thank you for your suggestions. The project is still in the
evaluation stage but I do appreciate your offer.

Your web site is quite impressive and for some reason reminds
me of Warren Buffet's annual report to investors.

Good luck in your future endeavors and thanks for your work
with apl2 over the years.

Gary Logan

unread,
Mar 6, 2012, 8:00:40 PM3/6/12
to
Nancy,
I agree that those external functions seem handy for the job.

It is nice that many of the other apl implementations share
this work.

Thank you for the post because I was not aware of any of this
work. Documentation is for reading and understanding and I
need to do more of both.
0 new messages