home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / function / 1371 < prev    next >
Encoding:
Internet Message Format  |  1992-11-15  |  1.6 KB

  1. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!spool.mu.edu!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!tmb
  2. From: tmb@arolla.idiap.ch (Thomas M. Breuel)
  3. Newsgroups: comp.lang.functional
  4. Subject: Re: Is efficient backtracking feasible in functional languages?
  5. Followup-To: comp.lang.functional
  6. Date: 15 Nov 92 19:53:22
  7. Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
  8.     Perceptive)
  9. Lines: 22
  10. Message-ID: <TMB.92Nov15195322@arolla.idiap.ch>
  11. References: <1992Nov11.171742.18783@eua.ericsson.se> <lg3071INN8m1@exodus.Eng.Sun.COM>
  12.     <1992Nov12.220621.14143@cs.tu-berlin.de>
  13. Reply-To: tmb@idiap.ch
  14. NNTP-Posting-Host: arolla.idiap.ch
  15. In-reply-to: wg@opal.cs.tu-berlin.de's message of Thu, 12 Nov 1992 22:06:21 GMT
  16.  
  17. In article <1992Nov12.220621.14143@cs.tu-berlin.de> wg@opal.cs.tu-berlin.de (Wolfgang Grieskamp) writes:
  18.  
  19.    >   strangesucc n =    hd [x|x<-[0..];x>n];
  20.    >   ...
  21.    >   [Major collection... 21% used (3397260/15733684), 1920 msec]
  22.    >   ...
  23.    >   GC Stack Overflow !
  24.  
  25.    Whats funny with this example that the stream (lazy list) in the list
  26.    comprehension can be seen as an imperative counter which is
  27.    communicated to the consumer (hd): [example deleted]
  28.  
  29. Sure. Many such expressions can be converted into something imperative
  30. (c.f. the CommonLisp Iterate macros). However, some interesting and
  31. useful others cannot.
  32.  
  33. In general, I do think it would be nice if streams became a part of
  34. eager functional programming languages and if optimizers tried to do a
  35. better job at optimizing them. What about it for "SML the next
  36. generation"?
  37.  
  38.                     Thomas.
  39.