Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!ihlpb.UUCP!nevin1 From: nevin1@ihlpb.UUCP (Nevin J Liber +1 312 979 4751) Newsgroups: comp.lang.icon Subject: Re: Icon additions Message-ID: <8909202335.AA19395@megaron.arizona.edu> Date: 20 Sep 89 23:35:44 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 37 >If I implemented a user-accessible pointer type I would implement it in a more >pascalish way. You can get a pointer to a variable, copy a pointer, or get >a pointer to newly allocated space. My question to you is: what do you wish to be able to do with pointers in Icon? Pointers are needed in languages like Pascal, C, etc. to implement entities such as linked lists and hash tables. But these are already built into Icon! Also, trying to implement user-accessible pointers in conjunction with garbage collection is far from trivial. I just can't see what new types of *implementation-independent* (I know that there basically only one implementation of Icon right now, but language design should not be restricted to one implementation) applications that I cannot now write in Icon solely because I don't have pointers. What power would pointers give me? >The other thing I hope to be able to do is to allow arbitrary lower bounds >[on arrays,] which will improve the readability of some types of algorithms. IMHO, this would not be very Icon-ish. First off, negative indices already are defined in Icon; they allow you to work from the end of a string, list, etc. instead of the beginning; with arbituary lower bounds on arrays, this wouldn't work (there are ways to kludge it in, but code that would take advantage of it would look very messy). Secondly: for the current data types, to generate over them in reverse order the construct "every element := dataType[*dataType to 1 by -1]" works; this would not hold true for non-0 lower-bounded arrays. Thirdly: how does one pass an array to a procedure? A procedure would need some way of determining the lower bound of an array passed to it (unless you want to write different procedures for each differently bounded array as in standard Pascal -- blecch!). Or do you plan on converting all passed arrays into lists, in which case adding an array type doesn't gain you very much at all. NEVIN ":-)" LIBER AT&T Bell Laboratories nevin1@ihlpb.ATT.COM (312) 979-4751