home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / scheme / 2947 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  2.0 KB

  1. Path: sparky!uunet!gatech!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!agate!anarres.CS.Berkeley.EDU!bh
  2. From: bh@anarres.CS.Berkeley.EDU (Brian Harvey)
  3. Newsgroups: comp.lang.scheme
  4. Subject: Re: Unspecified values in R4RS
  5. Date: 22 Jan 1993 18:40:46 GMT
  6. Organization: University of California, Berkeley
  7. Lines: 34
  8. Message-ID: <1jpf3e$2m1@agate.berkeley.edu>
  9. References: <BRENT.93Jan22085102@rcx1.ssd.csd.harris.com> <1jp5n7$nm@agate.berkeley.edu> <OZ.93Jan22114638@ursa.sis.yorku.ca>
  10. NNTP-Posting-Host: anarres.cs.berkeley.edu
  11.  
  12. oz@ursa.sis.yorku.ca (Ozan Yigit) writes:
  13. >Brian Harvey writes:
  14. >
  15. >   Leaving something unspecified in the standard invites some implementor to
  16. >   give it a "useful" value; and that encourages users of that implementation
  17. >   to use it; and that makes programs non-portable.
  18. >
  19. >Are there such implementations? Isn't there some that return
  20. >#<unspecified>, which is not a "useful" value? Can we point to real
  21. >implementations, instead of talking about a hypothetical one?
  22.  
  23. I think this response doesn't take into account the context of my quoted
  24. remark.  I was arguing that, e.g., DISPLAY should be required to return
  25. a nonprinting value, instead of "unspecified" as the standard now says.
  26. Right now if you write a program like
  27.  
  28. (define (praise thing)
  29.   (display thing)
  30.   (display " is great!") )
  31.  
  32. you get interactions like
  33.  
  34. > (praise "Ice cream")
  35. Ice cream is great!#f
  36.  
  37. which is not what you wanted.  Then *someone else* suggested that it's better
  38. for the standard to leave this flexible, in case someone has a good idea for
  39. a useful return value.  You should be asking that person (I forget who, sorry)
  40. to point to a real example.  The real examples that *I* know are mostly about
  41. returning a useless but annoying value, such as #f.
  42.  
  43. I suppose someone must think it useful that many implementations of DEFINE
  44. return the symbol being defined; that's a real example for you, but *I* don't
  45. find it useful, and I'd be happy to see DEFINE return the nonprinting value too.
  46.