associative arrays

General APL language issues

associative arrays

Postby fausap on Thu Sep 17, 2015 10:59 pm

Hello all,

I'm trying to create an associative array (like python dictionaries) in APL.

I found (on RosettaCode) the code using a "namespace"
http://rosettacode.org/wiki/Associative ... eation#APL

but I see no way to iterate through them.

Or I could create a class (with two fields : key and value) but I'm wondering if I could have a way like p[key] to access the values.

thanks in advance,
Fausto
fausap
 
Posts: 5
Joined: Wed Sep 09, 2015 9:28 pm

Re: associative arrays

Postby Phil Last on Fri Sep 18, 2015 10:30 am

User avatar
Phil Last
 
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: associative arrays

Postby Phil Last on Fri Sep 18, 2015 11:27 am

Wrong link. This is better:

http://dfns.dyalog.com/n_alists.htm
User avatar
Phil Last
 
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: associative arrays

Postby PGilbert on Fri Sep 18, 2015 1:22 pm

There is also http://aplwiki.com/KVP on the APL Wiki.
User avatar
PGilbert
 
Posts: 436
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: associative arrays

Postby fausap on Fri Sep 18, 2015 5:42 pm

Hello !

thanks all! Very useful links indeed.

Fausto
fausap
 
Posts: 5
Joined: Wed Sep 09, 2015 9:28 pm

Re: associative arrays

Postby fausap on Sat Sep 19, 2015 6:12 am

Hello,

I tried to install KVP using acre. (i'm using dyalog 14.0 unregistered-32bit)

I downloaded and decompressed the zip file, I also modified the INI file changing the ipaddress to acre.aplwiki.com, but when I try to download everything, I receive always a "Server not found" error message.

The server is reachable and pings ok.

So really I cannot understand why there's such error message.

thanks
Fausto

      #.acre.GetProject'KVP'
Read configuration-file ...\SkyDrive\APL\acre.INI
Server not found
#.acre.GetProject'KVP'

#.acre.Update''
Open public project: "Acre"
Loading 617 items from "...\APL\Acre\Acre.codefile"
Open public project: "Conga"
Loading 61 items from "...\APL\Conga\Conga.codefile"
Server not found
#.acre.Update''


my ini file is:

Code: Select all
[Acre]
 ipaddress  = acre.aplwiki.com
 portnumber = 59753
 username  = default
 password  = default
fausap
 
Posts: 5
Joined: Wed Sep 09, 2015 9:28 pm

Re: associative arrays

Postby kai on Sat Sep 19, 2015 2:11 pm

Sorry for that.

Recently I converted the APL wiki from Windows to Linux. That posed a problem because the acre server does not run under Linux (yet).

I got around this by moving the acre server to a different machine: acreserver.does-it.net. I should have updated the wiki pages accordingly but forgot to do this.
User avatar
kai
 
Posts: 137
Joined: Thu Jun 18, 2009 5:10 pm
Location: Hillesheim / Germany

Re: associative arrays

Postby fausap on Sat Sep 19, 2015 8:57 pm

Hello Kai,

I did the change in the ini file, but I receive the same error message.
In this case I can resolve the name, but the ping doesn't work (maybe it's ok due to a firewall preventing the reply, but with the other address the pings worked)

thanks,
Fausto

      C:\Users\Fausto\SkyDrive\APL\Acre\Acre saved Fri Sep 18 20:40:29 2015
Read configuration-file ...\SkyDrive\APL\acre.INI
#.acre.GetProject'KVP'
Read configuration-file ...\SkyDrive\APL\acre.INI
Server not found
#.acre.GetProject'KVP'
fausap
 
Posts: 5
Joined: Wed Sep 09, 2015 9:28 pm

Re: associative arrays

Postby kai on Tue Sep 22, 2015 11:24 am

The ping won't work indeed.

However, I have identified the problem (I think), so please try again.
User avatar
kai
 
Posts: 137
Joined: Thu Jun 18, 2009 5:10 pm
Location: Hillesheim / Germany

Re: associative arrays

Postby fausap on Tue Sep 22, 2015 8:32 pm

Hello Kai,

now it works!
Thanks
Fausto
fausap
 
Posts: 5
Joined: Wed Sep 09, 2015 9:28 pm


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest