A2A <-> now W2W 
Author Message
 A2A <-> now W2W

This file (or email message) -- when read into your copy of
Weigang's A2A workspace -- makes a new workspace that trans-
fers all fns and (non-nested) vars to and from ASCII file
representations of an entire workspace.  It's an "add-in" to
Jim Weigang's APLASCII.

If you don't have APLASCII for your interpreter, it's available
via ftp://archive.uwaterloo.ca/langauges/apl/workspaces/aplasii,
via download from FileArea APL95 of the BBS\APL at 703-528-7617,
and by mail order for $US 17 ppd worldwide from{*filter*} Holt
(address below).  The $US17 fee includes *all* APL95 Software
Exchange material, and $US12 goes straight to SIGAPL.

Although APLASCII wasn't designed to transfer vars, much less
an entire ws, it's a useful way to do so.  I wrote W2W to send
an .AWS from the APL95 Software Exchange to an APL68000 user who
has the APL68k version of APLASCII.  In this particular case the
.AWS was Langlet's SEARCHGL.AWS, in which specially tailored
vars are a critical part of software to demonstrate techniques
of molecular biology as applied to APL programming and
"artificial intelligence."

So, here's what to do:

(1)  First )LOAD your copy of A2A, Weigang's installed version
     of APLASCII.

(2)  Then, while in A2A, issue the command:

                DEFINEFNS TFREAD 'drive\path\W2W.ASC'

     Use the drive\path where your copy of W2W.ASC is located.
     This will read *this* file, and will define the 7 fns of
     W2W (readme2, getw, getf, getv, sendw, sendf, and sendv)
     that follow the introductory text you are now reading.

     If you get this file via email on CLA, substitute the name
     of your email file for W2W.ASC.  DEFINEFNS will ignore the
     text you are now reading.  Note that fn getw in W2W (get a
     ws) is redundant with the DEFINEFNS command above if all
     you really want are the fns, not the vars.

(3)  Before you forget it, rename your A2A workspace (the name
     W2W is suggested), and )SAVE it.

(4)  Run fn readme2 in your new ws for further instructions.  Unless
     you're using APL*PLUS/PC, you'll probably need to edit some of
     the fns of W2W to make the []s compatible with your APL inter-
     preter (for native files, string search).

That's it.  You're done.

This is version 1.0.  It may not work in every case.  I've gotten
WSFULL on some big test cases, and some truly horrible results on
variables in an .AWS containing cryptographic variables.

If A2A (and W2W) gains general acceptance in the APL community,
I'll ask the SIGAPL Executive Committee to encourage its more
widespread use, especially in the Annual Conference Software
Exchange.  A side effect of such a move would be to encourage
APL programmers to write more in accord with ISO standard APL.
Another side effect would be to partially demolish the Tower of
Babel that currently exists among different APL interpreters.

Please send any comments or suggestions to{*filter*} Holt at:
3802 N. Richmond St.  Arlington VA 22207.

W2W.ZIP (and W2W.ASC) are available for download in FileArea APL95
on the BBS\APL at 703-528-7617, 1.2-14.4b, N81 24 hrs, and will be
available, after a few months of your testing, via FTP from:
ftp://archive.uwaterloo.ca/languages/apl/workspaces

Don't bother to read the rest of this message (it has some long lines).
It consists of the ASCII representation of the 7 fns of W2W.

//{*filter*} Holt

=====[  Start of W2W ASCII representation ]==========================
     {del}readme2;z

[2]   '' & ''
[3]   '  ===================================================================={+
   +}==='
[4]   ''
[5]   '            W2W: Workspace-to-Workspace Transfer'
[6]   ''
[7]   '  Workspace W2W sends/retrieves an entire WS to/from an ASCII file.  {+
   +}It''s'
[8]   '  an ''add-in'' to A2A, the installed version of Jim Weigang''s {+
   +}APLASCII.'
[9]   ''
[10]  '  W2W was developed using v1.0 1994/11/04 APLASCII.APLPLUS1.  You *{+
   +}must*'
[11]  '  use W2W in A2A, because W2W uses fns of this software.  It won''t {+
   +}work'
[12]  '  without them.'
[13]  ''
[14]  '  W2W is designed to transfer entire workspaces between different APL'
[15]  '  interpreters.  It transfers all fns and all (non-nested) vars in a {+
   +}work-'
