<div dir="ltr">Thanks!<div><br></div><div>Restructuring things this way does in fact appear to work. It means I still have to cross reference stuff a bit when writing the libs, but I can safely now pen a standard library and then just provide the lot in a new simpler main.rkt. </div><div><br></div><div>You can see the result here: <a href="https://github.com/jarcane/heresy/tree/refactoring1">https://github.com/jarcane/heresy/tree/refactoring1</a> </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 23, 2014 at 3:50 PM, Gustavo Massaccesi <span dir="ltr"><<a href="mailto:gustavo@oma.org.ar" target="_blank">gustavo@oma.org.ar</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You should split the language in three parts:<br>
<br>
1) The heresy/pre-base language (or heresy/private/pre-base) that<br>
implements the basic syntax (no pun intended), for example 'if',<br>
'def', ... (probably most of the current content of heresy/main)<br>
<br>
2) The libraries, for example heresy/lib/string that implements for<br>
example 'mid', 'left', 'right', ... (I still miss 'right', I have a<br>
definition of 'string-right' in my personal racket library.)The<br>
libraries can be written mostly in heresy/pre-base, with a little part<br>
of racket. Perhaps split that in low-level libraries that use some<br>
racket and high-level libraries that use only a restricted version of<br>
heresy (pre-base + low-level libraries).<br>
<br>
3) The heresy language, that reexports all from heresy/pre-base and<br>
the libraries.<br>
<br>
If you see he implementation of racket, it starts with a #%kernel<br>
language. Then it constructs the racket/pre-base language with more<br>
features. Then it constructs the racket/base and racket languages.<br>
(Perhaps it has more intermediate steps that I missed.)<br>
<br>
<a href="https://github.com/plt/racket/blob/master/racket/collects/racket/private/base.rkt" target="_blank">https://github.com/plt/racket/blob/master/racket/collects/racket/private/base.rkt</a><br>
<br>
Gustavo<br>
<div><div class="h5"><br>
<br>
On Sat, Nov 22, 2014 at 3:47 PM, J Arcane <<a href="mailto:jarcane@gmail.com">jarcane@gmail.com</a>> wrote:<br>
> Today I decided to set about writing some standard library functions for<br>
> Heresy. My goal is to write as much as I can in Heresy proper, only falling<br>
> back to the Racket core when I need to provide a missing feature.<br>
><br>
> The trouble I'm having though, is in making any of this code available to<br>
> other Heresy code or providing it as part of the standard language. I just<br>
> run into circular dependency issues; my lang depends on the core, and if the<br>
> core depends on the library ... round and round we go.<br>
><br>
> I'm baffled as to how I can extend my language in my own language if I can't<br>
> actually provide the functions I create for it. How do I write in my lang<br>
> and the provide the results such that future programs can use them, or<br>
> especially, so that the files in my library can safely reference each other?<br>
><br>
> As always, the code is here: <a href="https://github.com/jarcane/heresy" target="_blank">https://github.com/jarcane/heresy</a><br>
><br>
> Thank you,<br>
> John Berry<br>
><br>
</div></div>> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
</blockquote></div><br></div>