<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-7" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 10.00.9200.16576"></HEAD>
<BODY>
<DIV>
<DIV><FONT face="Courier New"><FONT size=2><SPAN class=391483017-26052013>#|
Consider: |#</SPAN></FONT></FONT></DIV>
<DIV><FONT face="Courier New"><FONT size=2><SPAN
class=391483017-26052013></SPAN></FONT></FONT> </DIV>
<DIV><FONT face="Courier New"><FONT size=2><SPAN
class=391483017-26052013></SPAN>#lang racket</FONT></FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">(define (get-from-fresh-namespace
var)<BR> (let ((namespace (make-base-empty-namespace)))<BR>
(parameterize ((current-namespace namespace))<BR> (namespace-require
'racket)<BR> (namespace-variable-value var #t (ë ()
'error)))))</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">(eq?<BR> (get-from-fresh-namespace
'add1)<BR> (get-from-fresh-namespace 'add1)) ; -> #t</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">(eq?<BR> (get-from-fresh-namespace
'force)<BR> (get-from-fresh-namespace 'force)) ; -> #f</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"><FONT size=2>#|<BR>It is clear to me why the last
form produces #f. Procedure force is a predicate of a struct and is exported by
module .../collects/racket/promise.rkt. For each fresh empty base-namespace the
form (namespace-require 'racket) uses a distinct instance of this module. Each
instance defines the promise-struct freshly and provides distinct variable- and
syntax-bindings related to promises.<SPAN class=391483017-26052013> Is my
observation correct?</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">It is little bit confusing that procedure
get-from-fresh-namespace, when called with the same variable-name, in some cases
returns identical values and in other<SPAN class=391483017-26052013>s</SPAN>
does not.</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">I think it is not easy to make Racket such
as to <SPAN class=391483017-26052013>make it</SPAN> procedure
get-from-fresh-namespace always to return distinct objects (not eq?) or always
to return identical objects (eq?) when called with the same
variable-name.</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">I know, I am comparing procedures, but
as</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">|# (let ((a add1)) (eq? a add1))
#|</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">is guaranteed to return #t, I wonder what
you folks think about to make modules such as always provide the same
instance <SPAN class=391483017-26052013>of a module </SPAN>when
required<SPAN class=391483017-26052013> within the same Racket or DrRacket
session</SPAN>. Is it possible? Is it desirable?<SPAN class=391483017-26052013>
What when a module produces side effects (e.g. displayed
output)?</SPAN><BR>|#</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV></DIV></BODY></HTML>