Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!UM.CC.UMICH.EDU!Paul_Abrahams%Wayne-MTS From: Paul_Abrahams%Wayne-MTS@UM.CC.UMICH.EDU Newsgroups: comp.lang.icon Subject: Generating variables Message-ID: <266508@Wayne-MTS> Date: 2 Nov 90 19:33:12 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 26 The Icon operator ! generates a sequence of variables when it's applied to a list, string, or record. My question is: is there any way that a user-defined procedure can generate variables (other than using the "variable" function)? Here is my attempt at it; it didn't work. Paul Abrahams abrahams%wayne-mts@um.cc.umich.edu procedure main () l := [1,2,3,4] every writes(!l, " ") write() # writes 1 2 3 4 every !l := 9 every writes(!l, " ") write() # writes 9 9 9 9 every !p1(l) := 7 # produces an error; can't assign 7 to "9" every writes(!l, " ") write() end procedure p1(z) suspend !z end