Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!mis.mcw.edu!tenaglia From: tenaglia@mis.mcw.edu (Chris Tenaglia - 257-8765) Newsgroups: comp.lang.icon Subject: Re: Icon Ideas ? Message-ID: <9003262043.AA06342@uwm.edu> Date: 26 Mar 90 18:31:24 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 43 In response to a response to my posting,.... > > But back to the $. > > > > I wonder about the use of the $ to create user define operators. For example: > > > > operation("$+",lst) > > case *lst of > > { > > 1 : return &null # unary form not defined > > 2 : return lst[1] || " " || lst[2] # binary form ok > > } > > end > > > > Later ... > > > > a := b $+ c # 'a' is 'b' appended with a space and then 'c' > > d := $+e # unary form should fail or be &null > > x $+:= z # augmented form appends blank and 'z' to 'x' > > > > Is this a desirable 'feature' for Icon 8.2 or 9.0? Or would it be impractical? > > Wouldn't general operator overloading in Icon be better? Yes, I gave some thought to overloading some of the existing Icon operators. I had had some classes in ADA language which permits this. However, as a group of programmers (40 of us) discussed it. The thought that + could be * or - made us nervous. A language such as ADA is very strict about DATA TYPES, and for it NOT to be strict with the OPERATORS seemed sort of inconsistent. My icon background gives me the philosophy of typed operators as well as (loosely) typed data/procedures. It seems more natural to keep the user defined objects (operators, procedures, variables) separated from the built in ones. This is only my opinion, and it may not line up with the goals of the Icon project in the long run. Chris Tenaglia (System Manager) Medical College of Wisconsin 8701 W. Watertown Plank Rd. Milwaukee, WI 53226 (414)257-8765 tenaglia@mis.mcw.edu