Thanks for the link Tony! That seems to tackle exactly what I'm having trouble with.<div> -Patrick<br><br><div class="gmail_quote">On Thu, Feb 17, 2011 at 9:11 AM, Patrick Li <span dir="ltr"><<a href="mailto:patrickli.2001@gmail.com">patrickli.2001@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thanks for the help. I shall read through AMOP in more detail and see if I can get some hints from that.<div> -Patrick<div>
<div></div><div class="h5"><br><br><div class="gmail_quote">On Wed, Feb 16, 2011 at 11:25 PM, Hendrik Boom <span dir="ltr"><<a href="mailto:hendrik@topoi.pooq.com" target="_blank">hendrik@topoi.pooq.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>On Wed, Feb 16, 2011 at 11:07:49PM -0500, Patrick Li wrote:<br>
> Hello everyone,<br>
><br>
> I'm writing a toy Scheme-ish interpreter for fun, and am trying to add some<br>
> Smalltalk flavor to my Scheme system. I'm running into a bootstrapping<br>
> problem though, and would like to ask someone for a nudge in the right<br>
> direction.<br>
><br>
> (1) I want symbols to be represented as Functions.<br>
> ie. I want to be able to do this:<br>
> ('my-symbol 'length) returns 9<br>
> ('my-symbol 'equals 'my-symbol2) returns false<br>
><br>
> (2) I want symbols to be created by calling the function SYMBOL:<br>
> (SYMBOL 'new <internal-symbol-representation>) returns a new function<br>
> representing a symbol<br>
><br>
> (3) I want users to be able to override the built-in SYMBOL function.<br>
> (define SYMBOL (lambda args .... new symbol definition ....))<br>
><br>
> I can't seem to write a system like this without falling into an infinite<br>
> loop somewhere.<br>
><br>
> For example this is the last one that I ran into:<br>
><br>
> i. (quote asdf) is a special form that should create a symbol by calling<br>
> (SYMBOL 'new <internal-object-which-represents-asdf>)<br>
><br>
> ii. But doing that requires creating the 'new symbol<br>
><br>
> iii. Creating the 'new symbol requires calling<br>
> (SYMBOL 'new <internal-object-which-represents-new>)<br>
><br>
> iv. But doing that requires creating the 'new symbol<br>
><br>
> and so on.<br>
><br>
><br>
> I apologize if this seems unclear. Please ask me for clarifications if I<br>
> didn't explain myself properly. I have been stuck on this sort of problem<br>
> for a while now, and can't wrap my head around it.<br>
> -Patrick<br>
<br>
</div></div>When you find you need to have implemented something in order to<br>
implement itself within your sustem, it's a strong clue that it has to<br>
be built into the system, rather than built on top of it.. In this<br>
case, the symbol 'new, will have to be in the system to stat with, i.e.,<br>
written in whatever othe system you bootstrap from.<br>
<br>
-- hendrik<br>
_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>