[16]  '  space of APL X to an ASCII file that can be read by W2W in APL Y.  {+
   +}Of course,'
[17]  '  you''ll probably have to edit some of the fns imported from APL X {+
   +}to make'
[18]  '  them compatible once they arrive in APL Y.  For example, #FX from {+
   +}APL*PLUS'
[19]  '  must be changed to lowercase #fx in Iverson/Sharp APL.' & ''
[20]  '  To send all fns, and all non-nested array vars in workspace XXX to an'
[21]  '  ASCII file: )COPY or )PCOPY XXX into your W2W workspace and run:'
[22]  ''
[23]  '             sendw ''path\filename'' (use quotes)'
[24]  ''
[25]  '      Press Enter to continue: ' & z{<-}{quotequad}
[26]  '  To retrieve all fns and vars in workspace XXX that have been put in {+
   +}an'
[27]  '  ASCII file by sendws in W2W, )LOAD W2W and run'
[28]  ''
[29]  '             getw ''path\filename''  (use quotes)'
[30]  ''
[31]  '  Then expunge all W2W objects in GRPW2W.  What''s left over are the {+
   +}APL'
[32]  '  fns and vars from the ASCII file -- exactly the ones you wanted.' & ''
[33]  '  W2W uses some system fns (#s) that may be unique to APL*PLUS.  You {+
   +}may'
[34]  '  need to edit W2W fns to modify the #s below for your interpreter:' &{+
   +} ''
[35]  '      Native files   : #NTIE, #NUNTIE, #NCREATE, #NSIZE,'
[36]  '                       #NREAD, #NAPPEND, #NRESIZE'
[37]  '      Execution      : #IO (is 1 in W2W)'
[38]  '      Fn manipulation: #FX, #CR (see Gilman {&} Rose)'
[39]  '      Object info    : #NL 2, #NL 3'
[40]  '      String search  : a #SS z (','''','abcdef','''',' #SS ','''','{+
   +}cde','''',' gives 0 0 1 0 0 0)' & ''
[41]  '      Press Enter to continue: ' & z{<-}{quotequad}
[42]  '  If you have problems with WSFULL or NONCE errors, try splitting your'
[43]  '  target work space into smaller parts.  APLASCII (and thus W2W) isn''t'
[44]  '  designed to handle memory-limited situations.' & ''
[45]  '  Please send comments or suggestions to{*filter*} Holt:'
[46]  '  3802 N. Richmond St.  Arlington VA  22207  USA'

[48]  '  BBS\APL, or FAX: 703-528-7617, 1.2-14.4b, N81, 24 hours' & ''
[49]  '' & '' & ''
     {del}
=====================================================================
     {del}getw {delta_}ws;Z;k;{delta}Nolo{delta}




[5]   GRPA2A{<-}GRPA2A {delta_}OVER 6 5 {shape}'getw getf getv sendwsendfsendv'
[6]   GRPA2A{<-}GRPA2A {delta_}OVER 'readme2'

   +}to avoid
[8]   {delta}Nolo{delta}{<-}' ','',(,GRPA2A,' '),'',' KEEPUS '
[9]   {delta}Nolo{delta}{<-}{delta}Nolo{delta},' {delta}Nolo{delta} {delta}f{+
   +}{delta} {delta_}Z{delta} {delta_}ws r{delta} k{delta_} i{delta} j{delta}{+
   +} {delta_}v{delta_} {delta_}cn{delta} {delta_}Ok '

[11]  '' & '   Retrieving fns and vars from ASCII file ',{delta_}ws & ''

[13]  #NUNTIE {neg}1729 & ({format}{delta_}ws)#NTIE {neg}1729
[14]  Z{<-}#NREAD {neg}1729 82 ,(#NSIZE {neg}1729),0 & #NUNTIE {neg}1729

   +}Manugistics)


   +}{|}%%%{|}'

[19]  getf '',(k{take}Z),'' & getv '',((5+k){drop}Z),''

[21]  Bye:'   Ok.  WS transfer from ASCII file ','''',{delta_}ws,'''',' done.'
[22]  '   Do NOT forget to )ERASE all objects in GRPA2A, rename this'
[23]  '   workspace, and )SAVE it.' & ''
[24]  '   Please send comments or suggestions to{*filter*} Holt:'
[25]  '   3802 N. Richmond St.  Arlington VA  22207  USA'

[27]  '   BBS\APL, or FAX: 703-528-7617, 1.2-14.4b, N81, 24 hours'
     {del}
=====================================================================
     {del}getf Z;z


[3]   '   > Retrieving functions.'
[4]   {->}(~0{epsilon}{shape}Z)/L1 & '      ','No functions found' & '' & {->}0


   +}fn names
[7]   '   > Functions done.' & ''
     {del}
=====================================================================
     {del}{delta_}v{<-}getv {delta_}vCN;{delta_}sh{delta};namev{delta_};ch{+
   +}{delta}num;{delta_}val{delta};{delta_}v{delta_};{delta_}vCN


[3]   '   > Retrieving variables from file ',{delta_}ws
[4]   {->}(~0{epsilon}{shape}{delta_}vCN)/LVar & '      ','No variables {+
   +}found' & '' & {->}0


[7]   {delta_}vCN{<-}3{drop}{delta_}vCN
[8]   {delta_}sh{delta}{<-}((({delta_}vCN #SS '[%]'){iota}1)-1){take}{delta_}{+
   +}vCN & {delta_}vCN{<-}(3+{shape}{delta_}sh{delta}){drop}{delta_}vCN
[9]   namev{delta_}{<-}((({delta_}vCN #SS '[%]'){iota}1)-1){take}{delta_}vCN {+
   +}& {delta_}vCN{<-}(3+{shape}namev{delta_}){drop}{delta_}vCN
[10]  ch{delta}num{<-}((({delta_}vCN #SS '[%]'){iota}1)-1){take}{delta_}vCN &{+
   +} {delta_}vCN{<-}(3+{shape}ch{delta}num){drop}{delta_}vCN
[11]  {delta_}val{delta}{<-}((({delta_}vCN #SS '[%]'){iota}1)-1){take}{+
   +}{delta_}vCN & {delta_}vCN{<-}({shape}{delta_}val{delta}){drop}{delta_}vCN


   +}or numeric?
[14]
[15]  LvC:{->}(~1{epsilon}''''{epsilon}{delta_}val{delta})/NQuo

   +}{delta_}val{delta}
