newLISP Fan Club

Forum => Whither newLISP? => Topic started by: saulgoode on April 28, 2013, 09:21:06 PM

Title: A pair of lists
Post by: saulgoode on April 28, 2013, 09:21:06 PM
I am writing a tutorial on developing a Scheme compiler and one of the data structures I am using is a pair of lists, where the car of the pair is a list of the symbols and the cdr of the pair is a list of their values.



For example, an a-list of the data might be '((a . 10) (b . 20) (c . 30))

And the p-list version would be '((a 10) (b 20) (c 30))

My data structure would be '((a b c) 10 20 30)



I am wondering if there is a common name for such a data structure (along the lines of a-list and p-list). If not, I would be open to suggestions on how I should refer to it.
Title: Re: A pair of lists
Post by: cormullion on April 29, 2013, 01:04:22 AM
Do you mean '((a b c) (10 20 30))? Perhaps an 'indexed list'?



You might try asking on comp.lang.lisp. They have opinions to spare.



Just don't call it an iList. That's probably trademarked ...
Title: Re: A pair of lists
Post by: saulgoode on April 29, 2013, 04:38:17 AM
Quote from: "cormullion"Do you mean '((a b c) (10 20 30))?


Functionally the pair of lists would be equivalent to '((abc) . (10 20 30)) but when printed, the dotted notation gets removed such that the items in the second list directly follow the first list.



"Indexed list" would still seem a fairly apt term.
Title: Re: A pair of lists
Post by: Lutz on April 30, 2013, 04:21:01 AM
The term pair of lists makes sense to me and relates to your p-list using the transpose function:


(transpose '((a b c) (10 20 30)))  --> ((a 10) (b 20) (c 30))

Ps: there are new in-progress Windows binaries and source available at:

 http://www.newlisp.org/downloads/development/inprogress/

with multiple times speed-up in unlimited precision integer division.
Title: Re: A pair of lists
Post by: rickyboy on April 30, 2013, 06:51:03 AM
Quote from: "Lutz"Ps: there are new in-progress Windows binaries and source available at:

 http://www.newlisp.org/downloads/development/inprogress/

with multiple times speed-up in unlimited precision integer division.

You da best, Lutz.  Thanks!