Help with a list of lists ..............? 
Author Message
 Help with a list of lists ..............?

Hi,
    I'm attempting to construct a list that looks like this:

Master-list
01 "model1" "model2" "model3"
02 "model1" "model3" "model5"
03 "model2" "model4" "model8"

... so I can stack these models for each given position,
using the "assoc" command.  I guess my question is two part;

1) How do I construct this using the "define" command?

2) How do I add elements 01, 02, 03 to the Master-list
        and how do I add "model1" "model2" "model3"...
         to the sub-list?

        Obviously, from the simplicity of the questions, I'm
struggling with the basics of this language, but I figure you
all were new to this once too.

Thank you for your time and consideration in this matter.

Lou



Sun, 28 Apr 2002 03:00:00 GMT  
 Help with a list of lists ..............?

Quote:

> Hi,
>     I'm attempting to construct a list that looks like this:

> Master-list
> 01 "model1" "model2" "model3"
> 02 "model1" "model3" "model5"
> 03 "model2" "model4" "model8"

> ... so I can stack these models for each given position,
> using the "assoc" command.  I guess my question is two part;

> 1) How do I construct this using the "define" command?

(define master-list (list (list "01" "model1" "model2" "model3")
                          (list "02" "model1" "model3" "model5")))

Quote:
> 2) How do I add elements 01, 02, 03 to the Master-list
>         and how do I add "model1" "model2" "model3"...
>          to the sub-list?

(set! master-list (cons (list "03" "model2" "model4" "model8") master-list))

[I'm assuming you don't care too much about the order of the elements
in the master-list]

Robert
--
The above are my opinions,
 and my opinions only.



Sun, 28 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Intersection of multiple lists/list of lists

2. DXOracle / PyADO - convert lists of tuples to list of lists

3. list of lists?? please help

4. Help!! List of Lists

5. HELP: Directory Listing (popup list)...

6. How can I convert a SATHER list of lists to a TCL list of lists?

7. appending list (with list within) structure in K

8. LIST BOX AND DROP DOWN LIST BOX

9. Listing all parents relating to child list??

10. Have edit in place list box and want to updat from dropdown list

11. how do i add a dropdown pick list in a form list box

12. Internet Hot List List - Forth - Posting and Plea

 

 
Powered by phpBB® Forum Software