Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!uakari.primate.wisc.edu!aplcen!haven!uvaarpa!mmdf From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.perl Subject: Icon or Perl? Message-ID: <1990Jul18.194940.6196@uvaarpa.Virginia.EDU> Date: 18 Jul 90 19:49:40 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: worley@compass.com Organization: The Internet Lines: 25 X-Name: Randal Schwartz Icon excels at what it was written for... munging strings, lists, structured data types, and so on. One major feature is that Icon directly handles "backtrack and retry" types of control flow, which is a real pain to code in a language that doesn't have it built in. Icon uses this to provide a truly awesome pattern matching facility (much more general than regexps). It can also be used to provide a short and clear program to exhaustively solve the "eight queens" problem. Interestingly, both Perl and Icon by default pattern match against a string supplied by the context. In Perl, it's $_, in Icon, it is declared by an operator (which I forget at the moment). For you language hackers, Icon can be directly translated into Scheme (pass around continuations to record resume points in operations that can be resumed). I don't think any less general control flow mechanism can translate Icon directly. Dale Worley Compass, Inc. worley@compass.com -- Klein bottle for sale ... inquire within.