[17]  {delta_}val{delta}[(''''={format}{delta_}val{delta})/{iota}{shape}{+



[20]  NQuo:{execute}({format}namev{delta_}),'{<-}',({format}{delta_}sh{delta}{+
   +}),'{reshape}',''''',({delta_}val{delta}),''''' & {->}End
[21]

[23]  LvN:{execute}({format}namev{delta_}),'{<-}',({format}{delta_}sh{delta}){+
   +},'{reshape}',{delta_}val{delta}

[25]  End:'      ',{format}namev{delta_} & {->}(0{/=}{shape}{delta_}vCN)/LVar
[26]  Bye:'   > Variables done.' & ''
     {del}
=====================================================================
     {del}sendw {delta_}ws;v;{delta}f{delta};{delta}Nolo{delta}



[4]   #IO{<-}1 & '' & '   Sending fns and vars to ASCII file  ',{delta_}ws


   +}local objects
[7]   {delta}Nolo{delta}{<-}{delta}Nolo{delta},' {delta}Nolo{delta} {delta}f{+
   +}{delta} {delta_}Z{delta} {delta_}ws r{delta} k{delta_} i{delta} j{delta}{+
   +} {delta_}v{delta_} {delta_}cn{delta} {delta_}Ok '
[8]   {delta}Nolo{delta}{<-}{delta}Nolo{delta},' getw getf getv sendw sendf {+
   +}sendv readme2 '

[10]  {delta}f{delta}{<-}sendf & v{<-}sendv & {->}(~(''{match}{delta}f{delta}{+
   +})^(''{match}v))/LFile
[11]  '' & '   No functions or variables to send.' & '' & {->}Bye


   +}name conflict
[14]  {->}(''{match}{delta}f{delta})/NoFiles & {delta}f{delta} #NAPPEND {neg}{+
   +}9271

   +}from vars
[16]  {->}(''{match}v)/End & v #NAPPEND {neg}9271 & #NUNTIE {neg}9271

[18]  End:'   All available fns and vars sent to ASCII file ',{delta_}ws & ''
[19]  Bye:'   Please send comments or suggestions to{*filter*} Holt:'
[20]  '   3802 N. Richmond St.  Arlington VA  22207  USA'

[22]  '   BBS\APL, or FAX: 703-528-7617, 1.2-14.4b, N81, 24 hours'
     {del}
=====================================================================
     {del}F{<-}sendf;k;fn;j{delta}


[3]   k{<-}1 & F{<-}'' & '' & j{delta}{<-}0 & '   > Sending functions:'

[5]   L1:fn{<-}{format}(#NL 3)[k;]~' '

   +}skip local fns
[7]   {->}(~0{epsilon}{shape}#CR '',({format}fn),'')/Ins

[9]   '      ',(10{take}{format}fn),' < Skipped: can''t send locked fns.'
[10]  '      ',(10{reshape}' '),'   Contact{*filter*} Holt to unlock .AWS fns.'
[11]  {->}End

[13]  Ins:F{<-}F,INSERTFNS '''','{del}',fn,'''' & j{delta}{<-}j{delta}+1 & ' {+
   +}     ',{format}fn
[14]  End:{->}((1{reshape}{shape}#NL 3){>=}k{<-}k+1)/L1

[16]  {->}(0{/=}j{delta})/OK & '      No functions available' & '' & {->}0
[17]  OK:'   > Functions done.' & ''
     {del}
=====================================================================
     {del}{delta_}Z{delta}{<-}sendv;k{delta_};i{delta};j{delta};{delta_}v{+
   +}{delta_};{delta_}cn{delta};{delta_}Ok;r{delta}




   +}       Set it up


   +}{delta_} = deblanked name of k{delta_}th var
[7]   {->}(1{epsilon}{delta}Nolo{delta} #SS ' ',({format}{delta_}v{delta_}),'{+


[9]   LV:{delta_}cn{delta}{<-}0{epsilon}1{take}0{reshape}{execute}{format}{+

   +}{delta}=0 if char

[11]  {->}(~0{epsilon}{shape}{shape}{execute}{format}{delta_}v{delta_})/Lnc &{+


   +}               Force rank 0 to rank 1


   +}Numeric ???
[15]

[17]  LvC:{->}(~1{epsilon}(('',{format},{execute}{delta_}v{delta_},'')#SS '[%{+

[18]  '      ',(10{take}{delta_}v{delta_}),' Skipped.  Conflict with [%] {+
   +}separator' & {->}End
[19]

[21]  LvN:{delta_}Ok{<-}'[%]',({format}{shape}{execute}{delta_}v{delta_}),'[%{+
   +}]',({delta_}v{delta_})
[22]  {delta_}Ok{<-}{delta_}Ok,'[%]',({format}{delta_}cn{delta}),'[%]',{+
   +}ASCII2APL({format},{execute}{delta_}v{delta_})
[23]
[24]  {delta_}Z{delta}{<-}{delta_}Z{delta},{delta_}Ok & {->}(r{delta}=1)/Skip
[25]  '      ',(10{take}{delta_}v{delta_}),' Rank was 0; rank forced to 1 by {+
   +}W2W.' & {->}End


[28]  End:r{delta}{<-}1 & {->}((1{reshape}{shape}#NL 2){>=}k{delta_}{<-}k{+
   +}{delta_}+1)/L1
[29]  {->}(~{delta_}Z{delta}{match}'')/Bye & '      No variables available' &{+
   +} {->}0
[30]  Bye:'   > Variables done.' & ''
     {del}
================[ end ] =============================================



Mon, 12 Jan 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ><><><><>Heeeeeeeeeeeeeeelp on INT 14!><><><><><>

2. <<<<<YOU MUST CHECK THIS OUT >>>>>>>>>> 2103

3. <><><> FLOODFILL <><><>

4. >>>HELP, DECOMPILER<<<

5. <<<XXX Password>>>

6. <<<XXX Password>>>

7. <<<XXX Password>>>

8. >>>>>>>>>>>>>>>>>>>HEY!<<<<<<<<<<<<<<<<<<<<<<<

9. ??? <<<<<<<<<<<<<<<<<<<< RGB 4 MMX >>>>>>>>>>>>>>>>>>>>>>>?

10. ??? <<<<<<<<<<<<<<<<<<<< RGB 4 MMX >>>>>>>>>>>>>>>>>>>>>>>?

11. ------>>>>> REVERSING A STRING <<<<<-----

 

 
Powered by phpBB® Forum Software