Trying to relearn APL after 36 years

Let it all hang out

Trying to relearn APL after 36 years

PostPosted by PaulFonline » Thu Oct 08, 2009 12:02 pm

Of all things -- I have a saved WS, and I can retrieve it with )LOAD name -- BUT how do I display the contents of the WS? I wish to see the functions as well as the main procedure which calls them.

PaulFonline
 
Posts: 2
Joined: Thu Oct 08, 2009 11:46 am

Version 0.0.1.9 -- Build #351

PostPosted by forummaster » Fri Oct 09, 2009 9:58 pm

{50.108}PaulFonline wrote:
{50.108}PaulFonline wrote:

Of all things -- I have a saved WS, and I can retrieve it with )LOAD name -- BUT how do I display the contents of the WS?  I wish to see the functions as well as the main procedure which calls them.


To do all you ask requires an APL search application which you'll need to either write or find in the public domain. We have no such app at the present, but user contributions are always welcome!
forummaster
 
Posts: 555
Joined: Wed Jan 23, 2013 1:00 pm

Version 0.0.1.9 -- Build #351

PostPosted by atlandinc » Sun Oct 23, 2011 7:45 pm

{50.108}PaulFonline wrote:
{50.108}PaulFonline wrote:
Of all things -- I have a saved WS, and I can retrieve it with )LOAD name -- BUT how do I display the contents of the WS?  I wish to see the functions as well as the main procedure which calls them.


test post...

)fns --- list the defined functions
)vars --- lists the variables
atlandinc
 
Posts: 1
Joined: Sun Oct 23, 2011 7:32 pm

Function to list the contents of a workspace

PostPosted by manandpc » Sat Jul 07, 2012 11:37 am

Here is a APL function to list the contents of the workspace, Dyalog APL compatible:
Code: Select all
      ⎕cr'listws'
listws;fnsnamelcl_;varsnames;varsnamelcl_;_r;_c;_p;_q;_z;⎕PW
varsnames←⎕NL 2 ⋄ ⎕PW←99
''
'      )WSID'
⎕WSID
''
'      )FNS' ⋄ _r←1↑⍴⎕NL 3 ⋄ _c←1+1↓⍴⎕NL 3 ⋄ _p←⌊⎕PW÷_c ⋄ _q←⌈_r÷_p
(_q,_p×_c)⍴((_q×_p),_c)↑⎕NL 3
''
'      )VARS' ⋄ _r←1↑⍴varsnames ⋄ _c←1+1↓⍴varsnames ⋄ _p←⌊⎕PW÷_c ⋄ _q←⌈_r÷_p
(_q,_p×_c)⍴((_q×_p),_c)↑varsnames
''
:For fnsnamelcl_ :In ((-+/¨∧\¨⌽¨' '=¨_z)↓¨_z←⊂[⎕IO+1]⎕NL 3)~⊂'listws'
    ⎕VR fnsnamelcl_
    ''
:EndFor
:For varsnamelcl_ :In ⊂[⎕IO+1]varsnames
    '      ',varsnamelcl_
    ⍎varsnamelcl_
    ''
:EndFor
manandpc
 
Posts: 67
Joined: Tue Jun 19, 2012 9:39 am

Re: Trying to relearn APL after 36 years

PostPosted by honey » Tue Jun 04, 2013 11:53 pm

i only have an old version of apl2000 as the only possibility to write programs for my own.
honey
 
Posts: 1
Joined: Tue Jun 04, 2013 4:30 am

Re: Trying to relearn APL after 36 years

PostPosted by manandpc » Wed Jun 05, 2013 5:04 pm

honey wrote:i only have an old version of apl2000 as the only possibility to write programs for my own.

Here is a APL function to list the contents of the workspace, old APL compatible:
Code: Select all
      ⎕cr'listws'
listws;fnsnames;fnsnamelcl_;varsnames;varsnamelcl_;_r;_c;_p;_q;⎕PW
varsnames←⎕NL 2 ⋄ ⎕PW←99
''
'      )WSID'
⎕WSID ⋄ ⍝ ←←←← comment out this, if '⎕WSID' is not available
''
'      )FNS' ⋄ _r←1↑⍴⎕NL 3 ⋄ _c←1+1↓⍴⎕NL 3 ⋄ _p←⌊⎕PW÷_c ⋄ _q←⌈_r÷_p
(_q,_p×_c)⍴((_q×_p),_c)↑⎕NL 3
''
'      )VARS' ⋄ _r←1↑⍴varsnames ⋄ _c←1+1↓⍴varsnames ⋄ _p←⌊⎕PW÷_c ⋄ _q←⌈_r÷_p
(_q,_p×_c)⍴((_q×_p),_c)↑varsnames
''
fnsnames←⎕NL 3
LoopFNS:→(0=⍴fnsnames)/LoopVARS
    fnsnamelcl_←fnsnames[⎕IO;] ⋄ fnsnames←1 0↓fnsnames
    →('listws '∧.=7↑fnsnamelcl_)/LoopFNS
    ⎕VR fnsnamelcl_
    ''
→LoopFNS
LoopVARS:→(0=⍴varsnames)/0
    varsnamelcl_←varsnames[⎕IO;] ⋄ varsnames←1 0↓varsnames
    '      ',varsnamelcl_
    ⍎varsnamelcl_
    ''
→LoopVARS
manandpc
 
Posts: 67
Joined: Tue Jun 19, 2012 9:39 am


Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron