<br><br><div class="gmail_quote">2013/1/16 Chris Müller <span dir="ltr"><<a href="mailto:ruunsmail@gmail.com" target="_blank">ruunsmail@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Thanks, that helped very much !<br>
      <br>
      Am 10.01.2013 12:40, schrieb Álvaro Castro-Castilla:<br>
    </div><div class="im">
    <blockquote type="cite">
      <pre>Hi!

I'll try to help you with some answers:

1) One solution would be to use Blackhole, it handles the location. If you
don't the best solution is to use the ~~ syntax:
(load "~~yourlib/yourmodule")
This will expand to your current Gambit installation directory. In my case,
this would be /usr/local/Gambit-C/yourlib/yourmodule.scm

2) Well, the place for learning Gambit usage is the documentation in the
web, AFAIK. There are also some other explanations in the wiki.

3) Use Blackhole, it will both give you a module system and a macro
expander (for syntax-rules and syntactic closures). Snow was primarily
intended to be a cross-implementation module system, for portable
libraries, but I think it wasn't very successful as it seems unmaintained.
Probably due to R6RS irruption.
I have my own system, which is not really a module system, but a way to
handle packages and automate tasks. In the near future I'll try to merge it
with Blackhole.</pre>
    </blockquote></div>
    I've managed to to get it work and start using it. <br><div class="im">
    <br>
    <blockquote type="cite">
      <pre>4) Try with pretty printing: (pp object). Another useful procedure would be
OBJECT->STRING</pre>
    </blockquote></div>
    Is it also possible to set a custom format for an object? (similar
    to<br>
    
    <a href="http://srfi.schemers.org/srfi-28/srfi-28.html" target="_blank">http://srfi.schemers.org/srfi-28/srfi-28.html</a>)
</div></blockquote><div><br></div><div>Anything is possible: I believe there's not hooks for this in the system already, because when someone wants custom formatted output it's generally more suitable for the user to implement this from scratch, though you can add any hooks you want.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">e.g. i'm currently looking for a (number->string ...) conversion,
    where i can set the <br>
    number of digits after the decimal point within the string.</div></blockquote><div><br></div><div>You can patch Gambit to make this happen. Preferably you add a parameter i.e. |make-parameter| value to Gambit's code where you specify this setting, and then make the routine - number->string I guess - pick it up.</div>

<div><br></div><div>So,</div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div>; Global scope - default behavior</div></div><div class="gmail_quote"><div>(number->string 5.2) ; => "5.2"</div>

</div><div class="gmail_quote"><div><br></div></div><div class="gmail_quote"><div>; Global scope - chris/number->string:fixed-decimals set to 5  ** Generally don't do it this way! **</div></div><div class="gmail_quote">

<div>(chris/number->string:fixed-decimals 5.2) ; => "5.20000"</div></div><div class="gmail_quote"><div><br></div></div><div class="gmail_quote"><div>; Parameterized scope with chris/number->string:fixed-decimals set to 3.           (but like this)</div>

</div><div class="gmail_quote"><div>(parameterize ((chris/number->string:fixed-decimals 3)) (number->string 5.2)) ; => "5.200"</div></div><div class="gmail_quote"><div><br></div></div><div class="gmail_quote">

<div>; Global scope - of course it's back the same i.e.</div></div><div class="gmail_quote"><div><div>(chris/number->string:fixed-decimals 5.2) ; => "5.20000"</div></div></div></blockquote><div class="gmail_quote">

<div><br></div><div>More generally, this kind of thing would be done with a formatting library. I believe it remains for one tuned for Gambit yet to come into existence - there's a SchemeFmt library, something like this, out there that's cross-scheme, perhaps it could be adapted. Someone on the ML by the name Tanya I believe got it running on Gambit.</div>

<div><br></div><div>Feel free to share any patches you produce with the ML.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">

<div class="im"><br>
    <br>
    <blockquote type="cite">
      <pre>5) In my opinion, one of the strongest points of this implementation is its
FFI capabilities. There are Cairo bindings in the dumping grounds of the
web. I have also made my own, updated to Cairo 1.12. C bindings are
_relatively_ straightforward. Objective-C seems to be as well, although I
don't have experience with this (there are some helper macros in the
dumping grounds as well). But I don't see why you would have any problems
with Glib/GTK/Cairo. You'll have to figure a way to express the
functionality of Glib's C macros.

I hope I clarified some things.

Best regards,

Álvaro

</pre>
    </blockquote>
    <br>
  </div></div>

<br>_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
<br></blockquote></div><br>