Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!godot.cc.duq.edu!newsgate.duke.edu!news.mathworks.com!newsfeed.internetmci.com!swrinde!sdd.hp.com!col.hp.com!news.dtc.hp.com!hplntx!hplntx.hpl.hp.com!gjr
From: gjr@hplgr2.hpl.hp.com (Guillermo (Bill) J. Rozas)
Subject: Re: Can I use MIT Scheme with _Simply Scheme_?
Sender: news@hpl.hp.com (HPLabs Usenet Login)
Message-ID: <GJR.96May20131851@hplgr2.hpl.hp.com>
In-Reply-To: bh@anarres.CS.Berkeley.EDU's message of 17 May 1996 23:10:28 GMT
Date: Mon, 20 May 1996 20:18:51 GMT
Reply-To: gjr@hpl.hp.com
References: <m2ybmraxzc.fsf@presto.med.upenn.edu> <4nj114$o86@agate.berkeley.edu>
Nntp-Posting-Host: hplgr2.hpl.hp.com
Organization: Hewlett-Packard Laboratories, Palo Alto, CA
Lines: 52

In article <4nj114$o86@agate.berkeley.edu> bh@anarres.CS.Berkeley.EDU (Brian Harvey) writes:

|   From: bh@anarres.CS.Berkeley.EDU (Brian Harvey)
|   Date: 17 May 1996 23:10:28 GMT
|
|   jes@presto.med.upenn.edu (Joe Smith) writes:
|   >Unfortunately MIT Scheme (7.4.2) doesn't seem to like the 'simply.scm'
|   >file I snagged (from anarres.cs.berkeley), at least on my Linux
|   >machine.
|
|   The problem seems to be that MIT Scheme gets upset if you redefine
|   the primitive procedure number->string.

The fragment below shows an assignment, not a redefinition.  A
redefinition would work just fine.  See for example the rewrite at the
end.

|
|   My workaround was to replace lines 27-33 in simply.scm, which say
|
|   (let ((old-ns number->string)
|	 (string? string?))
|     (set! number->string
|	   (lambda (number)
|	     (if (string? number)
|		 number
|		 (old-ns number)))))
|
|   with the following:
|
|   (define my-number->string
|     (let ((old-ns number->string)
|	   (string? string?))
|       (lambda (number)
|	 (if (string? number)
|	     number
|	     (old-ns number)))))
|
|   and then in the rest of the file, replace every instance of number->string
|   with my-number->string.  (There are eight of them.)
|
|   I'll try to figure out an elegant way to modify simply.scm so that it
|   detects the case of MIT Scheme and does this by itself, but this will
|   solve the problem meanwhile.

(define number->string
  (let ((old-ns number->string)
	(string? string?))
    (lambda (number)
      (if (string? number)
	  number
	  (old-ns number)))))
